aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/i386/.gitignore1
-rw-r--r--arch/x86/Kconfig.cpu (renamed from arch/i386/Kconfig.cpu)0
-rw-r--r--arch/x86/Kconfig.debug (renamed from arch/i386/Kconfig.debug)51
-rw-r--r--arch/x86/Kconfig.i386 (renamed from arch/i386/Kconfig)4
-rw-r--r--arch/x86/Kconfig.x86_64 (renamed from arch/x86_64/Kconfig)2
-rw-r--r--arch/x86/Makefile16
-rw-r--r--arch/x86/Makefile_32 (renamed from arch/i386/Makefile)7
-rw-r--r--arch/x86/Makefile_32.cpu (renamed from arch/i386/Makefile.cpu)0
-rw-r--r--arch/x86/Makefile_64 (renamed from arch/x86_64/Makefile)5
-rw-r--r--arch/x86/boot/boot.h8
-rw-r--r--arch/x86/boot/header.S62
-rw-r--r--arch/x86/boot/video-bios.c2
-rw-r--r--arch/x86/boot/video-vesa.c2
-rw-r--r--arch/x86/boot/video.c2
-rw-r--r--arch/x86/configs/i386_defconfig (renamed from arch/i386/defconfig)0
-rw-r--r--arch/x86/configs/x86_64_defconfig (renamed from arch/x86_64/defconfig)0
-rw-r--r--arch/x86_64/.gitignore1
-rw-r--r--arch/x86_64/Kconfig.debug61
18 files changed, 114 insertions, 110 deletions
diff --git a/arch/i386/.gitignore b/arch/i386/.gitignore
deleted file mode 100644
index 36ef4c374d25..000000000000
--- a/arch/i386/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
1boot
diff --git a/arch/i386/Kconfig.cpu b/arch/x86/Kconfig.cpu
index 0e2adadf5905..0e2adadf5905 100644
--- a/arch/i386/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
diff --git a/arch/i386/Kconfig.debug b/arch/x86/Kconfig.debug
index f03531eacdfb..970b2defe7df 100644
--- a/arch/i386/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
@@ -1,14 +1,14 @@
1menu "Kernel hacking" 1menu "Kernel hacking"
2 2
3config TRACE_IRQFLAGS_SUPPORT 3config TRACE_IRQFLAGS_SUPPORT
4 bool 4 def_bool y
5 default y
6 5
7source "lib/Kconfig.debug" 6source "lib/Kconfig.debug"
8 7
9config EARLY_PRINTK 8config EARLY_PRINTK
10 bool "Early printk" if EMBEDDED && DEBUG_KERNEL 9 bool "Early printk" if EMBEDDED && DEBUG_KERNEL
11 default y 10 default y
11 depends on X86_32
12 help 12 help
13 Write kernel log output directly into the VGA buffer or to a serial 13 Write kernel log output directly into the VGA buffer or to a serial
14 port. 14 port.
@@ -37,10 +37,12 @@ config DEBUG_STACK_USAGE
37 37
38comment "Page alloc debug is incompatible with Software Suspend on i386" 38comment "Page alloc debug is incompatible with Software Suspend on i386"
39 depends on DEBUG_KERNEL && HIBERNATION 39 depends on DEBUG_KERNEL && HIBERNATION
40 depends on X86_32
40 41
41config DEBUG_PAGEALLOC 42config DEBUG_PAGEALLOC
42 bool "Debug page memory allocations" 43 bool "Debug page memory allocations"
43 depends on DEBUG_KERNEL && !HIBERNATION && !HUGETLBFS 44 depends on DEBUG_KERNEL && !HIBERNATION && !HUGETLBFS
45 depends on X86_32
44 help 46 help
45 Unmap pages from the kernel linear mapping after free_pages(). 47 Unmap pages from the kernel linear mapping after free_pages().
46 This results in a large slowdown, but helps to find certain types 48 This results in a large slowdown, but helps to find certain types
@@ -59,6 +61,7 @@ config DEBUG_RODATA
59config 4KSTACKS 61config 4KSTACKS
60 bool "Use 4Kb for kernel stacks instead of 8Kb" 62 bool "Use 4Kb for kernel stacks instead of 8Kb"
61 depends on DEBUG_KERNEL 63 depends on DEBUG_KERNEL
64 depends on X86_32
62 help 65 help
63 If you say Y here the kernel will use a 4Kb stacksize for the 66 If you say Y here the kernel will use a 4Kb stacksize for the
64 kernel stack attached to each process/thread. This facilitates 67 kernel stack attached to each process/thread. This facilitates
@@ -67,22 +70,50 @@ config 4KSTACKS
67 will also use IRQ stacks to compensate for the reduced stackspace. 70 will also use IRQ stacks to compensate for the reduced stackspace.
68 71
69config X86_FIND_SMP_CONFIG 72config X86_FIND_SMP_CONFIG
70 bool 73 def_bool y
71 depends on X86_LOCAL_APIC || X86_VOYAGER 74 depends on X86_LOCAL_APIC || X86_VOYAGER
72 default y 75 depends on X86_32
73 76
74config X86_MPPARSE 77config X86_MPPARSE
75 bool 78 def_bool y
76 depends on X86_LOCAL_APIC && !X86_VISWS 79 depends on X86_LOCAL_APIC && !X86_VISWS
77 default y 80 depends on X86_32
78 81
79config DOUBLEFAULT 82config DOUBLEFAULT
80 default y 83 default y
81 bool "Enable doublefault exception handler" if EMBEDDED 84 bool "Enable doublefault exception handler" if EMBEDDED
85 depends on X86_32
86 help
87 This option allows trapping of rare doublefault exceptions that
88 would otherwise cause a system to silently reboot. Disabling this
89 option saves about 4k and might cause you much additional grey
90 hair.
91
92config IOMMU_DEBUG
93 bool "Enable IOMMU debugging"
94 depends on IOMMU && DEBUG_KERNEL
95 depends on X86_64
82 help 96 help
83 This option allows trapping of rare doublefault exceptions that 97 Force the IOMMU to on even when you have less than 4GB of
84 would otherwise cause a system to silently reboot. Disabling this 98 memory and add debugging code. On overflow always panic. And
85 option saves about 4k and might cause you much additional grey 99 allow to enable IOMMU leak tracing. Can be disabled at boot
86 hair. 100 time with iommu=noforce. This will also enable scatter gather
101 list merging. Currently not recommended for production
102 code. When you use it make sure you have a big enough
103 IOMMU/AGP aperture. Most of the options enabled by this can
104 be set more finegrained using the iommu= command line
105 options. See Documentation/x86_64/boot-options.txt for more
106 details.
107
108config IOMMU_LEAK
109 bool "IOMMU leak tracing"
110 depends on DEBUG_KERNEL
111 depends on IOMMU_DEBUG
112 help
113 Add a simple leak tracer to the IOMMU code. This is useful when you
114 are debugging a buggy device driver that leaks IOMMU mappings.
115
116#config X86_REMOTE_DEBUG
117# bool "kgdb debugging stub"
87 118
88endmenu 119endmenu
diff --git a/arch/i386/Kconfig b/arch/x86/Kconfig.i386
index b4437ce0f973..7331efe891a7 100644
--- a/arch/i386/Kconfig
+++ b/arch/x86/Kconfig.i386
@@ -287,7 +287,7 @@ config ES7000_CLUSTERED_APIC
287 default y 287 default y
288 depends on SMP && X86_ES7000 && MPENTIUMIII 288 depends on SMP && X86_ES7000 && MPENTIUMIII
289 289
290source "arch/i386/Kconfig.cpu" 290source "arch/x86/Kconfig.cpu"
291 291
292config HPET_TIMER 292config HPET_TIMER
293 bool "HPET Timer Support" 293 bool "HPET Timer Support"
@@ -1272,7 +1272,7 @@ source "fs/Kconfig"
1272 1272
1273source "kernel/Kconfig.instrumentation" 1273source "kernel/Kconfig.instrumentation"
1274 1274
1275source "arch/i386/Kconfig.debug" 1275source "arch/x86/Kconfig.debug"
1276 1276
1277source "security/Kconfig" 1277source "security/Kconfig"
1278 1278
diff --git a/arch/x86_64/Kconfig b/arch/x86/Kconfig.x86_64
index 308970aa5382..e2542e5b536c 100644
--- a/arch/x86_64/Kconfig
+++ b/arch/x86/Kconfig.x86_64
@@ -835,7 +835,7 @@ source fs/Kconfig
835 835
836source "kernel/Kconfig.instrumentation" 836source "kernel/Kconfig.instrumentation"
837 837
838source "arch/x86_64/Kconfig.debug" 838source "arch/x86/Kconfig.debug"
839 839
840source "security/Kconfig" 840source "security/Kconfig"
841 841
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
new file mode 100644
index 000000000000..309597386a77
--- /dev/null
+++ b/arch/x86/Makefile
@@ -0,0 +1,16 @@
1# Unified Makefile for i386 and x86_64
2
3# select defconfig based on actual architecture
4KBUILD_DEFCONFIG := $(ARCH)_defconfig
5
6# # No need to remake these files
7$(srctree)/arch/x86/Makefile%: ;
8
9ifeq ($(ARCH),i386)
10 include $(srctree)/arch/x86/Makefile_32
11else
12 include $(srctree)/arch/x86/Makefile_64
13endif
14
15
16
diff --git a/arch/i386/Makefile b/arch/x86/Makefile_32
index f5b9a37def8b..346ac0766875 100644
--- a/arch/i386/Makefile
+++ b/arch/x86/Makefile_32
@@ -1,5 +1,5 @@
1# 1#
2# i386/Makefile 2# i386 Makefile
3# 3#
4# This file is included by the global makefile so that you can add your own 4# This file is included by the global makefile so that you can add your own
5# architecture-specific flags and dependencies. Remember to do have actions 5# architecture-specific flags and dependencies. Remember to do have actions
@@ -17,9 +17,6 @@
17# 20050320 Kianusch Sayah Karadji <kianusch@sk-tech.net> 17# 20050320 Kianusch Sayah Karadji <kianusch@sk-tech.net>
18# Added support for GEODE CPU 18# Added support for GEODE CPU
19 19
20# Fill in SRCARCH
21SRCARCH := x86
22
23# BITS is used as extension for files which are available in a 32 bit 20# BITS is used as extension for files which are available in a 32 bit
24# and a 64 bit version to simplify shared Makefiles. 21# and a 64 bit version to simplify shared Makefiles.
25# e.g.: obj-y += foo_$(BITS).o 22# e.g.: obj-y += foo_$(BITS).o
@@ -46,7 +43,7 @@ KBUILD_CFLAGS += -pipe -msoft-float -mregparm=3 -freg-struct-return
46KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2) 43KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2)
47 44
48# CPU-specific tuning. Anything which can be shared with UML should go here. 45# CPU-specific tuning. Anything which can be shared with UML should go here.
49include $(srctree)/arch/i386/Makefile.cpu 46include $(srctree)/arch/x86/Makefile_32.cpu
50 47
51# temporary until string.h is fixed 48# temporary until string.h is fixed
52cflags-y += -ffreestanding 49cflags-y += -ffreestanding
diff --git a/arch/i386/Makefile.cpu b/arch/x86/Makefile_32.cpu
index e372b584e919..e372b584e919 100644
--- a/arch/i386/Makefile.cpu
+++ b/arch/x86/Makefile_32.cpu
diff --git a/arch/x86_64/Makefile b/arch/x86/Makefile_64
index 20eb69bd5a6d..57e714a47af7 100644
--- a/arch/x86_64/Makefile
+++ b/arch/x86/Makefile_64
@@ -1,5 +1,5 @@
1# 1#
2# x86_64/Makefile 2# x86_64 Makefile
3# 3#
4# This file is included by the global makefile so that you can add your own 4# This file is included by the global makefile so that you can add your own
5# architecture-specific flags and dependencies. Remember to do have actions 5# architecture-specific flags and dependencies. Remember to do have actions
@@ -21,9 +21,6 @@
21# 21#
22# $Id: Makefile,v 1.31 2002/03/22 15:56:07 ak Exp $ 22# $Id: Makefile,v 1.31 2002/03/22 15:56:07 ak Exp $
23 23
24# Fill in SRCARCH
25SRCARCH := x86
26
27# BITS is used as extension for files which are available in a 32 bit 24# BITS is used as extension for files which are available in a 32 bit
28# and a 64 bit version to simplify shared Makefiles. 25# and a 64 bit version to simplify shared Makefiles.
29# e.g.: obj-y += foo_$(BITS).o 26# e.g.: obj-y += foo_$(BITS).o
diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h
index 5f9a2e72a731..d2b5adf46512 100644
--- a/arch/x86/boot/boot.h
+++ b/arch/x86/boot/boot.h
@@ -17,6 +17,8 @@
17#ifndef BOOT_BOOT_H 17#ifndef BOOT_BOOT_H
18#define BOOT_BOOT_H 18#define BOOT_BOOT_H
19 19
20#define STACK_SIZE 512 /* Minimum number of bytes for stack */
21
20#ifndef __ASSEMBLY__ 22#ifndef __ASSEMBLY__
21 23
22#include <stdarg.h> 24#include <stdarg.h>
@@ -198,8 +200,6 @@ static inline int isdigit(int ch)
198} 200}
199 201
200/* Heap -- available for dynamic lists. */ 202/* Heap -- available for dynamic lists. */
201#define STACK_SIZE 512 /* Minimum number of bytes for stack */
202
203extern char _end[]; 203extern char _end[];
204extern char *HEAP; 204extern char *HEAP;
205extern char *heap_end; 205extern char *heap_end;
@@ -216,9 +216,9 @@ static inline char *__get_heap(size_t s, size_t a, size_t n)
216#define GET_HEAP(type, n) \ 216#define GET_HEAP(type, n) \
217 ((type *)__get_heap(sizeof(type),__alignof__(type),(n))) 217 ((type *)__get_heap(sizeof(type),__alignof__(type),(n)))
218 218
219static inline int heap_free(void) 219static inline bool heap_free(size_t n)
220{ 220{
221 return heap_end-HEAP; 221 return (int)(heap_end-HEAP) >= (int)n;
222} 222}
223 223
224/* copy.S */ 224/* copy.S */
diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S
index 8353c81c41c0..6ef5a060fa11 100644
--- a/arch/x86/boot/header.S
+++ b/arch/x86/boot/header.S
@@ -173,7 +173,8 @@ ramdisk_size: .long 0 # its size in bytes
173bootsect_kludge: 173bootsect_kludge:
174 .long 0 # obsolete 174 .long 0 # obsolete
175 175
176heap_end_ptr: .word _end+1024 # (Header version 0x0201 or later) 176heap_end_ptr: .word _end+STACK_SIZE-512
177 # (Header version 0x0201 or later)
177 # space from here (exclusive) down to 178 # space from here (exclusive) down to
178 # end of setup code can be used by setup 179 # end of setup code can be used by setup
179 # for local heap purposes. 180 # for local heap purposes.
@@ -230,28 +231,53 @@ start_of_setup:
230 int $0x13 231 int $0x13
231#endif 232#endif
232 233
233# We will have entered with %cs = %ds+0x20, normalize %cs so
234# it is on par with the other segments.
235 pushw %ds
236 pushw $setup2
237 lretw
238
239setup2:
240# Force %es = %ds 234# Force %es = %ds
241 movw %ds, %ax 235 movw %ds, %ax
242 movw %ax, %es 236 movw %ax, %es
243 cld 237 cld
244 238
245# Stack paranoia: align the stack and make sure it is good 239# Apparently some ancient versions of LILO invoked the kernel
246# for both 16- and 32-bit references. In particular, if we 240# with %ss != %ds, which happened to work by accident for the
247# were meant to have been using the full 16-bit segment, the 241# old code. If the CAN_USE_HEAP flag is set in loadflags, or
248# caller might have set %sp to zero, which breaks %esp-based 242# %ss != %ds, then adjust the stack pointer.
249# references. 243
250 andw $~3, %sp # dword align (might as well...) 244 # Smallest possible stack we can tolerate
251 jnz 1f 245 movw $(_end+STACK_SIZE), %cx
252 movw $0xfffc, %sp # Make sure we're not zero 246
2531: movzwl %sp, %esp # Clear upper half of %esp 247 movw heap_end_ptr, %dx
254 sti 248 addw $512, %dx
249 jnc 1f
250 xorw %dx, %dx # Wraparound - whole segment available
2511: testb $CAN_USE_HEAP, loadflags
252 jnz 2f
253
254 # No CAN_USE_HEAP
255 movw %ss, %dx
256 cmpw %ax, %dx # %ds == %ss?
257 movw %sp, %dx
258 # If so, assume %sp is reasonably set, otherwise use
259 # the smallest possible stack.
260 jne 4f # -> Smallest possible stack...
261
262 # Make sure the stack is at least minimum size. Take a value
263 # of zero to mean "full segment."
2642:
265 andw $~3, %dx # dword align (might as well...)
266 jnz 3f
267 movw $0xfffc, %dx # Make sure we're not zero
2683: cmpw %cx, %dx
269 jnb 5f
2704: movw %cx, %dx # Minimum value we can possibly use
2715: movw %ax, %ss
272 movzwl %dx, %esp # Clear upper half of %esp
273 sti # Now we should have a working stack
274
275# We will have entered with %cs = %ds+0x20, normalize %cs so
276# it is on par with the other segments.
277 pushw %ds
278 pushw $6f
279 lretw
2806:
255 281
256# Check signature at end of setup 282# Check signature at end of setup
257 cmpl $0x5a5aaa55, setup_sig 283 cmpl $0x5a5aaa55, setup_sig
diff --git a/arch/x86/boot/video-bios.c b/arch/x86/boot/video-bios.c
index 68e65d95cdfd..ed0672a81870 100644
--- a/arch/x86/boot/video-bios.c
+++ b/arch/x86/boot/video-bios.c
@@ -79,7 +79,7 @@ static int bios_probe(void)
79 video_bios.modes = GET_HEAP(struct mode_info, 0); 79 video_bios.modes = GET_HEAP(struct mode_info, 0);
80 80
81 for (mode = 0x14; mode <= 0x7f; mode++) { 81 for (mode = 0x14; mode <= 0x7f; mode++) {
82 if (heap_free() < sizeof(struct mode_info)) 82 if (!heap_free(sizeof(struct mode_info)))
83 break; 83 break;
84 84
85 if (mode_defined(VIDEO_FIRST_BIOS+mode)) 85 if (mode_defined(VIDEO_FIRST_BIOS+mode))
diff --git a/arch/x86/boot/video-vesa.c b/arch/x86/boot/video-vesa.c
index 192190710710..4716b9a96357 100644
--- a/arch/x86/boot/video-vesa.c
+++ b/arch/x86/boot/video-vesa.c
@@ -57,7 +57,7 @@ static int vesa_probe(void)
57 while ((mode = rdfs16(mode_ptr)) != 0xffff) { 57 while ((mode = rdfs16(mode_ptr)) != 0xffff) {
58 mode_ptr += 2; 58 mode_ptr += 2;
59 59
60 if (heap_free() < sizeof(struct mode_info)) 60 if (!heap_free(sizeof(struct mode_info)))
61 break; /* Heap full, can't save mode info */ 61 break; /* Heap full, can't save mode info */
62 62
63 if (mode & ~0x1ff) 63 if (mode & ~0x1ff)
diff --git a/arch/x86/boot/video.c b/arch/x86/boot/video.c
index e4ba897bf9a3..ad9712f01739 100644
--- a/arch/x86/boot/video.c
+++ b/arch/x86/boot/video.c
@@ -371,7 +371,7 @@ static void save_screen(void)
371 saved.curx = boot_params.screen_info.orig_x; 371 saved.curx = boot_params.screen_info.orig_x;
372 saved.cury = boot_params.screen_info.orig_y; 372 saved.cury = boot_params.screen_info.orig_y;
373 373
374 if (heap_free() < saved.x*saved.y*sizeof(u16)+512) 374 if (!heap_free(saved.x*saved.y*sizeof(u16)+512))
375 return; /* Not enough heap to save the screen */ 375 return; /* Not enough heap to save the screen */
376 376
377 saved.data = GET_HEAP(u16, saved.x*saved.y); 377 saved.data = GET_HEAP(u16, saved.x*saved.y);
diff --git a/arch/i386/defconfig b/arch/x86/configs/i386_defconfig
index 54ee1764fdae..54ee1764fdae 100644
--- a/arch/i386/defconfig
+++ b/arch/x86/configs/i386_defconfig
diff --git a/arch/x86_64/defconfig b/arch/x86/configs/x86_64_defconfig
index b091c5e35558..b091c5e35558 100644
--- a/arch/x86_64/defconfig
+++ b/arch/x86/configs/x86_64_defconfig
diff --git a/arch/x86_64/.gitignore b/arch/x86_64/.gitignore
deleted file mode 100644
index 36ef4c374d25..000000000000
--- a/arch/x86_64/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
1boot
diff --git a/arch/x86_64/Kconfig.debug b/arch/x86_64/Kconfig.debug
deleted file mode 100644
index 775d211a5cf9..000000000000
--- a/arch/x86_64/Kconfig.debug
+++ /dev/null
@@ -1,61 +0,0 @@
1menu "Kernel hacking"
2
3config TRACE_IRQFLAGS_SUPPORT
4 bool
5 default y
6
7source "lib/Kconfig.debug"
8
9config DEBUG_RODATA
10 bool "Write protect kernel read-only data structures"
11 depends on DEBUG_KERNEL
12 help
13 Mark the kernel read-only data as write-protected in the pagetables,
14 in order to catch accidental (and incorrect) writes to such const data.
15 This option may have a slight performance impact because a portion
16 of the kernel code won't be covered by a 2MB TLB anymore.
17 If in doubt, say "N".
18
19config IOMMU_DEBUG
20 depends on IOMMU && DEBUG_KERNEL
21 bool "Enable IOMMU debugging"
22 help
23 Force the IOMMU to on even when you have less than 4GB of
24 memory and add debugging code. On overflow always panic. And
25 allow to enable IOMMU leak tracing. Can be disabled at boot
26 time with iommu=noforce. This will also enable scatter gather
27 list merging. Currently not recommended for production
28 code. When you use it make sure you have a big enough
29 IOMMU/AGP aperture. Most of the options enabled by this can
30 be set more finegrained using the iommu= command line
31 options. See Documentation/x86_64/boot-options.txt for more
32 details.
33
34config IOMMU_LEAK
35 bool "IOMMU leak tracing"
36 depends on DEBUG_KERNEL
37 depends on IOMMU_DEBUG
38 help
39 Add a simple leak tracer to the IOMMU code. This is useful when you
40 are debugging a buggy device driver that leaks IOMMU mappings.
41
42config DEBUG_STACKOVERFLOW
43 bool "Check for stack overflows"
44 depends on DEBUG_KERNEL
45 help
46 This option will cause messages to be printed if free stack space
47 drops below a certain limit.
48
49config DEBUG_STACK_USAGE
50 bool "Stack utilization instrumentation"
51 depends on DEBUG_KERNEL
52 help
53 Enables the display of the minimum amount of free stack which each
54 task has ever had available in the sysrq-T and sysrq-P debug output.
55
56 This option will slow down process creation somewhat.
57
58#config X86_REMOTE_DEBUG
59# bool "kgdb debugging stub"
60
61endmenu