diff options
Diffstat (limited to 'include/asm-i386')
-rw-r--r-- | include/asm-i386/atomic.h | 1 | ||||
-rw-r--r-- | include/asm-i386/bitops.h | 26 | ||||
-rw-r--r-- | include/asm-i386/bugs.h | 23 | ||||
-rw-r--r-- | include/asm-i386/cacheflush.h | 4 | ||||
-rw-r--r-- | include/asm-i386/desc.h | 8 | ||||
-rw-r--r-- | include/asm-i386/mach-bigsmp/mach_apic.h | 79 | ||||
-rw-r--r-- | include/asm-i386/mach-bigsmp/mach_apicdef.h | 4 | ||||
-rw-r--r-- | include/asm-i386/mman.h | 1 | ||||
-rw-r--r-- | include/asm-i386/mmzone.h | 5 | ||||
-rw-r--r-- | include/asm-i386/module.h | 4 | ||||
-rw-r--r-- | include/asm-i386/mpspec_def.h | 2 | ||||
-rw-r--r-- | include/asm-i386/segment.h | 14 | ||||
-rw-r--r-- | include/asm-i386/system.h | 31 | ||||
-rw-r--r-- | include/asm-i386/unistd.h | 2 |
14 files changed, 102 insertions, 102 deletions
diff --git a/include/asm-i386/atomic.h b/include/asm-i386/atomic.h index c68557aa04b..7a5472d7709 100644 --- a/include/asm-i386/atomic.h +++ b/include/asm-i386/atomic.h | |||
@@ -254,4 +254,5 @@ __asm__ __volatile__(LOCK "orl %0,%1" \ | |||
254 | #define smp_mb__before_atomic_inc() barrier() | 254 | #define smp_mb__before_atomic_inc() barrier() |
255 | #define smp_mb__after_atomic_inc() barrier() | 255 | #define smp_mb__after_atomic_inc() barrier() |
256 | 256 | ||
257 | #include <asm-generic/atomic.h> | ||
257 | #endif | 258 | #endif |
diff --git a/include/asm-i386/bitops.h b/include/asm-i386/bitops.h index 4807aa1d2e3..65679aca4b2 100644 --- a/include/asm-i386/bitops.h +++ b/include/asm-i386/bitops.h | |||
@@ -332,9 +332,9 @@ static inline unsigned long __ffs(unsigned long word) | |||
332 | * Returns the bit-number of the first set bit, not the number of the byte | 332 | * Returns the bit-number of the first set bit, not the number of the byte |
333 | * containing a bit. | 333 | * containing a bit. |
334 | */ | 334 | */ |
335 | static inline int find_first_bit(const unsigned long *addr, unsigned size) | 335 | static inline unsigned find_first_bit(const unsigned long *addr, unsigned size) |
336 | { | 336 | { |
337 | int x = 0; | 337 | unsigned x = 0; |
338 | 338 | ||
339 | while (x < size) { | 339 | while (x < size) { |
340 | unsigned long val = *addr++; | 340 | unsigned long val = *addr++; |
@@ -367,11 +367,6 @@ static inline unsigned long ffz(unsigned long word) | |||
367 | return word; | 367 | return word; |
368 | } | 368 | } |
369 | 369 | ||
370 | /* | ||
371 | * fls: find last bit set. | ||
372 | */ | ||
373 | |||
374 | #define fls(x) generic_fls(x) | ||
375 | #define fls64(x) generic_fls64(x) | 370 | #define fls64(x) generic_fls64(x) |
376 | 371 | ||
377 | #ifdef __KERNEL__ | 372 | #ifdef __KERNEL__ |
@@ -415,6 +410,23 @@ static inline int ffs(int x) | |||
415 | } | 410 | } |
416 | 411 | ||
417 | /** | 412 | /** |
413 | * fls - find last bit set | ||
414 | * @x: the word to search | ||
415 | * | ||
416 | * This is defined the same way as ffs. | ||
417 | */ | ||
418 | static inline int fls(int x) | ||
419 | { | ||
420 | int r; | ||
421 | |||
422 | __asm__("bsrl %1,%0\n\t" | ||
423 | "jnz 1f\n\t" | ||
424 | "movl $-1,%0\n" | ||
425 | "1:" : "=r" (r) : "rm" (x)); | ||
426 | return r+1; | ||
427 | } | ||
428 | |||
429 | /** | ||
418 | * hweightN - returns the hamming weight of a N-bit word | 430 | * hweightN - returns the hamming weight of a N-bit word |
419 | * @x: the word to weigh | 431 | * @x: the word to weigh |
420 | * | 432 | * |
diff --git a/include/asm-i386/bugs.h b/include/asm-i386/bugs.h index ea54540638d..50233e0345f 100644 --- a/include/asm-i386/bugs.h +++ b/include/asm-i386/bugs.h | |||
@@ -8,9 +8,6 @@ | |||
8 | * <rreilova@ececs.uc.edu> | 8 | * <rreilova@ececs.uc.edu> |
9 | * - Channing Corn (tests & fixes), | 9 | * - Channing Corn (tests & fixes), |
10 | * - Andrew D. Balsa (code cleanup). | 10 | * - Andrew D. Balsa (code cleanup). |
11 | * | ||
12 | * Pentium III FXSR, SSE support | ||
13 | * Gareth Hughes <gareth@valinux.com>, May 2000 | ||
14 | */ | 11 | */ |
15 | 12 | ||
16 | /* | 13 | /* |
@@ -76,25 +73,7 @@ static void __init check_fpu(void) | |||
76 | return; | 73 | return; |
77 | } | 74 | } |
78 | 75 | ||
79 | /* Enable FXSR and company _before_ testing for FP problems. */ | 76 | /* trap_init() enabled FXSR and company _before_ testing for FP problems here. */ |
80 | /* | ||
81 | * Verify that the FXSAVE/FXRSTOR data will be 16-byte aligned. | ||
82 | */ | ||
83 | if (offsetof(struct task_struct, thread.i387.fxsave) & 15) { | ||
84 | extern void __buggy_fxsr_alignment(void); | ||
85 | __buggy_fxsr_alignment(); | ||
86 | } | ||
87 | if (cpu_has_fxsr) { | ||
88 | printk(KERN_INFO "Enabling fast FPU save and restore... "); | ||
89 | set_in_cr4(X86_CR4_OSFXSR); | ||
90 | printk("done.\n"); | ||
91 | } | ||
92 | if (cpu_has_xmm) { | ||
93 | printk(KERN_INFO "Enabling unmasked SIMD FPU exception support... "); | ||
94 | set_in_cr4(X86_CR4_OSXMMEXCPT); | ||
95 | printk("done.\n"); | ||
96 | } | ||
97 | |||
98 | /* Test for the divl bug.. */ | 77 | /* Test for the divl bug.. */ |
99 | __asm__("fninit\n\t" | 78 | __asm__("fninit\n\t" |
100 | "fldl %1\n\t" | 79 | "fldl %1\n\t" |
diff --git a/include/asm-i386/cacheflush.h b/include/asm-i386/cacheflush.h index 2ea36dea37d..7199f7b326f 100644 --- a/include/asm-i386/cacheflush.h +++ b/include/asm-i386/cacheflush.h | |||
@@ -31,4 +31,8 @@ int change_page_attr(struct page *page, int numpages, pgprot_t prot); | |||
31 | void kernel_map_pages(struct page *page, int numpages, int enable); | 31 | void kernel_map_pages(struct page *page, int numpages, int enable); |
32 | #endif | 32 | #endif |
33 | 33 | ||
34 | #ifdef CONFIG_DEBUG_RODATA | ||
35 | void mark_rodata_ro(void); | ||
36 | #endif | ||
37 | |||
34 | #endif /* _I386_CACHEFLUSH_H */ | 38 | #endif /* _I386_CACHEFLUSH_H */ |
diff --git a/include/asm-i386/desc.h b/include/asm-i386/desc.h index 29b851a18c6..494e73bca09 100644 --- a/include/asm-i386/desc.h +++ b/include/asm-i386/desc.h | |||
@@ -15,9 +15,6 @@ | |||
15 | #include <asm/mmu.h> | 15 | #include <asm/mmu.h> |
16 | 16 | ||
17 | extern struct desc_struct cpu_gdt_table[GDT_ENTRIES]; | 17 | extern struct desc_struct cpu_gdt_table[GDT_ENTRIES]; |
18 | DECLARE_PER_CPU(struct desc_struct, cpu_gdt_table[GDT_ENTRIES]); | ||
19 | |||
20 | #define get_cpu_gdt_table(_cpu) (per_cpu(cpu_gdt_table,_cpu)) | ||
21 | 18 | ||
22 | DECLARE_PER_CPU(unsigned char, cpu_16bit_stack[CPU_16BIT_STACK_SIZE]); | 19 | DECLARE_PER_CPU(unsigned char, cpu_16bit_stack[CPU_16BIT_STACK_SIZE]); |
23 | 20 | ||
@@ -29,6 +26,11 @@ struct Xgt_desc_struct { | |||
29 | 26 | ||
30 | extern struct Xgt_desc_struct idt_descr, cpu_gdt_descr[NR_CPUS]; | 27 | extern struct Xgt_desc_struct idt_descr, cpu_gdt_descr[NR_CPUS]; |
31 | 28 | ||
29 | static inline struct desc_struct *get_cpu_gdt_table(unsigned int cpu) | ||
30 | { | ||
31 | return ((struct desc_struct *)cpu_gdt_descr[cpu].address); | ||
32 | } | ||
33 | |||
32 | #define load_TR_desc() __asm__ __volatile__("ltr %w0"::"q" (GDT_ENTRY_TSS*8)) | 34 | #define load_TR_desc() __asm__ __volatile__("ltr %w0"::"q" (GDT_ENTRY_TSS*8)) |
33 | #define load_LDT_desc() __asm__ __volatile__("lldt %w0"::"q" (GDT_ENTRY_LDT*8)) | 35 | #define load_LDT_desc() __asm__ __volatile__("lldt %w0"::"q" (GDT_ENTRY_LDT*8)) |
34 | 36 | ||
diff --git a/include/asm-i386/mach-bigsmp/mach_apic.h b/include/asm-i386/mach-bigsmp/mach_apic.h index ba936d4daed..18b19a77344 100644 --- a/include/asm-i386/mach-bigsmp/mach_apic.h +++ b/include/asm-i386/mach-bigsmp/mach_apic.h | |||
@@ -1,17 +1,10 @@ | |||
1 | #ifndef __ASM_MACH_APIC_H | 1 | #ifndef __ASM_MACH_APIC_H |
2 | #define __ASM_MACH_APIC_H | 2 | #define __ASM_MACH_APIC_H |
3 | #include <asm/smp.h> | 3 | |
4 | 4 | ||
5 | #define SEQUENTIAL_APICID | 5 | extern u8 bios_cpu_apicid[]; |
6 | #ifdef SEQUENTIAL_APICID | 6 | |
7 | #define xapic_phys_to_log_apicid(phys_apic) ( (1ul << ((phys_apic) & 0x3)) |\ | 7 | #define xapic_phys_to_log_apicid(cpu) (bios_cpu_apicid[cpu]) |
8 | ((phys_apic<<2) & (~0xf)) ) | ||
9 | #elif CLUSTERED_APICID | ||
10 | #define xapic_phys_to_log_apicid(phys_apic) ( (1ul << ((phys_apic) & 0x3)) |\ | ||
11 | ((phys_apic) & (~0xf)) ) | ||
12 | #endif | ||
13 | |||
14 | #define NO_BALANCE_IRQ (1) | ||
15 | #define esr_disable (1) | 8 | #define esr_disable (1) |
16 | 9 | ||
17 | static inline int apic_id_registered(void) | 10 | static inline int apic_id_registered(void) |
@@ -19,7 +12,6 @@ static inline int apic_id_registered(void) | |||
19 | return (1); | 12 | return (1); |
20 | } | 13 | } |
21 | 14 | ||
22 | #define APIC_DFR_VALUE (APIC_DFR_CLUSTER) | ||
23 | /* Round robin the irqs amoung the online cpus */ | 15 | /* Round robin the irqs amoung the online cpus */ |
24 | static inline cpumask_t target_cpus(void) | 16 | static inline cpumask_t target_cpus(void) |
25 | { | 17 | { |
@@ -32,29 +24,34 @@ static inline cpumask_t target_cpus(void) | |||
32 | } while (cpu >= NR_CPUS); | 24 | } while (cpu >= NR_CPUS); |
33 | return cpumask_of_cpu(cpu); | 25 | return cpumask_of_cpu(cpu); |
34 | } | 26 | } |
35 | #define TARGET_CPUS (target_cpus()) | ||
36 | 27 | ||
37 | #define INT_DELIVERY_MODE dest_Fixed | 28 | #undef APIC_DEST_LOGICAL |
38 | #define INT_DEST_MODE 1 /* logical delivery broadcast to all procs */ | 29 | #define APIC_DEST_LOGICAL 0 |
30 | #define TARGET_CPUS (target_cpus()) | ||
31 | #define APIC_DFR_VALUE (APIC_DFR_FLAT) | ||
32 | #define INT_DELIVERY_MODE (dest_Fixed) | ||
33 | #define INT_DEST_MODE (0) /* phys delivery to target proc */ | ||
34 | #define NO_BALANCE_IRQ (0) | ||
35 | #define WAKE_SECONDARY_VIA_INIT | ||
36 | |||
39 | 37 | ||
40 | static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid) | 38 | static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid) |
41 | { | 39 | { |
42 | return 0; | 40 | return (0); |
43 | } | 41 | } |
44 | 42 | ||
45 | /* we don't use the phys_cpu_present_map to indicate apicid presence */ | 43 | static inline unsigned long check_apicid_present(int bit) |
46 | static inline unsigned long check_apicid_present(int bit) | ||
47 | { | 44 | { |
48 | return 1; | 45 | return (1); |
49 | } | 46 | } |
50 | 47 | ||
51 | #define apicid_cluster(apicid) (apicid & 0xF0) | 48 | static inline unsigned long calculate_ldr(int cpu) |
52 | |||
53 | static inline unsigned long calculate_ldr(unsigned long old) | ||
54 | { | 49 | { |
55 | unsigned long id; | 50 | unsigned long val, id; |
56 | id = xapic_phys_to_log_apicid(hard_smp_processor_id()); | 51 | val = apic_read(APIC_LDR) & ~APIC_LDR_MASK; |
57 | return ((old & ~APIC_LDR_MASK) | SET_APIC_LOGICAL_ID(id)); | 52 | id = xapic_phys_to_log_apicid(cpu); |
53 | val |= SET_APIC_LOGICAL_ID(id); | ||
54 | return val; | ||
58 | } | 55 | } |
59 | 56 | ||
60 | /* | 57 | /* |
@@ -67,37 +64,35 @@ static inline unsigned long calculate_ldr(unsigned long old) | |||
67 | static inline void init_apic_ldr(void) | 64 | static inline void init_apic_ldr(void) |
68 | { | 65 | { |
69 | unsigned long val; | 66 | unsigned long val; |
67 | int cpu = smp_processor_id(); | ||
70 | 68 | ||
71 | apic_write_around(APIC_DFR, APIC_DFR_VALUE); | 69 | apic_write_around(APIC_DFR, APIC_DFR_VALUE); |
72 | val = apic_read(APIC_LDR) & ~APIC_LDR_MASK; | 70 | val = calculate_ldr(cpu); |
73 | val = calculate_ldr(val); | ||
74 | apic_write_around(APIC_LDR, val); | 71 | apic_write_around(APIC_LDR, val); |
75 | } | 72 | } |
76 | 73 | ||
77 | static inline void clustered_apic_check(void) | 74 | static inline void clustered_apic_check(void) |
78 | { | 75 | { |
79 | printk("Enabling APIC mode: %s. Using %d I/O APICs\n", | 76 | printk("Enabling APIC mode: %s. Using %d I/O APICs\n", |
80 | "Cluster", nr_ioapics); | 77 | "Physflat", nr_ioapics); |
81 | } | 78 | } |
82 | 79 | ||
83 | static inline int multi_timer_check(int apic, int irq) | 80 | static inline int multi_timer_check(int apic, int irq) |
84 | { | 81 | { |
85 | return 0; | 82 | return (0); |
86 | } | 83 | } |
87 | 84 | ||
88 | static inline int apicid_to_node(int logical_apicid) | 85 | static inline int apicid_to_node(int logical_apicid) |
89 | { | 86 | { |
90 | return 0; | 87 | return (0); |
91 | } | 88 | } |
92 | 89 | ||
93 | extern u8 bios_cpu_apicid[]; | ||
94 | |||
95 | static inline int cpu_present_to_apicid(int mps_cpu) | 90 | static inline int cpu_present_to_apicid(int mps_cpu) |
96 | { | 91 | { |
97 | if (mps_cpu < NR_CPUS) | 92 | if (mps_cpu < NR_CPUS) |
98 | return (int)bios_cpu_apicid[mps_cpu]; | 93 | return (int) bios_cpu_apicid[mps_cpu]; |
99 | else | 94 | |
100 | return BAD_APICID; | 95 | return BAD_APICID; |
101 | } | 96 | } |
102 | 97 | ||
103 | static inline physid_mask_t apicid_to_cpu_present(int phys_apicid) | 98 | static inline physid_mask_t apicid_to_cpu_present(int phys_apicid) |
@@ -109,10 +104,10 @@ extern u8 cpu_2_logical_apicid[]; | |||
109 | /* Mapping from cpu number to logical apicid */ | 104 | /* Mapping from cpu number to logical apicid */ |
110 | static inline int cpu_to_logical_apicid(int cpu) | 105 | static inline int cpu_to_logical_apicid(int cpu) |
111 | { | 106 | { |
112 | if (cpu >= NR_CPUS) | 107 | if (cpu >= NR_CPUS) |
113 | return BAD_APICID; | 108 | return BAD_APICID; |
114 | return (int)cpu_2_logical_apicid[cpu]; | 109 | return cpu_physical_id(cpu); |
115 | } | 110 | } |
116 | 111 | ||
117 | static inline int mpc_apic_id(struct mpc_config_processor *m, | 112 | static inline int mpc_apic_id(struct mpc_config_processor *m, |
118 | struct mpc_config_translation *translation_record) | 113 | struct mpc_config_translation *translation_record) |
@@ -128,11 +123,9 @@ static inline int mpc_apic_id(struct mpc_config_processor *m, | |||
128 | static inline physid_mask_t ioapic_phys_id_map(physid_mask_t phys_map) | 123 | static inline physid_mask_t ioapic_phys_id_map(physid_mask_t phys_map) |
129 | { | 124 | { |
130 | /* For clustered we don't have a good way to do this yet - hack */ | 125 | /* For clustered we don't have a good way to do this yet - hack */ |
131 | return physids_promote(0xFUL); | 126 | return physids_promote(0xFFL); |
132 | } | 127 | } |
133 | 128 | ||
134 | #define WAKE_SECONDARY_VIA_INIT | ||
135 | |||
136 | static inline void setup_portio_remap(void) | 129 | static inline void setup_portio_remap(void) |
137 | { | 130 | { |
138 | } | 131 | } |
diff --git a/include/asm-i386/mach-bigsmp/mach_apicdef.h b/include/asm-i386/mach-bigsmp/mach_apicdef.h index 23e58b317c7..a58ab5a75c8 100644 --- a/include/asm-i386/mach-bigsmp/mach_apicdef.h +++ b/include/asm-i386/mach-bigsmp/mach_apicdef.h | |||
@@ -1,11 +1,11 @@ | |||
1 | #ifndef __ASM_MACH_APICDEF_H | 1 | #ifndef __ASM_MACH_APICDEF_H |
2 | #define __ASM_MACH_APICDEF_H | 2 | #define __ASM_MACH_APICDEF_H |
3 | 3 | ||
4 | #define APIC_ID_MASK (0x0F<<24) | 4 | #define APIC_ID_MASK (0xFF<<24) |
5 | 5 | ||
6 | static inline unsigned get_apic_id(unsigned long x) | 6 | static inline unsigned get_apic_id(unsigned long x) |
7 | { | 7 | { |
8 | return (((x)>>24)&0x0F); | 8 | return (((x)>>24)&0xFF); |
9 | } | 9 | } |
10 | 10 | ||
11 | #define GET_APIC_ID(x) get_apic_id(x) | 11 | #define GET_APIC_ID(x) get_apic_id(x) |
diff --git a/include/asm-i386/mman.h b/include/asm-i386/mman.h index 196619a8385..ba4941e6f64 100644 --- a/include/asm-i386/mman.h +++ b/include/asm-i386/mman.h | |||
@@ -35,6 +35,7 @@ | |||
35 | #define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */ | 35 | #define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */ |
36 | #define MADV_WILLNEED 0x3 /* pre-fault pages */ | 36 | #define MADV_WILLNEED 0x3 /* pre-fault pages */ |
37 | #define MADV_DONTNEED 0x4 /* discard these pages */ | 37 | #define MADV_DONTNEED 0x4 /* discard these pages */ |
38 | #define MADV_REMOVE 0x5 /* remove these pages & resources */ | ||
38 | 39 | ||
39 | /* compatibility flags */ | 40 | /* compatibility flags */ |
40 | #define MAP_ANON MAP_ANONYMOUS | 41 | #define MAP_ANON MAP_ANONYMOUS |
diff --git a/include/asm-i386/mmzone.h b/include/asm-i386/mmzone.h index 620a90641ea..74f595d8057 100644 --- a/include/asm-i386/mmzone.h +++ b/include/asm-i386/mmzone.h | |||
@@ -76,11 +76,6 @@ static inline int pfn_to_nid(unsigned long pfn) | |||
76 | * Following are macros that each numa implmentation must define. | 76 | * Following are macros that each numa implmentation must define. |
77 | */ | 77 | */ |
78 | 78 | ||
79 | /* | ||
80 | * Given a kernel address, find the home node of the underlying memory. | ||
81 | */ | ||
82 | #define kvaddr_to_nid(kaddr) pfn_to_nid(__pa(kaddr) >> PAGE_SHIFT) | ||
83 | |||
84 | #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) | 79 | #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) |
85 | #define node_end_pfn(nid) \ | 80 | #define node_end_pfn(nid) \ |
86 | ({ \ | 81 | ({ \ |
diff --git a/include/asm-i386/module.h b/include/asm-i386/module.h index eb7f2b4234a..424661d25bd 100644 --- a/include/asm-i386/module.h +++ b/include/asm-i386/module.h | |||
@@ -52,8 +52,10 @@ struct mod_arch_specific | |||
52 | #define MODULE_PROC_FAMILY "CYRIXIII " | 52 | #define MODULE_PROC_FAMILY "CYRIXIII " |
53 | #elif defined CONFIG_MVIAC3_2 | 53 | #elif defined CONFIG_MVIAC3_2 |
54 | #define MODULE_PROC_FAMILY "VIAC3-2 " | 54 | #define MODULE_PROC_FAMILY "VIAC3-2 " |
55 | #elif CONFIG_MGEODEGX1 | 55 | #elif defined CONFIG_MGEODEGX1 |
56 | #define MODULE_PROC_FAMILY "GEODEGX1 " | 56 | #define MODULE_PROC_FAMILY "GEODEGX1 " |
57 | #elif defined CONFIG_MGEODE_LX | ||
58 | #define MODULE_PROC_FAMILY "GEODE " | ||
57 | #else | 59 | #else |
58 | #error unknown processor family | 60 | #error unknown processor family |
59 | #endif | 61 | #endif |
diff --git a/include/asm-i386/mpspec_def.h b/include/asm-i386/mpspec_def.h index a961093dbf8..76feedf85a8 100644 --- a/include/asm-i386/mpspec_def.h +++ b/include/asm-i386/mpspec_def.h | |||
@@ -75,7 +75,7 @@ struct mpc_config_bus | |||
75 | { | 75 | { |
76 | unsigned char mpc_type; | 76 | unsigned char mpc_type; |
77 | unsigned char mpc_busid; | 77 | unsigned char mpc_busid; |
78 | unsigned char mpc_bustype[6] __attribute((packed)); | 78 | unsigned char mpc_bustype[6]; |
79 | }; | 79 | }; |
80 | 80 | ||
81 | /* List of Bus Type string values, Intel MP Spec. */ | 81 | /* List of Bus Type string values, Intel MP Spec. */ |
diff --git a/include/asm-i386/segment.h b/include/asm-i386/segment.h index bb5ff5b2c02..faf995307b9 100644 --- a/include/asm-i386/segment.h +++ b/include/asm-i386/segment.h | |||
@@ -91,6 +91,20 @@ | |||
91 | #define GDT_ENTRY_BOOT_DS (GDT_ENTRY_BOOT_CS + 1) | 91 | #define GDT_ENTRY_BOOT_DS (GDT_ENTRY_BOOT_CS + 1) |
92 | #define __BOOT_DS (GDT_ENTRY_BOOT_DS * 8) | 92 | #define __BOOT_DS (GDT_ENTRY_BOOT_DS * 8) |
93 | 93 | ||
94 | /* The PnP BIOS entries in the GDT */ | ||
95 | #define GDT_ENTRY_PNPBIOS_CS32 (GDT_ENTRY_PNPBIOS_BASE + 0) | ||
96 | #define GDT_ENTRY_PNPBIOS_CS16 (GDT_ENTRY_PNPBIOS_BASE + 1) | ||
97 | #define GDT_ENTRY_PNPBIOS_DS (GDT_ENTRY_PNPBIOS_BASE + 2) | ||
98 | #define GDT_ENTRY_PNPBIOS_TS1 (GDT_ENTRY_PNPBIOS_BASE + 3) | ||
99 | #define GDT_ENTRY_PNPBIOS_TS2 (GDT_ENTRY_PNPBIOS_BASE + 4) | ||
100 | |||
101 | /* The PnP BIOS selectors */ | ||
102 | #define PNP_CS32 (GDT_ENTRY_PNPBIOS_CS32 * 8) /* segment for calling fn */ | ||
103 | #define PNP_CS16 (GDT_ENTRY_PNPBIOS_CS16 * 8) /* code segment for BIOS */ | ||
104 | #define PNP_DS (GDT_ENTRY_PNPBIOS_DS * 8) /* data segment for BIOS */ | ||
105 | #define PNP_TS1 (GDT_ENTRY_PNPBIOS_TS1 * 8) /* transfer data segment */ | ||
106 | #define PNP_TS2 (GDT_ENTRY_PNPBIOS_TS2 * 8) /* another data segment */ | ||
107 | |||
94 | /* | 108 | /* |
95 | * The interrupt descriptor table has room for 256 idt's, | 109 | * The interrupt descriptor table has room for 256 idt's, |
96 | * the global descriptor table is dependent on the number | 110 | * the global descriptor table is dependent on the number |
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h index 772f85da120..9c0593b7a94 100644 --- a/include/asm-i386/system.h +++ b/include/asm-i386/system.h | |||
@@ -54,23 +54,7 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \ | |||
54 | ); } while(0) | 54 | ); } while(0) |
55 | 55 | ||
56 | #define set_base(ldt,base) _set_base( ((char *)&(ldt)) , (base) ) | 56 | #define set_base(ldt,base) _set_base( ((char *)&(ldt)) , (base) ) |
57 | #define set_limit(ldt,limit) _set_limit( ((char *)&(ldt)) , ((limit)-1)>>12 ) | 57 | #define set_limit(ldt,limit) _set_limit( ((char *)&(ldt)) , ((limit)-1) ) |
58 | |||
59 | static inline unsigned long _get_base(char * addr) | ||
60 | { | ||
61 | unsigned long __base; | ||
62 | __asm__("movb %3,%%dh\n\t" | ||
63 | "movb %2,%%dl\n\t" | ||
64 | "shll $16,%%edx\n\t" | ||
65 | "movw %1,%%dx" | ||
66 | :"=&d" (__base) | ||
67 | :"m" (*((addr)+2)), | ||
68 | "m" (*((addr)+4)), | ||
69 | "m" (*((addr)+7))); | ||
70 | return __base; | ||
71 | } | ||
72 | |||
73 | #define get_base(ldt) _get_base( ((char *)&(ldt)) ) | ||
74 | 58 | ||
75 | /* | 59 | /* |
76 | * Load a segment. Fall back on loading the zero | 60 | * Load a segment. Fall back on loading the zero |
@@ -140,6 +124,19 @@ static inline unsigned long _get_base(char * addr) | |||
140 | :"=r" (__dummy)); \ | 124 | :"=r" (__dummy)); \ |
141 | __dummy; \ | 125 | __dummy; \ |
142 | }) | 126 | }) |
127 | |||
128 | #define read_cr4_safe() ({ \ | ||
129 | unsigned int __dummy; \ | ||
130 | /* This could fault if %cr4 does not exist */ \ | ||
131 | __asm__("1: movl %%cr4, %0 \n" \ | ||
132 | "2: \n" \ | ||
133 | ".section __ex_table,\"a\" \n" \ | ||
134 | ".long 1b,2b \n" \ | ||
135 | ".previous \n" \ | ||
136 | : "=r" (__dummy): "0" (0)); \ | ||
137 | __dummy; \ | ||
138 | }) | ||
139 | |||
143 | #define write_cr4(x) \ | 140 | #define write_cr4(x) \ |
144 | __asm__ __volatile__("movl %0,%%cr4": :"r" (x)); | 141 | __asm__ __volatile__("movl %0,%%cr4": :"r" (x)); |
145 | #define stts() write_cr0(8 | read_cr0()) | 142 | #define stts() write_cr0(8 | read_cr0()) |
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h index 0f92e78dfea..fe38b9a9623 100644 --- a/include/asm-i386/unistd.h +++ b/include/asm-i386/unistd.h | |||
@@ -256,7 +256,7 @@ | |||
256 | #define __NR_io_submit 248 | 256 | #define __NR_io_submit 248 |
257 | #define __NR_io_cancel 249 | 257 | #define __NR_io_cancel 249 |
258 | #define __NR_fadvise64 250 | 258 | #define __NR_fadvise64 250 |
259 | #define __NR_set_zone_reclaim 251 | 259 | /* 251 is available for reuse (was briefly sys_set_zone_reclaim) */ |
260 | #define __NR_exit_group 252 | 260 | #define __NR_exit_group 252 |
261 | #define __NR_lookup_dcookie 253 | 261 | #define __NR_lookup_dcookie 253 |
262 | #define __NR_epoll_create 254 | 262 | #define __NR_epoll_create 254 |