From 03e83a838ece01c5aaba7c1e75bdb7ec677214bc Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Thu, 6 Sep 2018 17:07:21 +0000 Subject: [PATCH] powerpc64: Add initial support for HTM (kABI) This patch adds the very initial support for HTM that might come at FreeBSD version 12.1. This basic support defines a new kABI, so, we do not need to change it later during 12.1 time frame, when the full implementation will come. Reviewed by: jhibbits Approved by: re(marius), jhibbits (mentor) Differential Revision: https://reviews.freebsd.org/D16889 --- sys/powerpc/include/pcb.h | 6 ++++++ sys/powerpc/include/pcpu.h | 1 + 2 files changed, 7 insertions(+) diff --git a/sys/powerpc/include/pcb.h b/sys/powerpc/include/pcb.h index 7bed3548ee7..451b730225c 100644 --- a/sys/powerpc/include/pcb.h +++ b/sys/powerpc/include/pcb.h @@ -56,6 +56,7 @@ struct pcb { #define PCB_VEC 0x4 /* Process had Altivec initialized */ #define PCB_VSX 0x8 /* Process had VSX initialized */ #define PCB_CDSCR 0x10 /* Process had Custom DSCR initialized */ +#define PCB_HTM 0x20 /* Process had HTM initialized */ struct fpu { union { double fpr; @@ -73,6 +74,11 @@ struct pcb { } pcb_vec __aligned(16); /* Vector processor */ unsigned int pcb_veccpu; /* which CPU had our vector stuff. */ + struct htm { + uint64_t tfhar; + uint64_t texasr; + uint64_t tfiar; + } pcb_htm; union { struct { diff --git a/sys/powerpc/include/pcpu.h b/sys/powerpc/include/pcpu.h index 5e5a24f7563..48bc4a3f6d7 100644 --- a/sys/powerpc/include/pcpu.h +++ b/sys/powerpc/include/pcpu.h @@ -45,6 +45,7 @@ struct pvo_entry; struct pmap *pc_curpmap; /* current pmap */ \ struct thread *pc_fputhread; /* current fpu user */ \ struct thread *pc_vecthread; /* current vec user */ \ + struct thread *pc_htmthread; /* current htm user */ \ uintptr_t pc_hwref; \ int pc_bsp; \ volatile int pc_awake; \