1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef X86_64_PDA_H 20 #define X86_64_PDA_H 21 #ifndef __ASSEMBLY__ 22 #include <linux/stddef.h> 23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 24 #include <linux/types.h> 25 #include <linux/cache.h> 26 #include <asm/page.h> 27 struct x8664_pda { 28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 29 struct task_struct *pcurrent; 30 unsigned long data_offset; 31 unsigned long kernelstack; 32 unsigned long oldrsp; 33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 34 int irqcount; 35 int cpunumber; 36 char *irqstackptr; 37 int nodenumber; 38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 39 unsigned int __softirq_pending; 40 unsigned int __nmi_count; 41 short mmu_state; 42 short isidle; 43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 44 struct mm_struct *active_mm; 45 unsigned apic_timer_irqs; 46 unsigned irq0_irqs; 47 unsigned irq_resched_count; 48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 49 unsigned irq_call_count; 50 unsigned irq_tlb_count; 51 unsigned irq_thermal_count; 52 unsigned irq_threshold_count; 53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 54 unsigned irq_spurious_count; 55 } ____cacheline_aligned_in_smp; 56 #define cpu_pda(i) (_cpu_pda[i]) 57 #define pda_offset(field) offsetof(struct x8664_pda, field) 58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 59 #define pda_to_op(op,field,val) do { typedef typeof(_proxy_pda.field) T__; if (0) { T__ tmp__; tmp__ = (val); } switch (sizeof(_proxy_pda.field)) { case 2: asm(op "w %1,%%gs:%c2" : "+m" (_proxy_pda.field) : "ri" ((T__)val), "i"(pda_offset(field))); break; case 4: asm(op "l %1,%%gs:%c2" : "+m" (_proxy_pda.field) : "ri" ((T__)val), "i" (pda_offset(field))); break; case 8: asm(op "q %1,%%gs:%c2": "+m" (_proxy_pda.field) : "ri" ((T__)val), "i"(pda_offset(field))); break; default: __bad_pda_field(); } } while (0) 60 #define pda_from_op(op,field) ({ typeof(_proxy_pda.field) ret__; switch (sizeof(_proxy_pda.field)) { case 2: asm(op "w %%gs:%c1,%0" : "=r" (ret__) : "i" (pda_offset(field)), "m" (_proxy_pda.field)); break; case 4: asm(op "l %%gs:%c1,%0": "=r" (ret__): "i" (pda_offset(field)), "m" (_proxy_pda.field)); break; case 8: asm(op "q %%gs:%c1,%0": "=r" (ret__) : "i" (pda_offset(field)), "m" (_proxy_pda.field)); break; default: __bad_pda_field(); } ret__; }) 61 #define read_pda(field) pda_from_op("mov",field) 62 #define write_pda(field,val) pda_to_op("mov",field,val) 63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 64 #define add_pda(field,val) pda_to_op("add",field,val) 65 #define sub_pda(field,val) pda_to_op("sub",field,val) 66 #define or_pda(field,val) pda_to_op("or",field,val) 67 #define test_and_clear_bit_pda(bit,field) ({ int old__; asm volatile("btr %2,%%gs:%c3\n\tsbbl %0,%0" : "=r" (old__), "+m" (_proxy_pda.field) : "dIr" (bit), "i" (pda_offset(field)) : "memory"); old__; }) 68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 69 #endif 70 #define PDA_STACKOFFSET (5*8) 71 #endif 72