summaryrefslogtreecommitdiffstats
path: root/9/platforms/android-13/arch-x86/usr/include/asm/pda.h
blob: a105f289e58b9c6172ca3872f4bdba74d764b83c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/****************************************************************************
 ****************************************************************************
 ***
 ***   This header was automatically generated from a Linux kernel header
 ***   of the same name, to make information necessary for userspace to
 ***   call into the kernel available to libc.  It contains only constants,
 ***   structures, and macros generated from the original header, and thus,
 ***   contains no copyrightable information.
 ***
 ***   To edit the content of this header, modify the corresponding
 ***   source file (e.g. under external/kernel-headers/original/) then
 ***   run bionic/libc/kernel/tools/update_all.py
 ***
 ***   Any manual change here will be lost the next time this script will
 ***   be run. You've been warned!
 ***
 ****************************************************************************
 ****************************************************************************/
#ifndef X86_64_PDA_H
#define X86_64_PDA_H
#ifndef __ASSEMBLY__
#include <linux/stddef.h>
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#include <linux/types.h>
#include <linux/cache.h>
#include <asm/page.h>
struct x8664_pda {
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 struct task_struct *pcurrent;
 unsigned long data_offset;
 unsigned long kernelstack;
 unsigned long oldrsp;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 int irqcount;
 int cpunumber;
 char *irqstackptr;
 int nodenumber;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 unsigned int __softirq_pending;
 unsigned int __nmi_count;
 short mmu_state;
 short isidle;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 struct mm_struct *active_mm;
 unsigned apic_timer_irqs;
 unsigned irq0_irqs;
 unsigned irq_resched_count;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 unsigned irq_call_count;
 unsigned irq_tlb_count;
 unsigned irq_thermal_count;
 unsigned irq_threshold_count;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 unsigned irq_spurious_count;
} ____cacheline_aligned_in_smp;
#define cpu_pda(i) (_cpu_pda[i])
#define pda_offset(field) offsetof(struct x8664_pda, field)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#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)
#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__; })
#define read_pda(field) pda_from_op("mov",field)
#define write_pda(field,val) pda_to_op("mov",field,val)
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define add_pda(field,val) pda_to_op("add",field,val)
#define sub_pda(field,val) pda_to_op("sub",field,val)
#define or_pda(field,val) pda_to_op("or",field,val)
#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__;  })
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#endif
#define PDA_STACKOFFSET (5*8)
#endif