31 #ifndef CPU_X86_MM_TSS_PROT_DOMAINS_H_
32 #define CPU_X86_MM_TSS_PROT_DOMAINS_H_
37 #include "ldt-layout.h"
38 #include "segmentation.h"
41 struct dom_kern_data {
49 #include "multi-segment.h"
64 extern uint32_t prot_domains_main_esp;
66 #define SYSCALLS_STUB_MIDDLE(nm) \
69 " je _syscall_" #nm "\n\t" \
70 " movl $" EXP_STRINGIFY(_syscall_ent_##nm) ", prot_domains_syscall\n\t" \
71 " mov %esp, prot_domains_main_esp\n\t"
73 #define SYSCALLS_STUB(nm) \
74 SYSCALLS_ALLOC_ENTRYPOINT(nm); \
77 ".global " #nm "\n\t" \
82 " cmpw %ax, 8(%esp)\n\t" \
83 SYSCALLS_STUB_MIDDLE(nm) \
86 " lcall *4(%esp)\n\t" \
89 #define SYSCALLS_STUB_SINGLETON(nm, dcd) \
90 SYSCALLS_ALLOC_ENTRYPOINT(nm); \
93 ".global " #nm "\n\t" \
98 " cmpw %ax, %" SEG_KERN "s:(4 + " #dcd ")\n\t" \
99 SYSCALLS_STUB_MIDDLE(nm) \
102 " lcall *%" SEG_KERN "s:" #dcd "\n\t" \
105 #define PROT_DOMAINS_ENTER_ISR(exc) \
106 MULTI_SEGMENT_ENTER_ISR(exc) \
111 "mov prot_domains_main_esp, %%esi\n\t" \
112 "mov prot_domains_syscall, %%edi\n\t" \
113 PROT_DOMAINS_ENTER_ISR_COMMON(exc)
114 #define PROT_DOMAINS_LEAVE_ISR(exc) \
115 PROT_DOMAINS_LEAVE_ISR_COMMON(exc) \
116 "mov %%edi, prot_domains_syscall\n\t" \
117 "mov %%esi, prot_domains_main_esp\n\t" \
118 MULTI_SEGMENT_LEAVE_ISR(exc)
127 #define PROT_DOMAINS_ALLOC_IMPL(nm) \
128 static segment_desc_t ATTR_BSS_GDT_MID _gdt_storage_##nm[2]
#define __attribute__(nothing)
Define attribute to nothing since it isn't handled by IAR.
uint32_t tss_sel
The selector is only 16 bits, but it is padded to 32 bits.
Data associated with each protection domain that is owned by clients of that domain and used to ident...