You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'x86-stage-3-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-stage-3-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (190 commits) Revert "cpuacct: reduce one NULL check in fast-path" Revert "x86: don't compile vsmp_64 for 32bit" x86: Correct behaviour of irq affinity x86: early_ioremap_init(), use __fix_to_virt(), because we are sure it's safe x86: use default_cpu_mask_to_apicid for 64bit x86: fix set_extra_move_desc calling x86, PAT, PCI: Change vma prot in pci_mmap to reflect inherited prot x86/dmi: fix dmi_alloc() section mismatches x86: e820 fix various signedness issues in setup.c and e820.c x86: apic/io_apic.c define msi_ir_chip and ir_ioapic_chip all the time x86: irq.c keep CONFIG_X86_LOCAL_APIC interrupts together x86: irq.c use same path for show_interrupts x86: cpu/cpu.h cleanup x86: Fix a couple of sparse warnings in arch/x86/kernel/apic/io_apic.c Revert "x86: create a non-zero sized bm_pte only when needed" x86: pci-nommu.c cleanup x86: io_delay.c cleanup x86: rtc.c cleanup x86: i8253 cleanup x86: kdebugfs.c cleanup ...
This commit is contained in:
@@ -0,0 +1,101 @@
|
|||||||
|
|
||||||
|
Mini-HOWTO for using the earlyprintk=dbgp boot option with a
|
||||||
|
USB2 Debug port key and a debug cable, on x86 systems.
|
||||||
|
|
||||||
|
You need two computers, the 'USB debug key' special gadget and
|
||||||
|
and two USB cables, connected like this:
|
||||||
|
|
||||||
|
[host/target] <-------> [USB debug key] <-------> [client/console]
|
||||||
|
|
||||||
|
1. There are three specific hardware requirements:
|
||||||
|
|
||||||
|
a.) Host/target system needs to have USB debug port capability.
|
||||||
|
|
||||||
|
You can check this capability by looking at a 'Debug port' bit in
|
||||||
|
the lspci -vvv output:
|
||||||
|
|
||||||
|
# lspci -vvv
|
||||||
|
...
|
||||||
|
00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 03) (prog-if 20 [EHCI])
|
||||||
|
Subsystem: Lenovo ThinkPad T61
|
||||||
|
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
|
||||||
|
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
|
||||||
|
Latency: 0
|
||||||
|
Interrupt: pin D routed to IRQ 19
|
||||||
|
Region 0: Memory at fe227000 (32-bit, non-prefetchable) [size=1K]
|
||||||
|
Capabilities: [50] Power Management version 2
|
||||||
|
Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
|
||||||
|
Status: D0 PME-Enable- DSel=0 DScale=0 PME+
|
||||||
|
Capabilities: [58] Debug port: BAR=1 offset=00a0
|
||||||
|
^^^^^^^^^^^ <==================== [ HERE ]
|
||||||
|
Kernel driver in use: ehci_hcd
|
||||||
|
Kernel modules: ehci-hcd
|
||||||
|
...
|
||||||
|
|
||||||
|
( If your system does not list a debug port capability then you probably
|
||||||
|
wont be able to use the USB debug key. )
|
||||||
|
|
||||||
|
b.) You also need a Netchip USB debug cable/key:
|
||||||
|
|
||||||
|
http://www.plxtech.com/products/NET2000/NET20DC/default.asp
|
||||||
|
|
||||||
|
This is a small blue plastic connector with two USB connections,
|
||||||
|
it draws power from its USB connections.
|
||||||
|
|
||||||
|
c.) Thirdly, you need a second client/console system with a regular USB port.
|
||||||
|
|
||||||
|
2. Software requirements:
|
||||||
|
|
||||||
|
a.) On the host/target system:
|
||||||
|
|
||||||
|
You need to enable the following kernel config option:
|
||||||
|
|
||||||
|
CONFIG_EARLY_PRINTK_DBGP=y
|
||||||
|
|
||||||
|
And you need to add the boot command line: "earlyprintk=dbgp".
|
||||||
|
(If you are using Grub, append it to the 'kernel' line in
|
||||||
|
/etc/grub.conf)
|
||||||
|
|
||||||
|
NOTE: normally earlyprintk console gets turned off once the
|
||||||
|
regular console is alive - use "earlyprintk=dbgp,keep" to keep
|
||||||
|
this channel open beyond early bootup. This can be useful for
|
||||||
|
debugging crashes under Xorg, etc.
|
||||||
|
|
||||||
|
b.) On the client/console system:
|
||||||
|
|
||||||
|
You should enable the following kernel config option:
|
||||||
|
|
||||||
|
CONFIG_USB_SERIAL_DEBUG=y
|
||||||
|
|
||||||
|
On the next bootup with the modified kernel you should
|
||||||
|
get a /dev/ttyUSBx device(s).
|
||||||
|
|
||||||
|
Now this channel of kernel messages is ready to be used: start
|
||||||
|
your favorite terminal emulator (minicom, etc.) and set
|
||||||
|
it up to use /dev/ttyUSB0 - or use a raw 'cat /dev/ttyUSBx' to
|
||||||
|
see the raw output.
|
||||||
|
|
||||||
|
c.) On Nvidia Southbridge based systems: the kernel will try to probe
|
||||||
|
and find out which port has debug device connected.
|
||||||
|
|
||||||
|
3. Testing that it works fine:
|
||||||
|
|
||||||
|
You can test the output by using earlyprintk=dbgp,keep and provoking
|
||||||
|
kernel messages on the host/target system. You can provoke a harmless
|
||||||
|
kernel message by for example doing:
|
||||||
|
|
||||||
|
echo h > /proc/sysrq-trigger
|
||||||
|
|
||||||
|
On the host/target system you should see this help line in "dmesg" output:
|
||||||
|
|
||||||
|
SysRq : HELP : loglevel(0-9) reBoot Crashdump terminate-all-tasks(E) memory-full-oom-kill(F) kill-all-tasks(I) saK show-backtrace-all-active-cpus(L) show-memory-usage(M) nice-all-RT-tasks(N) powerOff show-registers(P) show-all-timers(Q) unRaw Sync show-task-states(T) Unmount show-blocked-tasks(W) dump-ftrace-buffer(Z)
|
||||||
|
|
||||||
|
On the client/console system do:
|
||||||
|
|
||||||
|
cat /dev/ttyUSB0
|
||||||
|
|
||||||
|
And you should see the help line above displayed shortly after you've
|
||||||
|
provoked it on the host system.
|
||||||
|
|
||||||
|
If it does not work then please ask about it on the linux-kernel@vger.kernel.org
|
||||||
|
mailing list or contact the x86 maintainers.
|
||||||
+13
-2
@@ -786,6 +786,11 @@ config X86_MCE_AMD
|
|||||||
Additional support for AMD specific MCE features such as
|
Additional support for AMD specific MCE features such as
|
||||||
the DRAM Error Threshold.
|
the DRAM Error Threshold.
|
||||||
|
|
||||||
|
config X86_MCE_THRESHOLD
|
||||||
|
depends on X86_MCE_AMD || X86_MCE_INTEL
|
||||||
|
bool
|
||||||
|
default y
|
||||||
|
|
||||||
config X86_MCE_NONFATAL
|
config X86_MCE_NONFATAL
|
||||||
tristate "Check for non-fatal errors on AMD Athlon/Duron / Intel Pentium 4"
|
tristate "Check for non-fatal errors on AMD Athlon/Duron / Intel Pentium 4"
|
||||||
depends on X86_32 && X86_MCE
|
depends on X86_32 && X86_MCE
|
||||||
@@ -929,6 +934,12 @@ config X86_CPUID
|
|||||||
with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to
|
with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to
|
||||||
/dev/cpu/31/cpuid.
|
/dev/cpu/31/cpuid.
|
||||||
|
|
||||||
|
config X86_CPU_DEBUG
|
||||||
|
tristate "/sys/kernel/debug/x86/cpu/* - CPU Debug support"
|
||||||
|
---help---
|
||||||
|
If you select this option, this will provide various x86 CPUs
|
||||||
|
information through debugfs.
|
||||||
|
|
||||||
choice
|
choice
|
||||||
prompt "High Memory Support"
|
prompt "High Memory Support"
|
||||||
default HIGHMEM4G if !X86_NUMAQ
|
default HIGHMEM4G if !X86_NUMAQ
|
||||||
@@ -1121,7 +1132,7 @@ config NUMA_EMU
|
|||||||
|
|
||||||
config NODES_SHIFT
|
config NODES_SHIFT
|
||||||
int "Maximum NUMA Nodes (as a power of 2)" if !MAXSMP
|
int "Maximum NUMA Nodes (as a power of 2)" if !MAXSMP
|
||||||
range 1 9 if X86_64
|
range 1 9
|
||||||
default "9" if MAXSMP
|
default "9" if MAXSMP
|
||||||
default "6" if X86_64
|
default "6" if X86_64
|
||||||
default "4" if X86_NUMAQ
|
default "4" if X86_NUMAQ
|
||||||
@@ -1429,7 +1440,7 @@ config CRASH_DUMP
|
|||||||
config KEXEC_JUMP
|
config KEXEC_JUMP
|
||||||
bool "kexec jump (EXPERIMENTAL)"
|
bool "kexec jump (EXPERIMENTAL)"
|
||||||
depends on EXPERIMENTAL
|
depends on EXPERIMENTAL
|
||||||
depends on KEXEC && HIBERNATION && X86_32
|
depends on KEXEC && HIBERNATION
|
||||||
---help---
|
---help---
|
||||||
Jump between original kernel and kexeced kernel and invoke
|
Jump between original kernel and kexeced kernel and invoke
|
||||||
code in physical address mode via KEXEC
|
code in physical address mode via KEXEC
|
||||||
|
|||||||
+1
-16
@@ -456,24 +456,9 @@ config CPU_SUP_AMD
|
|||||||
|
|
||||||
If unsure, say N.
|
If unsure, say N.
|
||||||
|
|
||||||
config CPU_SUP_CENTAUR_32
|
config CPU_SUP_CENTAUR
|
||||||
default y
|
default y
|
||||||
bool "Support Centaur processors" if PROCESSOR_SELECT
|
bool "Support Centaur processors" if PROCESSOR_SELECT
|
||||||
depends on !64BIT
|
|
||||||
---help---
|
|
||||||
This enables detection, tunings and quirks for Centaur processors
|
|
||||||
|
|
||||||
You need this enabled if you want your kernel to run on a
|
|
||||||
Centaur CPU. Disabling this option on other types of CPUs
|
|
||||||
makes the kernel a tiny bit smaller. Disabling it on a Centaur
|
|
||||||
CPU might render the kernel unbootable.
|
|
||||||
|
|
||||||
If unsure, say N.
|
|
||||||
|
|
||||||
config CPU_SUP_CENTAUR_64
|
|
||||||
default y
|
|
||||||
bool "Support Centaur processors" if PROCESSOR_SELECT
|
|
||||||
depends on 64BIT
|
|
||||||
---help---
|
---help---
|
||||||
This enables detection, tunings and quirks for Centaur processors
|
This enables detection, tunings and quirks for Centaur processors
|
||||||
|
|
||||||
|
|||||||
+7
-22
@@ -153,34 +153,23 @@ endif
|
|||||||
|
|
||||||
boot := arch/x86/boot
|
boot := arch/x86/boot
|
||||||
|
|
||||||
PHONY += zImage bzImage compressed zlilo bzlilo \
|
BOOT_TARGETS = bzlilo bzdisk fdimage fdimage144 fdimage288 isoimage install
|
||||||
zdisk bzdisk fdimage fdimage144 fdimage288 isoimage install
|
|
||||||
|
PHONY += bzImage $(BOOT_TARGETS)
|
||||||
|
|
||||||
# Default kernel to build
|
# Default kernel to build
|
||||||
all: bzImage
|
all: bzImage
|
||||||
|
|
||||||
# KBUILD_IMAGE specify target image being built
|
# KBUILD_IMAGE specify target image being built
|
||||||
KBUILD_IMAGE := $(boot)/bzImage
|
KBUILD_IMAGE := $(boot)/bzImage
|
||||||
zImage zlilo zdisk: KBUILD_IMAGE := $(boot)/zImage
|
|
||||||
|
|
||||||
zImage bzImage: vmlinux
|
bzImage: vmlinux
|
||||||
$(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE)
|
$(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE)
|
||||||
$(Q)mkdir -p $(objtree)/arch/$(UTS_MACHINE)/boot
|
$(Q)mkdir -p $(objtree)/arch/$(UTS_MACHINE)/boot
|
||||||
$(Q)ln -fsn ../../x86/boot/bzImage $(objtree)/arch/$(UTS_MACHINE)/boot/$@
|
$(Q)ln -fsn ../../x86/boot/bzImage $(objtree)/arch/$(UTS_MACHINE)/boot/$@
|
||||||
|
|
||||||
compressed: zImage
|
$(BOOT_TARGETS): vmlinux
|
||||||
|
$(Q)$(MAKE) $(build)=$(boot) $@
|
||||||
zlilo bzlilo: vmlinux
|
|
||||||
$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) zlilo
|
|
||||||
|
|
||||||
zdisk bzdisk: vmlinux
|
|
||||||
$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) zdisk
|
|
||||||
|
|
||||||
fdimage fdimage144 fdimage288 isoimage: vmlinux
|
|
||||||
$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@
|
|
||||||
|
|
||||||
install:
|
|
||||||
$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install
|
|
||||||
|
|
||||||
PHONY += vdso_install
|
PHONY += vdso_install
|
||||||
vdso_install:
|
vdso_install:
|
||||||
@@ -205,7 +194,3 @@ define archhelp
|
|||||||
echo ' FDARGS="..." arguments for the booted kernel'
|
echo ' FDARGS="..." arguments for the booted kernel'
|
||||||
echo ' FDINITRD=file initrd for the booted kernel'
|
echo ' FDINITRD=file initrd for the booted kernel'
|
||||||
endef
|
endef
|
||||||
|
|
||||||
CLEAN_FILES += arch/x86/boot/fdimage \
|
|
||||||
arch/x86/boot/image.iso \
|
|
||||||
arch/x86/boot/mtools.conf
|
|
||||||
|
|||||||
+25
-28
@@ -6,26 +6,24 @@
|
|||||||
# for more details.
|
# for more details.
|
||||||
#
|
#
|
||||||
# Copyright (C) 1994 by Linus Torvalds
|
# Copyright (C) 1994 by Linus Torvalds
|
||||||
|
# Changed by many, many contributors over the years.
|
||||||
#
|
#
|
||||||
|
|
||||||
# ROOT_DEV specifies the default root-device when making the image.
|
# ROOT_DEV specifies the default root-device when making the image.
|
||||||
# This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
|
# This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
|
||||||
# the default of FLOPPY is used by 'build'.
|
# the default of FLOPPY is used by 'build'.
|
||||||
|
|
||||||
ROOT_DEV := CURRENT
|
ROOT_DEV := CURRENT
|
||||||
|
|
||||||
# If you want to preset the SVGA mode, uncomment the next line and
|
# If you want to preset the SVGA mode, uncomment the next line and
|
||||||
# set SVGA_MODE to whatever number you want.
|
# set SVGA_MODE to whatever number you want.
|
||||||
# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
|
# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
|
||||||
# The number is the same as you would ordinarily press at bootup.
|
# The number is the same as you would ordinarily press at bootup.
|
||||||
|
|
||||||
SVGA_MODE := -DSVGA_MODE=NORMAL_VGA
|
SVGA_MODE := -DSVGA_MODE=NORMAL_VGA
|
||||||
|
|
||||||
# If you want the RAM disk device, define this to be the size in blocks.
|
targets := vmlinux.bin setup.bin setup.elf bzImage
|
||||||
|
targets += fdimage fdimage144 fdimage288 image.iso mtools.conf
|
||||||
#RAMDISK := -DRAMDISK=512
|
|
||||||
|
|
||||||
targets := vmlinux.bin setup.bin setup.elf zImage bzImage
|
|
||||||
subdir- := compressed
|
subdir- := compressed
|
||||||
|
|
||||||
setup-y += a20.o cmdline.o copy.o cpu.o cpucheck.o edd.o
|
setup-y += a20.o cmdline.o copy.o cpu.o cpucheck.o edd.o
|
||||||
@@ -71,17 +69,13 @@ KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \
|
|||||||
KBUILD_CFLAGS += $(call cc-option,-m32)
|
KBUILD_CFLAGS += $(call cc-option,-m32)
|
||||||
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
|
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
|
||||||
|
|
||||||
$(obj)/zImage: asflags-y := $(SVGA_MODE) $(RAMDISK)
|
$(obj)/bzImage: asflags-y := $(SVGA_MODE)
|
||||||
$(obj)/bzImage: ccflags-y := -D__BIG_KERNEL__
|
|
||||||
$(obj)/bzImage: asflags-y := $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__
|
|
||||||
$(obj)/bzImage: BUILDFLAGS := -b
|
|
||||||
|
|
||||||
quiet_cmd_image = BUILD $@
|
quiet_cmd_image = BUILD $@
|
||||||
cmd_image = $(obj)/tools/build $(BUILDFLAGS) $(obj)/setup.bin \
|
cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \
|
||||||
$(obj)/vmlinux.bin $(ROOT_DEV) > $@
|
$(ROOT_DEV) > $@
|
||||||
|
|
||||||
$(obj)/zImage $(obj)/bzImage: $(obj)/setup.bin \
|
$(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE
|
||||||
$(obj)/vmlinux.bin $(obj)/tools/build FORCE
|
|
||||||
$(call if_changed,image)
|
$(call if_changed,image)
|
||||||
@echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
|
@echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
|
||||||
|
|
||||||
@@ -116,9 +110,11 @@ $(obj)/setup.bin: $(obj)/setup.elf FORCE
|
|||||||
$(obj)/compressed/vmlinux: FORCE
|
$(obj)/compressed/vmlinux: FORCE
|
||||||
$(Q)$(MAKE) $(build)=$(obj)/compressed $@
|
$(Q)$(MAKE) $(build)=$(obj)/compressed $@
|
||||||
|
|
||||||
# Set this if you want to pass append arguments to the zdisk/fdimage/isoimage kernel
|
# Set this if you want to pass append arguments to the
|
||||||
|
# bzdisk/fdimage/isoimage kernel
|
||||||
FDARGS =
|
FDARGS =
|
||||||
# Set this if you want an initrd included with the zdisk/fdimage/isoimage kernel
|
# Set this if you want an initrd included with the
|
||||||
|
# bzdisk/fdimage/isoimage kernel
|
||||||
FDINITRD =
|
FDINITRD =
|
||||||
|
|
||||||
image_cmdline = default linux $(FDARGS) $(if $(FDINITRD),initrd=initrd.img,)
|
image_cmdline = default linux $(FDARGS) $(if $(FDINITRD),initrd=initrd.img,)
|
||||||
@@ -127,7 +123,7 @@ $(obj)/mtools.conf: $(src)/mtools.conf.in
|
|||||||
sed -e 's|@OBJ@|$(obj)|g' < $< > $@
|
sed -e 's|@OBJ@|$(obj)|g' < $< > $@
|
||||||
|
|
||||||
# This requires write access to /dev/fd0
|
# This requires write access to /dev/fd0
|
||||||
zdisk: $(BOOTIMAGE) $(obj)/mtools.conf
|
bzdisk: $(obj)/bzImage $(obj)/mtools.conf
|
||||||
MTOOLSRC=$(obj)/mtools.conf mformat a: ; sync
|
MTOOLSRC=$(obj)/mtools.conf mformat a: ; sync
|
||||||
syslinux /dev/fd0 ; sync
|
syslinux /dev/fd0 ; sync
|
||||||
echo '$(image_cmdline)' | \
|
echo '$(image_cmdline)' | \
|
||||||
@@ -135,10 +131,10 @@ zdisk: $(BOOTIMAGE) $(obj)/mtools.conf
|
|||||||
if [ -f '$(FDINITRD)' ] ; then \
|
if [ -f '$(FDINITRD)' ] ; then \
|
||||||
MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' a:initrd.img ; \
|
MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' a:initrd.img ; \
|
||||||
fi
|
fi
|
||||||
MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) a:linux ; sync
|
MTOOLSRC=$(obj)/mtools.conf mcopy $(obj)/bzImage a:linux ; sync
|
||||||
|
|
||||||
# These require being root or having syslinux 2.02 or higher installed
|
# These require being root or having syslinux 2.02 or higher installed
|
||||||
fdimage fdimage144: $(BOOTIMAGE) $(obj)/mtools.conf
|
fdimage fdimage144: $(obj)/bzImage $(obj)/mtools.conf
|
||||||
dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440
|
dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440
|
||||||
MTOOLSRC=$(obj)/mtools.conf mformat v: ; sync
|
MTOOLSRC=$(obj)/mtools.conf mformat v: ; sync
|
||||||
syslinux $(obj)/fdimage ; sync
|
syslinux $(obj)/fdimage ; sync
|
||||||
@@ -147,9 +143,9 @@ fdimage fdimage144: $(BOOTIMAGE) $(obj)/mtools.conf
|
|||||||
if [ -f '$(FDINITRD)' ] ; then \
|
if [ -f '$(FDINITRD)' ] ; then \
|
||||||
MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' v:initrd.img ; \
|
MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' v:initrd.img ; \
|
||||||
fi
|
fi
|
||||||
MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) v:linux ; sync
|
MTOOLSRC=$(obj)/mtools.conf mcopy $(obj)/bzImage v:linux ; sync
|
||||||
|
|
||||||
fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf
|
fdimage288: $(obj)/bzImage $(obj)/mtools.conf
|
||||||
dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880
|
dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880
|
||||||
MTOOLSRC=$(obj)/mtools.conf mformat w: ; sync
|
MTOOLSRC=$(obj)/mtools.conf mformat w: ; sync
|
||||||
syslinux $(obj)/fdimage ; sync
|
syslinux $(obj)/fdimage ; sync
|
||||||
@@ -158,9 +154,9 @@ fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf
|
|||||||
if [ -f '$(FDINITRD)' ] ; then \
|
if [ -f '$(FDINITRD)' ] ; then \
|
||||||
MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' w:initrd.img ; \
|
MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' w:initrd.img ; \
|
||||||
fi
|
fi
|
||||||
MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) w:linux ; sync
|
MTOOLSRC=$(obj)/mtools.conf mcopy $(obj)/bzImage w:linux ; sync
|
||||||
|
|
||||||
isoimage: $(BOOTIMAGE)
|
isoimage: $(obj)/bzImage
|
||||||
-rm -rf $(obj)/isoimage
|
-rm -rf $(obj)/isoimage
|
||||||
mkdir $(obj)/isoimage
|
mkdir $(obj)/isoimage
|
||||||
for i in lib lib64 share end ; do \
|
for i in lib lib64 share end ; do \
|
||||||
@@ -170,7 +166,7 @@ isoimage: $(BOOTIMAGE)
|
|||||||
fi ; \
|
fi ; \
|
||||||
if [ $$i = end ] ; then exit 1 ; fi ; \
|
if [ $$i = end ] ; then exit 1 ; fi ; \
|
||||||
done
|
done
|
||||||
cp $(BOOTIMAGE) $(obj)/isoimage/linux
|
cp $(obj)/bzImage $(obj)/isoimage/linux
|
||||||
echo '$(image_cmdline)' > $(obj)/isoimage/isolinux.cfg
|
echo '$(image_cmdline)' > $(obj)/isoimage/isolinux.cfg
|
||||||
if [ -f '$(FDINITRD)' ] ; then \
|
if [ -f '$(FDINITRD)' ] ; then \
|
||||||
cp '$(FDINITRD)' $(obj)/isoimage/initrd.img ; \
|
cp '$(FDINITRD)' $(obj)/isoimage/initrd.img ; \
|
||||||
@@ -181,12 +177,13 @@ isoimage: $(BOOTIMAGE)
|
|||||||
isohybrid $(obj)/image.iso 2>/dev/null || true
|
isohybrid $(obj)/image.iso 2>/dev/null || true
|
||||||
rm -rf $(obj)/isoimage
|
rm -rf $(obj)/isoimage
|
||||||
|
|
||||||
zlilo: $(BOOTIMAGE)
|
bzlilo: $(obj)/bzImage
|
||||||
if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi
|
if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi
|
||||||
if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
|
if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
|
||||||
cat $(BOOTIMAGE) > $(INSTALL_PATH)/vmlinuz
|
cat $(obj)/bzImage > $(INSTALL_PATH)/vmlinuz
|
||||||
cp System.map $(INSTALL_PATH)/
|
cp System.map $(INSTALL_PATH)/
|
||||||
if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
|
if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
|
||||||
|
|
||||||
install:
|
install:
|
||||||
sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"
|
sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(obj)/bzImage \
|
||||||
|
System.map "$(INSTALL_PATH)"
|
||||||
|
|||||||
+9
-20
@@ -24,12 +24,8 @@
|
|||||||
#include "boot.h"
|
#include "boot.h"
|
||||||
#include "offsets.h"
|
#include "offsets.h"
|
||||||
|
|
||||||
SETUPSECTS = 4 /* default nr of setup-sectors */
|
|
||||||
BOOTSEG = 0x07C0 /* original address of boot-sector */
|
BOOTSEG = 0x07C0 /* original address of boot-sector */
|
||||||
SYSSEG = DEF_SYSSEG /* system loaded at 0x10000 (65536) */
|
SYSSEG = 0x1000 /* historical load address >> 4 */
|
||||||
SYSSIZE = DEF_SYSSIZE /* system size: # of 16-byte clicks */
|
|
||||||
/* to be loaded */
|
|
||||||
ROOT_DEV = 0 /* ROOT_DEV is now written by "build" */
|
|
||||||
|
|
||||||
#ifndef SVGA_MODE
|
#ifndef SVGA_MODE
|
||||||
#define SVGA_MODE ASK_VGA
|
#define SVGA_MODE ASK_VGA
|
||||||
@@ -97,12 +93,12 @@ bugger_off_msg:
|
|||||||
.section ".header", "a"
|
.section ".header", "a"
|
||||||
.globl hdr
|
.globl hdr
|
||||||
hdr:
|
hdr:
|
||||||
setup_sects: .byte SETUPSECTS
|
setup_sects: .byte 0 /* Filled in by build.c */
|
||||||
root_flags: .word ROOT_RDONLY
|
root_flags: .word ROOT_RDONLY
|
||||||
syssize: .long SYSSIZE
|
syssize: .long 0 /* Filled in by build.c */
|
||||||
ram_size: .word RAMDISK
|
ram_size: .word 0 /* Obsolete */
|
||||||
vid_mode: .word SVGA_MODE
|
vid_mode: .word SVGA_MODE
|
||||||
root_dev: .word ROOT_DEV
|
root_dev: .word 0 /* Filled in by build.c */
|
||||||
boot_flag: .word 0xAA55
|
boot_flag: .word 0xAA55
|
||||||
|
|
||||||
# offset 512, entry point
|
# offset 512, entry point
|
||||||
@@ -123,14 +119,15 @@ _start:
|
|||||||
# or else old loadlin-1.5 will fail)
|
# or else old loadlin-1.5 will fail)
|
||||||
.globl realmode_swtch
|
.globl realmode_swtch
|
||||||
realmode_swtch: .word 0, 0 # default_switch, SETUPSEG
|
realmode_swtch: .word 0, 0 # default_switch, SETUPSEG
|
||||||
start_sys_seg: .word SYSSEG
|
start_sys_seg: .word SYSSEG # obsolete and meaningless, but just
|
||||||
|
# in case something decided to "use" it
|
||||||
.word kernel_version-512 # pointing to kernel version string
|
.word kernel_version-512 # pointing to kernel version string
|
||||||
# above section of header is compatible
|
# above section of header is compatible
|
||||||
# with loadlin-1.5 (header v1.5). Don't
|
# with loadlin-1.5 (header v1.5). Don't
|
||||||
# change it.
|
# change it.
|
||||||
|
|
||||||
type_of_loader: .byte 0 # = 0, old one (LILO, Loadlin,
|
type_of_loader: .byte 0 # 0 means ancient bootloader, newer
|
||||||
# Bootlin, SYSLX, bootsect...)
|
# bootloaders know to change this.
|
||||||
# See Documentation/i386/boot.txt for
|
# See Documentation/i386/boot.txt for
|
||||||
# assigned ids
|
# assigned ids
|
||||||
|
|
||||||
@@ -142,11 +139,7 @@ CAN_USE_HEAP = 0x80 # If set, the loader also has set
|
|||||||
# space behind setup.S can be used for
|
# space behind setup.S can be used for
|
||||||
# heap purposes.
|
# heap purposes.
|
||||||
# Only the loader knows what is free
|
# Only the loader knows what is free
|
||||||
#ifndef __BIG_KERNEL__
|
|
||||||
.byte 0
|
|
||||||
#else
|
|
||||||
.byte LOADED_HIGH
|
.byte LOADED_HIGH
|
||||||
#endif
|
|
||||||
|
|
||||||
setup_move_size: .word 0x8000 # size to move, when setup is not
|
setup_move_size: .word 0x8000 # size to move, when setup is not
|
||||||
# loaded at 0x90000. We will move setup
|
# loaded at 0x90000. We will move setup
|
||||||
@@ -157,11 +150,7 @@ setup_move_size: .word 0x8000 # size to move, when setup is not
|
|||||||
|
|
||||||
code32_start: # here loaders can put a different
|
code32_start: # here loaders can put a different
|
||||||
# start address for 32-bit code.
|
# start address for 32-bit code.
|
||||||
#ifndef __BIG_KERNEL__
|
|
||||||
.long 0x1000 # 0x1000 = default for zImage
|
|
||||||
#else
|
|
||||||
.long 0x100000 # 0x100000 = default for big kernel
|
.long 0x100000 # 0x100000 = default for big kernel
|
||||||
#endif
|
|
||||||
|
|
||||||
ramdisk_image: .long 0 # address of loaded ramdisk image
|
ramdisk_image: .long 0 # address of loaded ramdisk image
|
||||||
# Here the loader puts the 32-bit
|
# Here the loader puts the 32-bit
|
||||||
|
|||||||
@@ -32,47 +32,6 @@ static void realmode_switch_hook(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* A zImage kernel is loaded at 0x10000 but wants to run at 0x1000.
|
|
||||||
* A bzImage kernel is loaded and runs at 0x100000.
|
|
||||||
*/
|
|
||||||
static void move_kernel_around(void)
|
|
||||||
{
|
|
||||||
/* Note: rely on the compile-time option here rather than
|
|
||||||
the LOADED_HIGH flag. The Qemu kernel loader unconditionally
|
|
||||||
sets the loadflags to zero. */
|
|
||||||
#ifndef __BIG_KERNEL__
|
|
||||||
u16 dst_seg, src_seg;
|
|
||||||
u32 syssize;
|
|
||||||
|
|
||||||
dst_seg = 0x1000 >> 4;
|
|
||||||
src_seg = 0x10000 >> 4;
|
|
||||||
syssize = boot_params.hdr.syssize; /* Size in 16-byte paragraphs */
|
|
||||||
|
|
||||||
while (syssize) {
|
|
||||||
int paras = (syssize >= 0x1000) ? 0x1000 : syssize;
|
|
||||||
int dwords = paras << 2;
|
|
||||||
|
|
||||||
asm volatile("pushw %%es ; "
|
|
||||||
"pushw %%ds ; "
|
|
||||||
"movw %1,%%es ; "
|
|
||||||
"movw %2,%%ds ; "
|
|
||||||
"xorw %%di,%%di ; "
|
|
||||||
"xorw %%si,%%si ; "
|
|
||||||
"rep;movsl ; "
|
|
||||||
"popw %%ds ; "
|
|
||||||
"popw %%es"
|
|
||||||
: "+c" (dwords)
|
|
||||||
: "r" (dst_seg), "r" (src_seg)
|
|
||||||
: "esi", "edi");
|
|
||||||
|
|
||||||
syssize -= paras;
|
|
||||||
dst_seg += paras;
|
|
||||||
src_seg += paras;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Disable all interrupts at the legacy PIC.
|
* Disable all interrupts at the legacy PIC.
|
||||||
*/
|
*/
|
||||||
@@ -147,9 +106,6 @@ void go_to_protected_mode(void)
|
|||||||
/* Hook before leaving real mode, also disables interrupts */
|
/* Hook before leaving real mode, also disables interrupts */
|
||||||
realmode_switch_hook();
|
realmode_switch_hook();
|
||||||
|
|
||||||
/* Move the kernel/setup to their final resting places */
|
|
||||||
move_kernel_around();
|
|
||||||
|
|
||||||
/* Enable the A20 gate */
|
/* Enable the A20 gate */
|
||||||
if (enable_a20()) {
|
if (enable_a20()) {
|
||||||
puts("A20 gate not responding, unable to boot...\n");
|
puts("A20 gate not responding, unable to boot...\n");
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ GLOBAL(protected_mode_jump)
|
|||||||
ENDPROC(protected_mode_jump)
|
ENDPROC(protected_mode_jump)
|
||||||
|
|
||||||
.code32
|
.code32
|
||||||
|
.section ".text32","ax"
|
||||||
GLOBAL(in_pm32)
|
GLOBAL(in_pm32)
|
||||||
# Set up data segments for flat 32-bit mode
|
# Set up data segments for flat 32-bit mode
|
||||||
movl %ecx, %ds
|
movl %ecx, %ds
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ SECTIONS
|
|||||||
.header : { *(.header) }
|
.header : { *(.header) }
|
||||||
.inittext : { *(.inittext) }
|
.inittext : { *(.inittext) }
|
||||||
.initdata : { *(.initdata) }
|
.initdata : { *(.initdata) }
|
||||||
.text : { *(.text*) }
|
.text : { *(.text) }
|
||||||
|
.text32 : { *(.text32) }
|
||||||
|
|
||||||
. = ALIGN(16);
|
. = ALIGN(16);
|
||||||
.rodata : { *(.rodata*) }
|
.rodata : { *(.rodata*) }
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ static void die(const char * str, ...)
|
|||||||
|
|
||||||
static void usage(void)
|
static void usage(void)
|
||||||
{
|
{
|
||||||
die("Usage: build [-b] setup system [rootdev] [> image]");
|
die("Usage: build setup system [rootdev] [> image]");
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char ** argv)
|
int main(int argc, char ** argv)
|
||||||
@@ -145,11 +145,6 @@ int main(int argc, char ** argv)
|
|||||||
void *kernel;
|
void *kernel;
|
||||||
u32 crc = 0xffffffffUL;
|
u32 crc = 0xffffffffUL;
|
||||||
|
|
||||||
if (argc > 2 && !strcmp(argv[1], "-b"))
|
|
||||||
{
|
|
||||||
is_big_kernel = 1;
|
|
||||||
argc--, argv++;
|
|
||||||
}
|
|
||||||
if ((argc < 3) || (argc > 4))
|
if ((argc < 3) || (argc > 4))
|
||||||
usage();
|
usage();
|
||||||
if (argc > 3) {
|
if (argc > 3) {
|
||||||
@@ -216,8 +211,6 @@ int main(int argc, char ** argv)
|
|||||||
die("Unable to mmap '%s': %m", argv[2]);
|
die("Unable to mmap '%s': %m", argv[2]);
|
||||||
/* Number of 16-byte paragraphs, including space for a 4-byte CRC */
|
/* Number of 16-byte paragraphs, including space for a 4-byte CRC */
|
||||||
sys_size = (sz + 15 + 4) / 16;
|
sys_size = (sz + 15 + 4) / 16;
|
||||||
if (!is_big_kernel && sys_size > DEF_SYSSIZE)
|
|
||||||
die("System is too big. Try using bzImage or modules.");
|
|
||||||
|
|
||||||
/* Patch the setup code with the appropriate size parameters */
|
/* Patch the setup code with the appropriate size parameters */
|
||||||
buf[0x1f1] = setup_sectors-1;
|
buf[0x1f1] = setup_sectors-1;
|
||||||
|
|||||||
@@ -129,41 +129,45 @@ u16 vga_crtc(void)
|
|||||||
return (inb(0x3cc) & 1) ? 0x3d4 : 0x3b4;
|
return (inb(0x3cc) & 1) ? 0x3d4 : 0x3b4;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vga_set_480_scanlines(int end)
|
static void vga_set_480_scanlines(int lines)
|
||||||
{
|
{
|
||||||
u16 crtc;
|
u16 crtc; /* CRTC base address */
|
||||||
u8 csel;
|
u8 csel; /* CRTC miscellaneous output register */
|
||||||
|
u8 ovfw; /* CRTC overflow register */
|
||||||
|
int end = lines-1;
|
||||||
|
|
||||||
crtc = vga_crtc();
|
crtc = vga_crtc();
|
||||||
|
|
||||||
|
ovfw = 0x3c | ((end >> (8-1)) & 0x02) | ((end >> (9-6)) & 0x40);
|
||||||
|
|
||||||
out_idx(0x0c, crtc, 0x11); /* Vertical sync end, unlock CR0-7 */
|
out_idx(0x0c, crtc, 0x11); /* Vertical sync end, unlock CR0-7 */
|
||||||
out_idx(0x0b, crtc, 0x06); /* Vertical total */
|
out_idx(0x0b, crtc, 0x06); /* Vertical total */
|
||||||
out_idx(0x3e, crtc, 0x07); /* Vertical overflow */
|
out_idx(ovfw, crtc, 0x07); /* Vertical overflow */
|
||||||
out_idx(0xea, crtc, 0x10); /* Vertical sync start */
|
out_idx(0xea, crtc, 0x10); /* Vertical sync start */
|
||||||
out_idx(end, crtc, 0x12); /* Vertical display end */
|
out_idx(end, crtc, 0x12); /* Vertical display end */
|
||||||
out_idx(0xe7, crtc, 0x15); /* Vertical blank start */
|
out_idx(0xe7, crtc, 0x15); /* Vertical blank start */
|
||||||
out_idx(0x04, crtc, 0x16); /* Vertical blank end */
|
out_idx(0x04, crtc, 0x16); /* Vertical blank end */
|
||||||
csel = inb(0x3cc);
|
csel = inb(0x3cc);
|
||||||
csel &= 0x0d;
|
csel &= 0x0d;
|
||||||
csel |= 0xe2;
|
csel |= 0xe2;
|
||||||
outb(csel, 0x3cc);
|
outb(csel, 0x3c2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vga_set_80x30(void)
|
static void vga_set_80x30(void)
|
||||||
{
|
{
|
||||||
vga_set_480_scanlines(0xdf);
|
vga_set_480_scanlines(30*16);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vga_set_80x34(void)
|
static void vga_set_80x34(void)
|
||||||
{
|
{
|
||||||
vga_set_14font();
|
vga_set_14font();
|
||||||
vga_set_480_scanlines(0xdb);
|
vga_set_480_scanlines(34*14);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vga_set_80x60(void)
|
static void vga_set_80x60(void)
|
||||||
{
|
{
|
||||||
vga_set_8font();
|
vga_set_8font();
|
||||||
vga_set_480_scanlines(0xdf);
|
vga_set_480_scanlines(60*8);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vga_set_mode(struct mode_info *mode)
|
static int vga_set_mode(struct mode_info *mode)
|
||||||
|
|||||||
+26
-11
@@ -75,7 +75,7 @@ static inline void default_inquire_remote_apic(int apicid)
|
|||||||
#define setup_secondary_clock setup_secondary_APIC_clock
|
#define setup_secondary_clock setup_secondary_APIC_clock
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_X86_VSMP
|
#ifdef CONFIG_X86_64
|
||||||
extern int is_vsmp_box(void);
|
extern int is_vsmp_box(void);
|
||||||
#else
|
#else
|
||||||
static inline int is_vsmp_box(void)
|
static inline int is_vsmp_box(void)
|
||||||
@@ -108,6 +108,16 @@ extern void native_apic_icr_write(u32 low, u32 id);
|
|||||||
extern u64 native_apic_icr_read(void);
|
extern u64 native_apic_icr_read(void);
|
||||||
|
|
||||||
#ifdef CONFIG_X86_X2APIC
|
#ifdef CONFIG_X86_X2APIC
|
||||||
|
/*
|
||||||
|
* Make previous memory operations globally visible before
|
||||||
|
* sending the IPI through x2apic wrmsr. We need a serializing instruction or
|
||||||
|
* mfence for this.
|
||||||
|
*/
|
||||||
|
static inline void x2apic_wrmsr_fence(void)
|
||||||
|
{
|
||||||
|
asm volatile("mfence" : : : "memory");
|
||||||
|
}
|
||||||
|
|
||||||
static inline void native_apic_msr_write(u32 reg, u32 v)
|
static inline void native_apic_msr_write(u32 reg, u32 v)
|
||||||
{
|
{
|
||||||
if (reg == APIC_DFR || reg == APIC_ID || reg == APIC_LDR ||
|
if (reg == APIC_DFR || reg == APIC_ID || reg == APIC_LDR ||
|
||||||
@@ -184,6 +194,9 @@ static inline int x2apic_enabled(void)
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define x2apic 0
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern int get_physical_broadcast(void);
|
extern int get_physical_broadcast(void);
|
||||||
@@ -379,6 +392,7 @@ static inline u32 safe_apic_wait_icr_idle(void)
|
|||||||
|
|
||||||
static inline void ack_APIC_irq(void)
|
static inline void ack_APIC_irq(void)
|
||||||
{
|
{
|
||||||
|
#ifdef CONFIG_X86_LOCAL_APIC
|
||||||
/*
|
/*
|
||||||
* ack_APIC_irq() actually gets compiled as a single instruction
|
* ack_APIC_irq() actually gets compiled as a single instruction
|
||||||
* ... yummie.
|
* ... yummie.
|
||||||
@@ -386,6 +400,7 @@ static inline void ack_APIC_irq(void)
|
|||||||
|
|
||||||
/* Docs say use 0 for future compatibility */
|
/* Docs say use 0 for future compatibility */
|
||||||
apic_write(APIC_EOI, 0);
|
apic_write(APIC_EOI, 0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned default_get_apic_id(unsigned long x)
|
static inline unsigned default_get_apic_id(unsigned long x)
|
||||||
@@ -474,10 +489,19 @@ static inline int default_apic_id_registered(void)
|
|||||||
return physid_isset(read_apic_id(), phys_cpu_present_map);
|
return physid_isset(read_apic_id(), phys_cpu_present_map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int default_phys_pkg_id(int cpuid_apic, int index_msb)
|
||||||
|
{
|
||||||
|
return cpuid_apic >> index_msb;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern int default_apicid_to_node(int logical_apicid);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
static inline unsigned int
|
static inline unsigned int
|
||||||
default_cpu_mask_to_apicid(const struct cpumask *cpumask)
|
default_cpu_mask_to_apicid(const struct cpumask *cpumask)
|
||||||
{
|
{
|
||||||
return cpumask_bits(cpumask)[0];
|
return cpumask_bits(cpumask)[0] & APIC_ALL_CPUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline unsigned int
|
static inline unsigned int
|
||||||
@@ -491,15 +515,6 @@ default_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
|
|||||||
return (unsigned int)(mask1 & mask2 & mask3);
|
return (unsigned int)(mask1 & mask2 & mask3);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int default_phys_pkg_id(int cpuid_apic, int index_msb)
|
|
||||||
{
|
|
||||||
return cpuid_apic >> index_msb;
|
|
||||||
}
|
|
||||||
|
|
||||||
extern int default_apicid_to_node(int logical_apicid);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline unsigned long default_check_apicid_used(physid_mask_t bitmap, int apicid)
|
static inline unsigned long default_check_apicid_used(physid_mask_t bitmap, int apicid)
|
||||||
{
|
{
|
||||||
return physid_isset(apicid, bitmap);
|
return physid_isset(apicid, bitmap);
|
||||||
|
|||||||
@@ -53,6 +53,7 @@
|
|||||||
#define APIC_ESR_SENDILL 0x00020
|
#define APIC_ESR_SENDILL 0x00020
|
||||||
#define APIC_ESR_RECVILL 0x00040
|
#define APIC_ESR_RECVILL 0x00040
|
||||||
#define APIC_ESR_ILLREGA 0x00080
|
#define APIC_ESR_ILLREGA 0x00080
|
||||||
|
#define APIC_LVTCMCI 0x2f0
|
||||||
#define APIC_ICR 0x300
|
#define APIC_ICR 0x300
|
||||||
#define APIC_DEST_SELF 0x40000
|
#define APIC_DEST_SELF 0x40000
|
||||||
#define APIC_DEST_ALLINC 0x80000
|
#define APIC_DEST_ALLINC 0x80000
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
#ifndef _ASM_X86_BOOT_H
|
#ifndef _ASM_X86_BOOT_H
|
||||||
#define _ASM_X86_BOOT_H
|
#define _ASM_X86_BOOT_H
|
||||||
|
|
||||||
/* Don't touch these, unless you really know what you're doing. */
|
|
||||||
#define DEF_SYSSEG 0x1000
|
|
||||||
#define DEF_SYSSIZE 0x7F00
|
|
||||||
|
|
||||||
/* Internal svga startup constants */
|
/* Internal svga startup constants */
|
||||||
#define NORMAL_VGA 0xffff /* 80x25 mode */
|
#define NORMAL_VGA 0xffff /* 80x25 mode */
|
||||||
#define EXTENDED_VGA 0xfffe /* 80x50 mode */
|
#define EXTENDED_VGA 0xfffe /* 80x50 mode */
|
||||||
|
|||||||
@@ -90,6 +90,9 @@ int set_memory_4k(unsigned long addr, int numpages);
|
|||||||
int set_memory_array_uc(unsigned long *addr, int addrinarray);
|
int set_memory_array_uc(unsigned long *addr, int addrinarray);
|
||||||
int set_memory_array_wb(unsigned long *addr, int addrinarray);
|
int set_memory_array_wb(unsigned long *addr, int addrinarray);
|
||||||
|
|
||||||
|
int set_pages_array_uc(struct page **pages, int addrinarray);
|
||||||
|
int set_pages_array_wb(struct page **pages, int addrinarray);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For legacy compatibility with the old APIs, a few functions
|
* For legacy compatibility with the old APIs, a few functions
|
||||||
* are provided that work on a "struct page".
|
* are provided that work on a "struct page".
|
||||||
|
|||||||
Executable
+226
@@ -0,0 +1,226 @@
|
|||||||
|
#ifndef _ASM_X86_CPU_DEBUG_H
|
||||||
|
#define _ASM_X86_CPU_DEBUG_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
* CPU x86 architecture debug
|
||||||
|
*
|
||||||
|
* Copyright(C) 2009 Jaswinder Singh Rajput
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Register flags */
|
||||||
|
enum cpu_debug_bit {
|
||||||
|
/* Model Specific Registers (MSRs) */
|
||||||
|
CPU_MC_BIT, /* Machine Check */
|
||||||
|
CPU_MONITOR_BIT, /* Monitor */
|
||||||
|
CPU_TIME_BIT, /* Time */
|
||||||
|
CPU_PMC_BIT, /* Performance Monitor */
|
||||||
|
CPU_PLATFORM_BIT, /* Platform */
|
||||||
|
CPU_APIC_BIT, /* APIC */
|
||||||
|
CPU_POWERON_BIT, /* Power-on */
|
||||||
|
CPU_CONTROL_BIT, /* Control */
|
||||||
|
CPU_FEATURES_BIT, /* Features control */
|
||||||
|
CPU_LBRANCH_BIT, /* Last Branch */
|
||||||
|
CPU_BIOS_BIT, /* BIOS */
|
||||||
|
CPU_FREQ_BIT, /* Frequency */
|
||||||
|
CPU_MTTR_BIT, /* MTRR */
|
||||||
|
CPU_PERF_BIT, /* Performance */
|
||||||
|
CPU_CACHE_BIT, /* Cache */
|
||||||
|
CPU_SYSENTER_BIT, /* Sysenter */
|
||||||
|
CPU_THERM_BIT, /* Thermal */
|
||||||
|
CPU_MISC_BIT, /* Miscellaneous */
|
||||||
|
CPU_DEBUG_BIT, /* Debug */
|
||||||
|
CPU_PAT_BIT, /* PAT */
|
||||||
|
CPU_VMX_BIT, /* VMX */
|
||||||
|
CPU_CALL_BIT, /* System Call */
|
||||||
|
CPU_BASE_BIT, /* BASE Address */
|
||||||
|
CPU_VER_BIT, /* Version ID */
|
||||||
|
CPU_CONF_BIT, /* Configuration */
|
||||||
|
CPU_SMM_BIT, /* System mgmt mode */
|
||||||
|
CPU_SVM_BIT, /*Secure Virtual Machine*/
|
||||||
|
CPU_OSVM_BIT, /* OS-Visible Workaround*/
|
||||||
|
/* Standard Registers */
|
||||||
|
CPU_TSS_BIT, /* Task Stack Segment */
|
||||||
|
CPU_CR_BIT, /* Control Registers */
|
||||||
|
CPU_DT_BIT, /* Descriptor Table */
|
||||||
|
/* End of Registers flags */
|
||||||
|
CPU_REG_ALL_BIT, /* Select all Registers */
|
||||||
|
};
|
||||||
|
|
||||||
|
#define CPU_REG_ALL (~0) /* Select all Registers */
|
||||||
|
|
||||||
|
#define CPU_MC (1 << CPU_MC_BIT)
|
||||||
|
#define CPU_MONITOR (1 << CPU_MONITOR_BIT)
|
||||||
|
#define CPU_TIME (1 << CPU_TIME_BIT)
|
||||||
|
#define CPU_PMC (1 << CPU_PMC_BIT)
|
||||||
|
#define CPU_PLATFORM (1 << CPU_PLATFORM_BIT)
|
||||||
|
#define CPU_APIC (1 << CPU_APIC_BIT)
|
||||||
|
#define CPU_POWERON (1 << CPU_POWERON_BIT)
|
||||||
|
#define CPU_CONTROL (1 << CPU_CONTROL_BIT)
|
||||||
|
#define CPU_FEATURES (1 << CPU_FEATURES_BIT)
|
||||||
|
#define CPU_LBRANCH (1 << CPU_LBRANCH_BIT)
|
||||||
|
#define CPU_BIOS (1 << CPU_BIOS_BIT)
|
||||||
|
#define CPU_FREQ (1 << CPU_FREQ_BIT)
|
||||||
|
#define CPU_MTRR (1 << CPU_MTTR_BIT)
|
||||||
|
#define CPU_PERF (1 << CPU_PERF_BIT)
|
||||||
|
#define CPU_CACHE (1 << CPU_CACHE_BIT)
|
||||||
|
#define CPU_SYSENTER (1 << CPU_SYSENTER_BIT)
|
||||||
|
#define CPU_THERM (1 << CPU_THERM_BIT)
|
||||||
|
#define CPU_MISC (1 << CPU_MISC_BIT)
|
||||||
|
#define CPU_DEBUG (1 << CPU_DEBUG_BIT)
|
||||||
|
#define CPU_PAT (1 << CPU_PAT_BIT)
|
||||||
|
#define CPU_VMX (1 << CPU_VMX_BIT)
|
||||||
|
#define CPU_CALL (1 << CPU_CALL_BIT)
|
||||||
|
#define CPU_BASE (1 << CPU_BASE_BIT)
|
||||||
|
#define CPU_VER (1 << CPU_VER_BIT)
|
||||||
|
#define CPU_CONF (1 << CPU_CONF_BIT)
|
||||||
|
#define CPU_SMM (1 << CPU_SMM_BIT)
|
||||||
|
#define CPU_SVM (1 << CPU_SVM_BIT)
|
||||||
|
#define CPU_OSVM (1 << CPU_OSVM_BIT)
|
||||||
|
#define CPU_TSS (1 << CPU_TSS_BIT)
|
||||||
|
#define CPU_CR (1 << CPU_CR_BIT)
|
||||||
|
#define CPU_DT (1 << CPU_DT_BIT)
|
||||||
|
|
||||||
|
/* Register file flags */
|
||||||
|
enum cpu_file_bit {
|
||||||
|
CPU_INDEX_BIT, /* index */
|
||||||
|
CPU_VALUE_BIT, /* value */
|
||||||
|
};
|
||||||
|
|
||||||
|
#define CPU_FILE_VALUE (1 << CPU_VALUE_BIT)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* DisplayFamily_DisplayModel Processor Families/Processor Number Series
|
||||||
|
* -------------------------- ------------------------------------------
|
||||||
|
* 05_01, 05_02, 05_04 Pentium, Pentium with MMX
|
||||||
|
*
|
||||||
|
* 06_01 Pentium Pro
|
||||||
|
* 06_03, 06_05 Pentium II Xeon, Pentium II
|
||||||
|
* 06_07, 06_08, 06_0A, 06_0B Pentium III Xeon, Pentum III
|
||||||
|
*
|
||||||
|
* 06_09, 060D Pentium M
|
||||||
|
*
|
||||||
|
* 06_0E Core Duo, Core Solo
|
||||||
|
*
|
||||||
|
* 06_0F Xeon 3000, 3200, 5100, 5300, 7300 series,
|
||||||
|
* Core 2 Quad, Core 2 Extreme, Core 2 Duo,
|
||||||
|
* Pentium dual-core
|
||||||
|
* 06_17 Xeon 5200, 5400 series, Core 2 Quad Q9650
|
||||||
|
*
|
||||||
|
* 06_1C Atom
|
||||||
|
*
|
||||||
|
* 0F_00, 0F_01, 0F_02 Xeon, Xeon MP, Pentium 4
|
||||||
|
* 0F_03, 0F_04 Xeon, Xeon MP, Pentium 4, Pentium D
|
||||||
|
*
|
||||||
|
* 0F_06 Xeon 7100, 5000 Series, Xeon MP,
|
||||||
|
* Pentium 4, Pentium D
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Register processors bits */
|
||||||
|
enum cpu_processor_bit {
|
||||||
|
CPU_NONE,
|
||||||
|
/* Intel */
|
||||||
|
CPU_INTEL_PENTIUM_BIT,
|
||||||
|
CPU_INTEL_P6_BIT,
|
||||||
|
CPU_INTEL_PENTIUM_M_BIT,
|
||||||
|
CPU_INTEL_CORE_BIT,
|
||||||
|
CPU_INTEL_CORE2_BIT,
|
||||||
|
CPU_INTEL_ATOM_BIT,
|
||||||
|
CPU_INTEL_XEON_P4_BIT,
|
||||||
|
CPU_INTEL_XEON_MP_BIT,
|
||||||
|
/* AMD */
|
||||||
|
CPU_AMD_K6_BIT,
|
||||||
|
CPU_AMD_K7_BIT,
|
||||||
|
CPU_AMD_K8_BIT,
|
||||||
|
CPU_AMD_0F_BIT,
|
||||||
|
CPU_AMD_10_BIT,
|
||||||
|
CPU_AMD_11_BIT,
|
||||||
|
};
|
||||||
|
|
||||||
|
#define CPU_INTEL_PENTIUM (1 << CPU_INTEL_PENTIUM_BIT)
|
||||||
|
#define CPU_INTEL_P6 (1 << CPU_INTEL_P6_BIT)
|
||||||
|
#define CPU_INTEL_PENTIUM_M (1 << CPU_INTEL_PENTIUM_M_BIT)
|
||||||
|
#define CPU_INTEL_CORE (1 << CPU_INTEL_CORE_BIT)
|
||||||
|
#define CPU_INTEL_CORE2 (1 << CPU_INTEL_CORE2_BIT)
|
||||||
|
#define CPU_INTEL_ATOM (1 << CPU_INTEL_ATOM_BIT)
|
||||||
|
#define CPU_INTEL_XEON_P4 (1 << CPU_INTEL_XEON_P4_BIT)
|
||||||
|
#define CPU_INTEL_XEON_MP (1 << CPU_INTEL_XEON_MP_BIT)
|
||||||
|
|
||||||
|
#define CPU_INTEL_PX (CPU_INTEL_P6 | CPU_INTEL_PENTIUM_M)
|
||||||
|
#define CPU_INTEL_COREX (CPU_INTEL_CORE | CPU_INTEL_CORE2)
|
||||||
|
#define CPU_INTEL_XEON (CPU_INTEL_XEON_P4 | CPU_INTEL_XEON_MP)
|
||||||
|
#define CPU_CO_AT (CPU_INTEL_CORE | CPU_INTEL_ATOM)
|
||||||
|
#define CPU_C2_AT (CPU_INTEL_CORE2 | CPU_INTEL_ATOM)
|
||||||
|
#define CPU_CX_AT (CPU_INTEL_COREX | CPU_INTEL_ATOM)
|
||||||
|
#define CPU_CX_XE (CPU_INTEL_COREX | CPU_INTEL_XEON)
|
||||||
|
#define CPU_P6_XE (CPU_INTEL_P6 | CPU_INTEL_XEON)
|
||||||
|
#define CPU_PM_CO_AT (CPU_INTEL_PENTIUM_M | CPU_CO_AT)
|
||||||
|
#define CPU_C2_AT_XE (CPU_C2_AT | CPU_INTEL_XEON)
|
||||||
|
#define CPU_CX_AT_XE (CPU_CX_AT | CPU_INTEL_XEON)
|
||||||
|
#define CPU_P6_CX_AT (CPU_INTEL_P6 | CPU_CX_AT)
|
||||||
|
#define CPU_P6_CX_XE (CPU_P6_XE | CPU_INTEL_COREX)
|
||||||
|
#define CPU_P6_CX_AT_XE (CPU_INTEL_P6 | CPU_CX_AT_XE)
|
||||||
|
#define CPU_PM_CX_AT_XE (CPU_INTEL_PENTIUM_M | CPU_CX_AT_XE)
|
||||||
|
#define CPU_PM_CX_AT (CPU_INTEL_PENTIUM_M | CPU_CX_AT)
|
||||||
|
#define CPU_PM_CX_XE (CPU_INTEL_PENTIUM_M | CPU_CX_XE)
|
||||||
|
#define CPU_PX_CX_AT (CPU_INTEL_PX | CPU_CX_AT)
|
||||||
|
#define CPU_PX_CX_AT_XE (CPU_INTEL_PX | CPU_CX_AT_XE)
|
||||||
|
|
||||||
|
/* Select all supported Intel CPUs */
|
||||||
|
#define CPU_INTEL_ALL (CPU_INTEL_PENTIUM | CPU_PX_CX_AT_XE)
|
||||||
|
|
||||||
|
#define CPU_AMD_K6 (1 << CPU_AMD_K6_BIT)
|
||||||
|
#define CPU_AMD_K7 (1 << CPU_AMD_K7_BIT)
|
||||||
|
#define CPU_AMD_K8 (1 << CPU_AMD_K8_BIT)
|
||||||
|
#define CPU_AMD_0F (1 << CPU_AMD_0F_BIT)
|
||||||
|
#define CPU_AMD_10 (1 << CPU_AMD_10_BIT)
|
||||||
|
#define CPU_AMD_11 (1 << CPU_AMD_11_BIT)
|
||||||
|
|
||||||
|
#define CPU_K10_PLUS (CPU_AMD_10 | CPU_AMD_11)
|
||||||
|
#define CPU_K0F_PLUS (CPU_AMD_0F | CPU_K10_PLUS)
|
||||||
|
#define CPU_K8_PLUS (CPU_AMD_K8 | CPU_K0F_PLUS)
|
||||||
|
#define CPU_K7_PLUS (CPU_AMD_K7 | CPU_K8_PLUS)
|
||||||
|
|
||||||
|
/* Select all supported AMD CPUs */
|
||||||
|
#define CPU_AMD_ALL (CPU_AMD_K6 | CPU_K7_PLUS)
|
||||||
|
|
||||||
|
/* Select all supported CPUs */
|
||||||
|
#define CPU_ALL (CPU_INTEL_ALL | CPU_AMD_ALL)
|
||||||
|
|
||||||
|
#define MAX_CPU_FILES 512
|
||||||
|
|
||||||
|
struct cpu_private {
|
||||||
|
unsigned cpu;
|
||||||
|
unsigned type;
|
||||||
|
unsigned reg;
|
||||||
|
unsigned file;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct cpu_debug_base {
|
||||||
|
char *name; /* Register name */
|
||||||
|
unsigned flag; /* Register flag */
|
||||||
|
unsigned write; /* Register write flag */
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Currently it looks similar to cpu_debug_base but once we add more files
|
||||||
|
* cpu_file_base will go in different direction
|
||||||
|
*/
|
||||||
|
struct cpu_file_base {
|
||||||
|
char *name; /* Register file name */
|
||||||
|
unsigned flag; /* Register file flag */
|
||||||
|
unsigned write; /* Register write flag */
|
||||||
|
};
|
||||||
|
|
||||||
|
struct cpu_cpuX_base {
|
||||||
|
struct dentry *dentry; /* Register dentry */
|
||||||
|
int init; /* Register index file */
|
||||||
|
};
|
||||||
|
|
||||||
|
struct cpu_debug_range {
|
||||||
|
unsigned min; /* Register range min */
|
||||||
|
unsigned max; /* Register range max */
|
||||||
|
unsigned flag; /* Supported flags */
|
||||||
|
unsigned model; /* Supported models */
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* _ASM_X86_CPU_DEBUG_H */
|
||||||
@@ -91,7 +91,6 @@ static inline int desc_empty(const void *ptr)
|
|||||||
#define store_gdt(dtr) native_store_gdt(dtr)
|
#define store_gdt(dtr) native_store_gdt(dtr)
|
||||||
#define store_idt(dtr) native_store_idt(dtr)
|
#define store_idt(dtr) native_store_idt(dtr)
|
||||||
#define store_tr(tr) (tr = native_store_tr())
|
#define store_tr(tr) (tr = native_store_tr())
|
||||||
#define store_ldt(ldt) asm("sldt %0":"=m" (ldt))
|
|
||||||
|
|
||||||
#define load_TLS(t, cpu) native_load_tls(t, cpu)
|
#define load_TLS(t, cpu) native_load_tls(t, cpu)
|
||||||
#define set_ldt native_set_ldt
|
#define set_ldt native_set_ldt
|
||||||
@@ -112,6 +111,8 @@ static inline void paravirt_free_ldt(struct desc_struct *ldt, unsigned entries)
|
|||||||
}
|
}
|
||||||
#endif /* CONFIG_PARAVIRT */
|
#endif /* CONFIG_PARAVIRT */
|
||||||
|
|
||||||
|
#define store_ldt(ldt) asm("sldt %0" : "=m"(ldt))
|
||||||
|
|
||||||
static inline void native_write_idt_entry(gate_desc *idt, int entry,
|
static inline void native_write_idt_entry(gate_desc *idt, int entry,
|
||||||
const gate_desc *gate)
|
const gate_desc *gate)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,22 +1,15 @@
|
|||||||
#ifndef _ASM_X86_DMI_H
|
#ifndef _ASM_X86_DMI_H
|
||||||
#define _ASM_X86_DMI_H
|
#define _ASM_X86_DMI_H
|
||||||
|
|
||||||
|
#include <linux/compiler.h>
|
||||||
|
#include <linux/init.h>
|
||||||
|
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
|
#include <asm/setup.h>
|
||||||
|
|
||||||
#define DMI_MAX_DATA 2048
|
static __always_inline __init void *dmi_alloc(unsigned len)
|
||||||
|
|
||||||
extern int dmi_alloc_index;
|
|
||||||
extern char dmi_alloc_data[DMI_MAX_DATA];
|
|
||||||
|
|
||||||
/* This is so early that there is no good way to allocate dynamic memory.
|
|
||||||
Allocate data in an BSS array. */
|
|
||||||
static inline void *dmi_alloc(unsigned len)
|
|
||||||
{
|
{
|
||||||
int idx = dmi_alloc_index;
|
return extend_brk(len, sizeof(int));
|
||||||
if ((dmi_alloc_index + len) > DMI_MAX_DATA)
|
|
||||||
return NULL;
|
|
||||||
dmi_alloc_index += len;
|
|
||||||
return dmi_alloc_data + idx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Use early IO mappings for DMI because it's initialized early */
|
/* Use early IO mappings for DMI because it's initialized early */
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ extern int e820_all_mapped(u64 start, u64 end, unsigned type);
|
|||||||
extern void e820_add_region(u64 start, u64 size, int type);
|
extern void e820_add_region(u64 start, u64 size, int type);
|
||||||
extern void e820_print_map(char *who);
|
extern void e820_print_map(char *who);
|
||||||
extern int
|
extern int
|
||||||
sanitize_e820_map(struct e820entry *biosmap, int max_nr_map, int *pnr_map);
|
sanitize_e820_map(struct e820entry *biosmap, int max_nr_map, u32 *pnr_map);
|
||||||
extern u64 e820_update_range(u64 start, u64 size, unsigned old_type,
|
extern u64 e820_update_range(u64 start, u64 size, unsigned old_type,
|
||||||
unsigned new_type);
|
unsigned new_type);
|
||||||
extern u64 e820_remove_range(u64 start, u64 size, unsigned old_type,
|
extern u64 e820_remove_range(u64 start, u64 size, unsigned old_type,
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ BUILD_INTERRUPT3(invalidate_interrupt7,INVALIDATE_TLB_VECTOR_START+7,
|
|||||||
smp_invalidate_interrupt)
|
smp_invalidate_interrupt)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
BUILD_INTERRUPT(generic_interrupt, GENERIC_INTERRUPT_VECTOR)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* every pentium local APIC has two 'local interrupts', with a
|
* every pentium local APIC has two 'local interrupts', with a
|
||||||
* soft-definable vector attached to both interrupts, one of
|
* soft-definable vector attached to both interrupts, one of
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user