Commit 0457d99a authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] x86_64 merge: arch + asm

This adds the x86_64 arch and asm directories and a Documentation/x86_64.

It took a bit longer because I first had to make preemption and thread_info
work and also found some other bugs while doing this. The port has been
tested for a long time on UP.

I'm not sure what I should describe.  A lot is based on i386 with
a lot of cleanups. I wrote a paper about it for last year's OLS that describes
most of the changes (ftp://ftp.firstfloor.org/pub/ak/x86_64.ps.gz). It is
a bit outdated now, but should give a good overview.

It currently has a completely cut'n'pasted from others+hacked 32bit
emulation. I hope to clean that up in the future by merging the generic
core of this with other 64bit archs.

Thanks,
-Andi
parent 96bde926
The paging design used on the x86-64 linux kernel port in 2.4.x provides:
o per process virtual address space limit of 512 Gigabytes
o top of userspace stack located at address 0x0000007fffffffff
o PAGE_OFFSET = 0xffff800000000000
o start of the kernel = 0xffffffff800000000
o global RAM per system 2^64-PAGE_OFFSET-sizeof(kernel) = 128 Terabytes - 2 Gigabytes
o no need of any common code change
o no need to use highmem to handle the 128 Terabytes of RAM
Description:
Userspace is able to modify and it sees only the 3rd/2nd/1st level
pagetables (pgd_offset() implicitly walks the 1st slot of the 4th
level pagetable and it returns an entry into the 3rd level pagetable).
This is where the per-process 512 Gigabytes limit cames from.
The common code pgd is the PDPE, the pmd is the PDE, the
pte is the PTE. The PML4E remains invisible to the common
code.
The kernel uses all the first 47 bits of the negative half
of the virtual address space to build the direct mapping using
2 Mbytes page size. The kernel virtual addresses have bit number
47 always set to 1 (and in turn also bits 48-63 are set to 1 too,
due the sign extension). This is where the 128 Terabytes - 2 Gigabytes global
limit of RAM cames from.
Since the per-process limit is 512 Gigabytes (due to kernel common
code 3 level pagetable limitation), the higher virtual address mapped
into userspace is 0x7fffffffff and it makes sense to use it
as the top of the userspace stack to allow the stack to grow as
much as possible.
Setting the PAGE_OFFSET to 2^39 (after the last userspace
virtual address) wouldn't make much difference compared to
setting PAGE_OFFSET to 0xffff800000000000 because we have an
hole into the virtual address space. The last byte mapped by the
255th slot in the 4th level pagetable is at virtual address
0x00007fffffffffff and the first byte mapped by the 256th slot in the
4th level pagetable is at address 0xffff800000000000. Due to this
hole we can't trivially build a direct mapping across all the
512 slots of the 4th level pagetable, so we simply use only the
second (negative) half of the 4th level pagetable for that purpose
(that provides us 128 Terabytes of contigous virtual addresses).
Strictly speaking we could build a direct mapping also across the hole
using some DISCONTIGMEM trick, but we don't need such a large
direct mapping right now.
Future:
During 2.5.x we can break the 512 Gigabytes per-process limit
possibly by removing from the common code any knowledge about the
architectural dependent physical layout of the virtual to physical
mapping.
Once the 512 Gigabytes limit will be removed the kernel stack will
be moved (most probably to virtual address 0x00007fffffffffff).
Nothing will break in userspace due that move, as nothing breaks
in IA32 compiling the kernel with CONFIG_2G.
Linus agreed on not breaking common code and to live with the 512 Gigabytes
per-process limitation for the 2.4.x timeframe and he has given me and Andi
some very useful hints... (thanks! :)
Thanks also to H. Peter Anvin for his interesting and useful suggestions on
the x86-64-discuss lists!
Other memory management related issues follows:
PAGE_SIZE:
If somebody is wondering why these days we still have a so small
4k pagesize (16 or 32 kbytes would be much better for performance
of course), the PAGE_SIZE have to remain 4k for 32bit apps to
provide 100% backwards compatible IA32 API (we can't allow silent
fs corruption or as best a loss of coherency with the page cache
by allocating MAP_SHARED areas in MAP_ANONYMOUS memory with a
do_mmap_fake). I think it could be possible to have a dynamic page
size between 32bit and 64bit apps but it would need extremely
intrusive changes in the common code as first for page cache and
we sure don't want to depend on them right now even if the
hardware would support that.
PAGETABLE SIZE:
In turn we can't afford to have pagetables larger than 4k because
we could not be able to allocate them due physical memory
fragmentation, and failing to allocate the kernel stack is a minor
issue compared to failing the allocation of a pagetable. If we
fail the allocation of a pagetable the only thing we can do is to
sched_yield polling the freelist (deadlock prone) or to segfault
the task (not even the sighandler would be sure to run).
KERNEL STACK:
1st stage:
The kernel stack will be at first allocated with an order 2 allocation
(16k) (the utilization of the stack for a 64bit platform really
isn't exactly the double of a 32bit platform because the local
variables may not be all 64bit wide, but not much less). This will
make things even worse than they are right now on IA32 with
respect of failing fork/clone due memory fragmentation.
2nd stage:
We'll benchmark if reserving one register as task_struct
pointer will improve performance of the kernel (instead of
recalculating the task_struct pointer starting from the stack
pointer each time). My guess is that recalculating will be faster
but it worth a try.
If reserving one register for the task_struct pointer
will be faster we can as well split task_struct and kernel
stack. task_struct can be a slab allocation or a
PAGE_SIZEd allocation, and the kernel stack can then be
allocated in a order 1 allocation. Really this is risky,
since 8k on a 64bit platform is going to be less than 7k
on a 32bit platform but we could try it out. This would
reduce the fragmentation problem of an order of magnitude
making it equal to the current IA32.
We must also consider the x86-64 seems to provide in hardware a
per-irq stack that could allow us to remove the irq handler
footprint from the regular per-process-stack, so it could allow
us to live with a smaller kernel stack compared to the other
linux architectures.
3rd stage:
Before going into production if we still have the order 2
allocation we can add a sysctl that allows the kernel stack to be
allocated with vmalloc during memory fragmentation. This have to
remain turned off during benchmarks :) but it should be ok in real
life.
Order of PAGE_CACHE_SIZE and other allocations:
On the long run we can increase the PAGE_CACHE_SIZE to be
an order 2 allocations and also the slab/buffercache etc.ec..
could be all done with order 2 allocations. To make the above
to work we should change lots of common code thus it can be done
only once the basic port will be in a production state. Having
a working PAGE_CACHE_SIZE would be a benefit also for
IA32 and other architectures of course.
Andrea <andrea@suse.de> SuSE
This diff is collapsed.
#
# x86_64/Makefile
#
# This file is included by the global makefile so that you can add your own
# architecture-specific flags and dependencies. Remember to do have actions
# for "archclean" and "archdep" for cleaning up and making dependencies for
# this architecture
#
# This file is subject to the terms and conditions of the GNU General Public
# License. See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 1994 by Linus Torvalds
#
# 19990713 Artur Skawina <skawina@geocities.com>
# Added '-march' and '-mpreferred-stack-boundary' support
# 20000913 Pavel Machek <pavel@suse.cz>
# Converted for x86_64 architecture
# 20010105 Andi Kleen, add IA32 compiler.
#
# $Id: Makefile,v 1.28 2001/06/29 17:47:43 aj Exp $
#
# boot system currently needs IA32 tools to link (to be fixed)
#
# Change this to your i386 compiler/binutils
IA32_PREFIX := /usr/bin/
IA32_CC := $(IA32_PREFIX)gcc -O2 -fomit-frame-pointer -nostdinc -I $(HPATH)
IA32_LD := $(IA32_PREFIX)ld
IA32_AS := $(IA32_PREFIX)gcc -D__ASSEMBLY__ -traditional -c -nostdinc -I $(HPATH)
IA32_OBJCOPY := $(IA32_PREFIX)objcopy
IA32_CPP := $(IA32_PREFIX)gcc -E
export IA32_CC IA32_LD IA32_AS IA32_OBJCOPY IA32_CPP
LD=$(CROSS_COMPILE)ld -m elf_x86_64
OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S
LDFLAGS=-e stext
LINKFLAGS =-T $(TOPDIR)/arch/x86_64/vmlinux.lds $(LDFLAGS)
CFLAGS += $(shell if $(CC) -mno-red-zone -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mno-red-zone"; fi )
CFLAGS += -mcmodel=kernel
CFLAGS += -pipe
# generates worse code, but makes the assembly much more readable:
CFLAGS += -fno-reorder-blocks
# work around early gcc 3.1 bugs. Later snapshots should this already fixed.
CFLAGS += -fno-strength-reduce
# make sure all inline functions are inlined
CFLAGS += -finline-limit=3000
#CFLAGS += -g
# prevent gcc from keeping the stack 16 byte aligned (FIXME)
#CFLAGS += -mpreferred-stack-boundary=2
HEAD := arch/x86_64/kernel/head.o arch/x86_64/kernel/head64.o arch/x86_64/kernel/init_task.o
SUBDIRS := arch/x86_64/tools $(SUBDIRS) arch/x86_64/kernel arch/x86_64/mm arch/x86_64/lib
CORE_FILES := arch/x86_64/kernel/kernel.o $(CORE_FILES)
CORE_FILES += arch/x86_64/mm/mm.o
LIBS := $(TOPDIR)/arch/x86_64/lib/lib.a $(LIBS)
CLEAN_FILES += include/asm-x86_64/offset.h
ifdef CONFIG_IA32_EMULATION
SUBDIRS += arch/x86_64/ia32
CORE_FILES += arch/x86_64/ia32/ia32.o
endif
ifdef CONFIG_HOSTFS
SUBDIRS += arch/x86_64/hostfs
core-$(CONFIG_HOSTFS) += arch/x86_64/hostfs/hostfs.o
endif
CORE_FILES += $(core-y)
arch/x86_64/tools: dummy
$(MAKE) linuxsubdirs SUBDIRS=arch/x86_64/tools
arch/x86_64/kernel: dummy
$(MAKE) linuxsubdirs SUBDIRS=arch/x86_64/kernel
arch/x86_64/mm: dummy
$(MAKE) linuxsubdirs SUBDIRS=arch/x86_64/mm
MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
vmlinux: arch/x86_64/vmlinux.lds
checkoffset: FORCE
make -C arch/$(ARCH)/tools $(TOPDIR)/include/asm-x86_64/offset.h
FORCE: ;
.PHONY: zImage bzImage compressed zlilo bzlilo zdisk bzdisk install \
clean archclean archmrproper archdep checkoffset
bzImage: checkoffset vmlinux
@$(MAKEBOOT) bzImage
bzImage-padded: checkoffset vmlinux
@$(MAKEBOOT) bzImage-padded
tmp:
@$(MAKEBOOT) BOOTIMAGE=bzImage zlilo
bzlilo: checkoffset vmlinux
@$(MAKEBOOT) BOOTIMAGE=bzImage zlilo
zdisk: checkoffset vmlinux
@$(MAKEBOOT) BOOTIMAGE=zImage zdisk
bzdisk: checkoffset vmlinux
@$(MAKEBOOT) BOOTIMAGE=bzImage zdisk
install: checkoffset vmlinux
@$(MAKEBOOT) BOOTIMAGE=bzImage install
archclean:
@$(MAKEBOOT) clean
$(MAKE) -C $(TOPDIR)/arch/x86_64/tools clean
archmrproper:
rm -f $(TOPDIR)/arch/x86_64/tools/offset.h
rm -f $(TOPDIR)/arch/x86_64/tools/offset.tmp
rm -f $(TOPDIR)/include/asm-x86_64/offset.h
archdep:
@$(MAKE) -C $(TOPDIR)/arch/x86_64/tools all
@$(MAKEBOOT) dep
#
# arch/x86_64/boot/Makefile
#
# This file is subject to the terms and conditions of the GNU General Public
# License. See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 1994 by Linus Torvalds
#
BOOT_INCL = $(TOPDIR)/include/linux/config.h \
$(TOPDIR)/include/linux/autoconf.h \
$(TOPDIR)/include/asm/boot.h
zImage: $(CONFIGURE) bootsect setup compressed/vmlinux tools/build
$(OBJCOPY) compressed/vmlinux compressed/vmlinux.out
tools/build bootsect setup compressed/vmlinux.out $(ROOT_DEV) > zImage
bzImage: $(CONFIGURE) bbootsect bsetup compressed/bvmlinux tools/build
$(OBJCOPY) compressed/bvmlinux compressed/bvmlinux.out
tools/build -b bbootsect bsetup compressed/bvmlinux.out $(ROOT_DEV) > bzImage
bzImage-padded: bzImage
dd if=/dev/zero bs=1k count=70 >> bzImage
compressed/vmlinux: $(TOPDIR)/vmlinux
@$(MAKE) -C compressed vmlinux
compressed/bvmlinux: $(TOPDIR)/vmlinux
@$(MAKE) -C compressed bvmlinux
zdisk: $(BOOTIMAGE)
dd bs=8192 if=$(BOOTIMAGE) of=/dev/fd0
zlilo: $(CONFIGURE) $(BOOTIMAGE)
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
cat $(BOOTIMAGE) > $(INSTALL_PATH)/vmlinuz
cp $(TOPDIR)/System.map $(INSTALL_PATH)/
if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
install: $(CONFIGURE) $(BOOTIMAGE)
sh -x ./install.sh $(KERNELRELEASE) $(BOOTIMAGE) $(TOPDIR)/System.map "$(INSTALL_PATH)"
tools/build: tools/build.c
$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
bootsect: bootsect.o
$(IA32_LD) -Ttext 0x0 -s --oformat binary -o $@ $<
bootsect.o: bootsect.s
$(IA32_AS) -o $@ $<
bootsect.s: bootsect.S Makefile $(BOOT_INCL)
$(IA32_CPP) $(CPPFLAGS) -traditional -D__ASSEMBLY__ $(SVGA_MODE) $(RAMDISK) $< -o $@
bbootsect: bbootsect.o
$(IA32_LD) -Ttext 0x0 -s --oformat binary $< -o $@
bbootsect.o: bbootsect.s
$(IA32_AS) -o $@ $<
bbootsect.s: bootsect.S Makefile $(BOOT_INCL)
$(IA32_CPP) $(CPPFLAGS) -D__BIG_KERNEL__ -D__ASSEMBLY__ -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@
setup: setup.o
$(IA32_LD) -Ttext 0x0 -s --oformat binary -e begtext -o $@ $<
setup.o: setup.s
$(IA32_AS) -o $@ $<
setup.s: setup.S video.S Makefile $(BOOT_INCL) $(TOPDIR)/include/linux/version.h $(TOPDIR)/include/linux/compile.h
$(IA32_CPP) $(CPPFLAGS) -traditional -D__ASSEMBLY__ $(SVGA_MODE) $(RAMDISK) $< -o $@
bsetup: bsetup.o
$(IA32_LD) -Ttext 0x0 -s --oformat binary -e begtext -o $@ $<
bsetup.o: bsetup.s
$(IA32_AS) -o $@ $<
bsetup.s: setup.S video.S Makefile $(BOOT_INCL) $(TOPDIR)/include/linux/version.h $(TOPDIR)/include/linux/compile.h
$(IA32_CPP) $(CPPFLAGS) -D__BIG_KERNEL__ -D__ASSEMBLY__ -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@
dep:
clean:
rm -f tools/build
rm -f setup bootsect zImage compressed/vmlinux.out
rm -f bsetup bbootsect bzImage compressed/bvmlinux.out
@$(MAKE) -C compressed clean
This diff is collapsed.
#
# linux/arch/i386/boot/compressed/Makefile
#
# create a compressed vmlinux image from the original vmlinux
#
HEAD = head.o
SYSTEM = $(TOPDIR)/vmlinux
OBJECTS = $(HEAD) misc.o
IA32_CFLAGS := -O2 -DSTDC_HEADERS
#
# ZIMAGE_OFFSET is the load offset of the compression loader
# BZIMAGE_OFFSET is the load offset of the high loaded compression loader
#
BZIMAGE_OFFSET = 0x100000
BZLINKFLAGS = -Ttext $(BZIMAGE_OFFSET) $(ZLDFLAGS)
all: vmlinux
bvmlinux: piggy.o $(OBJECTS)
$(IA32_LD) $(BZLINKFLAGS) -o bvmlinux $(OBJECTS) piggy.o
head.o: head.S
$(IA32_AS) -c head.S
misc.o: misc.c
$(IA32_CC) $(IA32_CFLAGS) -c misc.c
piggy.o: $(SYSTEM)
tmppiggy=_tmp_$$$$piggy; \
rm -f $$tmppiggy $$tmppiggy.gz $$tmppiggy.lnk; \
$(OBJCOPY) $(SYSTEM) $$tmppiggy; \
gzip -f -9 < $$tmppiggy > $$tmppiggy.gz; \
echo "SECTIONS { .data : { input_len = .; LONG(input_data_end - input_data) input_data = .; *(.data) input_data_end = .; }}" > $$tmppiggy.lnk; \
$(IA32_LD) -r -o piggy.o -b binary $$tmppiggy.gz -b elf32-i386 -T $$tmppiggy.lnk; \
rm -f $$tmppiggy $$tmppiggy.gz $$tmppiggy.lnk
clean:
rm -f vmlinux bvmlinux _tmp_*
/*
* linux/boot/head.S
*
* Copyright (C) 1991, 1992, 1993 Linus Torvalds
*
* $Id: head.S,v 1.3 2001/04/20 00:59:28 ak Exp $
*/
/*
* head.S contains the 32-bit startup code.
*
* NOTE!!! Startup happens at absolute address 0x00001000, which is also where
* the page directory will exist. The startup code will be overwritten by
* the page directory. [According to comments etc elsewhere on a compressed
* kernel it will end up at 0x1000 + 1Mb I hope so as I assume this. - AC]
*
* Page 0 is deliberately kept safe, since System Management Mode code in
* laptops may need to access the BIOS data stored there. This is also
* useful for future device drivers that either access the BIOS via VM86
* mode.
*/
/*
* High loaded stuff by Hans Lermen & Werner Almesberger, Feb. 1996
*/
.code32
.text
#include <linux/linkage.h>
#include <asm/segment.h>
.code32
.globl startup_32
startup_32:
cld
cli
movl $(__KERNEL_DS),%eax
movl %eax,%ds
movl %eax,%es
movl %eax,%fs
movl %eax,%gs
lss SYMBOL_NAME(stack_start),%esp
xorl %eax,%eax
1: incl %eax # check that A20 really IS enabled
movl %eax,0x000000 # loop forever if it isn't
cmpl %eax,0x100000
je 1b
/*
* Initialize eflags. Some BIOS's leave bits like NT set. This would
* confuse the debugger if this code is traced.
* XXX - best to initialize before switching to protected mode.
*/
pushl $0
popfl
/*
* Clear BSS
*/
xorl %eax,%eax
movl $ SYMBOL_NAME(_edata),%edi
movl $ SYMBOL_NAME(_end),%ecx
subl %edi,%ecx
cld
rep
stosb
/*
* Do the decompression, and jump to the new kernel..
*/
subl $16,%esp # place for structure on the stack
movl %esp,%eax
pushl %esi # real mode pointer as second arg
pushl %eax # address of structure as first arg
call SYMBOL_NAME(decompress_kernel)
orl %eax,%eax
jnz 3f
addl $8,%esp
xorl %ebx,%ebx
ljmp $(__KERNEL_CS), $0x100000
/*
* We come here, if we were loaded high.
* We need to move the move-in-place routine down to 0x1000
* and then start it with the buffer addresses in registers,
* which we got from the stack.
*/
3:
movl %esi,%ebx
movl $move_routine_start,%esi
movl $0x1000,%edi
movl $move_routine_end,%ecx
subl %esi,%ecx
addl $3,%ecx
shrl $2,%ecx
cld
rep
movsl
popl %esi # discard the address
addl $4,%esp # real mode pointer
popl %esi # low_buffer_start
popl %ecx # lcount
popl %edx # high_buffer_start
popl %eax # hcount
movl $0x100000,%edi
cli # make sure we don't get interrupted
ljmp $(__KERNEL_CS), $0x1000 # and jump to the move routine
/*
* Routine (template) for moving the decompressed kernel in place,
* if we were high loaded. This _must_ PIC-code !
*/
move_routine_start:
movl %ecx,%ebp
shrl $2,%ecx
rep
movsl
movl %ebp,%ecx
andl $3,%ecx
rep
movsb
movl %edx,%esi
movl %eax,%ecx # NOTE: rep movsb won't move if %ecx == 0
addl $3,%ecx
shrl $2,%ecx
rep
movsl
movl %ebx,%esi # Restore setup pointer
xorl %ebx,%ebx
ljmp $(__KERNEL_CS), $0x100000
move_routine_end:
/* Stack for uncompression */
.align 32
user_stack:
.fill 4096,4,0
stack_start:
.long user_stack+4096
.word __KERNEL_DS
This diff is collapsed.
#define NULL 0
typedef unsigned int size_t;
struct screen_info {
unsigned char orig_x; /* 0x00 */
unsigned char orig_y; /* 0x01 */
unsigned short dontuse1; /* 0x02 -- EXT_MEM_K sits here */
unsigned short orig_video_page; /* 0x04 */
unsigned char orig_video_mode; /* 0x06 */
unsigned char orig_video_cols; /* 0x07 */
unsigned short unused2; /* 0x08 */
unsigned short orig_video_ega_bx; /* 0x0a */
unsigned short unused3; /* 0x0c */
unsigned char orig_video_lines; /* 0x0e */
unsigned char orig_video_isVGA; /* 0x0f */
unsigned short orig_video_points; /* 0x10 */
/* VESA graphic mode -- linear frame buffer */
unsigned short lfb_width; /* 0x12 */
unsigned short lfb_height; /* 0x14 */
unsigned short lfb_depth; /* 0x16 */
unsigned long lfb_base; /* 0x18 */
unsigned long lfb_size; /* 0x1c */
unsigned short dontuse2, dontuse3; /* 0x20 -- CL_MAGIC and CL_OFFSET here */
unsigned short lfb_linelength; /* 0x24 */
unsigned char red_size; /* 0x26 */
unsigned char red_pos; /* 0x27 */
unsigned char green_size; /* 0x28 */
unsigned char green_pos; /* 0x29 */
unsigned char blue_size; /* 0x2a */
unsigned char blue_pos; /* 0x2b */
unsigned char rsvd_size; /* 0x2c */
unsigned char rsvd_pos; /* 0x2d */
unsigned short vesapm_seg; /* 0x2e */
unsigned short vesapm_off; /* 0x30 */
unsigned short pages; /* 0x32 */
/* 0x34 -- 0x3f reserved for future expansion */
};
#!/bin/sh
#
# arch/i386/boot/install.sh
#
# This file is subject to the terms and conditions of the GNU General Public
# License. See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 1995 by Linus Torvalds
#
# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin
#
# "make install" script for i386 architecture
#
# Arguments:
# $1 - kernel version
# $2 - kernel image file
# $3 - kernel map file
# $4 - default install path (blank if root directory)
#
# User may have a custom install script
if [ -x /sbin/installkernel ]; then exec /sbin/installkernel "$@"; fi
# Default install - same as make zlilo
if [ -f $4/vmlinuz ]; then
mv $4/vmlinuz $4/vmlinuz.old
fi
if [ -f $4/System.map ]; then
mv $4/System.map $4/System.old
fi
cat $2 > $4/vmlinuz
cp $3 $4/System.map
if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
This diff is collapsed.
/*
* $Id: build.c,v 1.3 2001/06/26 15:14:50 pavel Exp $
*
* Copyright (C) 1991, 1992 Linus Torvalds
* Copyright (C) 1997 Martin Mares
*/
/*
* This file builds a disk-image from three different files:
*
* - bootsect: exactly 512 bytes of 8086 machine code, loads the rest
* - setup: 8086 machine code, sets up system parm
* - system: 80386 code for actual system
*
* It does some checking that all files are of the correct type, and
* just writes the result to stdout, removing headers and padding to
* the right amount. It also writes some system data to stderr.
*/
/*
* Changes by tytso to allow root device specification
* High loaded stuff by Hans Lermen & Werner Almesberger, Feb. 1996
* Cross compiling fixes by Gertjan van Wingerde, July 1996
* Rewritten by Martin Mares, April 1997
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/sysmacros.h>
#include <unistd.h>
#include <fcntl.h>
#include <asm/boot.h>
typedef unsigned char byte;
typedef unsigned short word;
typedef unsigned long u32;
#define DEFAULT_MAJOR_ROOT 0
#define DEFAULT_MINOR_ROOT 0
/* Minimal number of setup sectors (see also bootsect.S) */
#define SETUP_SECTS 4
byte buf[1024];
int fd;
int is_big_kernel;
void die(const char * str, ...)
{
va_list args;
va_start(args, str);
vfprintf(stderr, str, args);
fputc('\n', stderr);
exit(1);
}
void file_open(const char *name)
{
if ((fd = open(name, O_RDONLY, 0)) < 0)
die("Unable to open `%s': %m", name);
}
void usage(void)
{
die("Usage: build [-b] bootsect setup system [rootdev] [> image]");
}
int main(int argc, char ** argv)
{
unsigned int i, c, sz, setup_sectors;
u32 sys_size;
byte major_root, minor_root;
struct stat sb;
if (argc > 2 && !strcmp(argv[1], "-b"))
{
is_big_kernel = 1;
argc--, argv++;
}
if ((argc < 4) || (argc > 5))
usage();
if (argc > 4) {
if (!strcmp(argv[4], "CURRENT")) {
if (stat("/", &sb)) {
perror("/");
die("Couldn't stat /");
}
major_root = major(sb.st_dev);
minor_root = minor(sb.st_dev);
} else if (strcmp(argv[4], "FLOPPY")) {
if (stat(argv[4], &sb)) {
perror(argv[4]);
die("Couldn't stat root device.");
}
major_root = major(sb.st_rdev);
minor_root = minor(sb.st_rdev);
} else {
major_root = 0;
minor_root = 0;
}
} else {
major_root = DEFAULT_MAJOR_ROOT;
minor_root = DEFAULT_MINOR_ROOT;
}
fprintf(stderr, "Root device is (%d, %d)\n", major_root, minor_root);
file_open(argv[1]);
i = read(fd, buf, sizeof(buf));
fprintf(stderr,"Boot sector %d bytes.\n",i);
if (i != 512)
die("Boot block must be exactly 512 bytes");
if (buf[510] != 0x55 || buf[511] != 0xaa)
die("Boot block hasn't got boot flag (0xAA55)");
buf[508] = minor_root;
buf[509] = major_root;
if (write(1, buf, 512) != 512)
die("Write call failed");
close (fd);
file_open(argv[2]); /* Copy the setup code */
for (i=0 ; (c=read(fd, buf, sizeof(buf)))>0 ; i+=c )
if (write(1, buf, c) != c)
die("Write call failed");
if (c != 0)
die("read-error on `setup'");
close (fd);
setup_sectors = (i + 511) / 512; /* Pad unused space with zeros */
/* for compatibility with ancient versions of LILO. */
if (setup_sectors < SETUP_SECTS)
setup_sectors = SETUP_SECTS;
fprintf(stderr, "Setup is %d bytes.\n", i);
memset(buf, 0, sizeof(buf));
while (i < setup_sectors * 512) {
c = setup_sectors * 512 - i;
if (c > sizeof(buf))
c = sizeof(buf);
if (write(1, buf, c) != c)
die("Write call failed");
i += c;
}
file_open(argv[3]);
if (fstat (fd, &sb))
die("Unable to stat `%s': %m", argv[3]);
sz = sb.st_size;
fprintf (stderr, "System is %d kB\n", sz/1024);
sys_size = (sz + 15) / 16;
/* 0x28000*16 = 2.5 MB, conservative estimate for the current maximum */
if (sys_size > (is_big_kernel ? 0x28000 : DEF_SYSSIZE))
die("System is too big. Try using %smodules.",
is_big_kernel ? "" : "bzImage or ");
if (sys_size > 0xefff)
fprintf(stderr,"warning: kernel is too big for standalone boot "
"from floppy\n");
while (sz > 0) {
int l, n;
l = (sz > sizeof(buf)) ? sizeof(buf) : sz;
if ((n=read(fd, buf, l)) != l) {
if (n < 0)
die("Error reading %s: %m", argv[3]);
else
die("%s: Unexpected EOF", argv[3]);
}
if (write(1, buf, l) != l)
die("Write failed");
sz -= l;
}
close(fd);
if (lseek(1, 497, SEEK_SET) != 497) /* Write sizes to the bootsector */
die("Output: seek failed");
buf[0] = setup_sectors;
if (write(1, buf, 1) != 1)
die("Write of setup sector count failed");
if (lseek(1, 500, SEEK_SET) != 500)
die("Output: seek failed");
buf[0] = (sys_size & 0xff);
buf[1] = ((sys_size >> 8) & 0xff);
if (write(1, buf, 2) != 2)
die("Write of image length failed");
return 0; /* Everything is OK */
}
This diff is collapsed.
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/config-language.txt.
#
mainmenu_name "Linux Kernel Configuration"
define_bool CONFIG_X86_64 y
define_bool CONFIG_X86 y
define_bool CONFIG_ISA y
define_bool CONFIG_SBUS n
define_bool CONFIG_UID16 y
define_bool CONFIG_RWSEM_GENERIC_SPINLOCK n
define_bool CONFIG_RWSEM_XCHGADD_ALGORITHM y
source init/Config.in
mainmenu_option next_comment
comment 'Processor type and features'
choice 'Processor family' \
"Clawhammer CONFIG_MK8" Clawhammer
#
# Define implied options from the CPU selection here
#
define_int CONFIG_X86_L1_CACHE_BYTES 64
define_int CONFIG_X86_L1_CACHE_SHIFT 6
define_bool CONFIG_X86_TSC y
define_bool CONFIG_X86_GOOD_APIC y
define_bool CONFIG_X86_CMPXCHG
tristate '/dev/cpu/*/msr - Model-specific register support' CONFIG_X86_MSR
tristate '/dev/cpu/*/cpuid - CPU information support' CONFIG_X86_CPUID
define_bool CONFIG_MATH_EMULATION n
define_bool CONFIG_MCA n
define_bool CONFIG_EISA n
bool 'MTRR (Memory Type Range Register) support' CONFIG_MTRR
bool 'Symmetric multi-processing support' CONFIG_SMP
bool 'Preemptible Kernel' CONFIG_PREEMPT
# currently doesn't boot without hacks. probably simulator bug.
#if [ "$CONFIG_SMP" != "y" ]; then
# bool 'APIC and IO-APIC support on uniprocessors' CONFIG_X86_UP_IOAPIC
# if [ "$CONFIG_X86_UP_IOAPIC" = "y" ]; then
# define_bool CONFIG_X86_IO_APIC y
# define_bool CONFIG_X86_LOCAL_APIC y
# fi
#fi
if [ "$CONFIG_SMP" = "y" -a "$CONFIG_X86_CMPXCHG" = "y" ]; then
define_bool CONFIG_HAVE_DEC_LOCK y
fi
endmenu
mainmenu_option next_comment
comment 'General options'
if [ "$CONFIG_SMP" = "y" ]; then
define_bool CONFIG_X86_IO_APIC y
define_bool CONFIG_X86_LOCAL_APIC y
fi
bool 'PCI support' CONFIG_PCI
if [ "$CONFIG_PCI" = "y" ]; then
define_bool CONFIG_PCI_DIRECT y
fi
source drivers/pci/Config.in
bool 'Support for hot-pluggable devices' CONFIG_HOTPLUG
if [ "$CONFIG_HOTPLUG" = "y" ] ; then
source drivers/pcmcia/Config.in
else
define_bool CONFIG_PCMCIA n
fi
if [ "$CONFIG_PROC_FS" = "y" ]; then
define_bool CONFIG_KCORE_ELF y
fi
# We probably are not going to support a.out, are we? Or should we support a.out in i386 compatibility mode?
#tristate 'Kernel support for a.out binaries' CONFIG_BINFMT_AOUT
tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
bool 'Power Management support' CONFIG_PM
bool 'IA32 Emulation' CONFIG_IA32_EMULATION
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
dep_bool ' ACPI support' CONFIG_ACPI $CONFIG_PM
if [ "$CONFIG_ACPI" != "n" ]; then
source drivers/acpi/Config.in
fi
fi
endmenu
source drivers/mtd/Config.in
source drivers/parport/Config.in
source drivers/pnp/Config.in
source drivers/block/Config.in
source drivers/md/Config.in
if [ "$CONFIG_NET" = "y" ]; then
source net/Config.in
fi
source drivers/telephony/Config.in
mainmenu_option next_comment
comment 'ATA/IDE/MFM/RLL support'
tristate 'ATA/IDE/MFM/RLL support' CONFIG_IDE
if [ "$CONFIG_IDE" != "n" ]; then
source drivers/ide/Config.in
else
define_bool CONFIG_BLK_DEV_IDE_MODES n
define_bool CONFIG_BLK_DEV_HD n
fi
endmenu
mainmenu_option next_comment
comment 'SCSI support'
tristate 'SCSI support' CONFIG_SCSI
if [ "$CONFIG_SCSI" != "n" ]; then
source drivers/scsi/Config.in
fi
endmenu
source drivers/message/fusion/Config.in
source drivers/ieee1394/Config.in
#Currently not 64bit safe
#source drivers/message/i2o/Config.in
if [ "$CONFIG_NET" = "y" ]; then
mainmenu_option next_comment
comment 'Network device support'
bool 'Network device support' CONFIG_NETDEVICES
if [ "$CONFIG_NETDEVICES" = "y" ]; then
source drivers/net/Config.in
if [ "$CONFIG_ATM" = "y" ]; then
source drivers/atm/Config.in
fi
fi
endmenu
fi
source net/ax25/Config.in
source net/irda/Config.in
mainmenu_option next_comment
comment 'ISDN subsystem'
if [ "$CONFIG_NET" != "n" ]; then
tristate 'ISDN support' CONFIG_ISDN
if [ "$CONFIG_ISDN" != "n" ]; then
source drivers/isdn/Config.in
fi
fi
endmenu
mainmenu_option next_comment
comment 'Old CD-ROM drivers (not SCSI, not IDE)'
bool 'Support non-SCSI/IDE/ATAPI CDROM drives' CONFIG_CD_NO_IDESCSI
if [ "$CONFIG_CD_NO_IDESCSI" != "n" ]; then
source drivers/cdrom/Config.in
fi
endmenu
#
# input before char - char/joystick depends on it. As does USB.
#
source drivers/input/Config.in
source drivers/char/Config.in
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
source net/bluetooth/Config.in
fi
source drivers/misc/Config.in
source drivers/media/Config.in
source fs/Config.in
if [ "$CONFIG_VT" = "y" ]; then
mainmenu_option next_comment
comment 'Console drivers'
bool 'VGA text console' CONFIG_VGA_CONSOLE
bool 'Video mode selection support' CONFIG_VIDEO_SELECT
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
tristate 'MDA text console (dual-headed) (EXPERIMENTAL)' CONFIG_MDA_CONSOLE
source drivers/video/Config.in
fi
endmenu
fi
mainmenu_option next_comment
comment 'Sound'
tristate 'Sound card support' CONFIG_SOUND
if [ "$CONFIG_SOUND" != "n" ]; then
source drivers/sound/Config.in
fi
endmenu
source drivers/usb/Config.in
mainmenu_option next_comment
comment 'Kernel hacking'
bool 'Kernel debugging' CONFIG_DEBUG_KERNEL
if [ "$CONFIG_DEBUG_KERNEL" != "n" ]; then
bool ' Debug memory allocations' CONFIG_DEBUG_SLAB
# bool ' Memory mapped I/O debugging' CONFIG_DEBUG_IOVIRT
bool ' Magic SysRq key' CONFIG_MAGIC_SYSRQ
bool ' Spinlock debugging' CONFIG_DEBUG_SPINLOCK
# bool ' Early printk' CONFIG_EARLY_PRINTK
bool ' Additional run-time checks' CONFIG_CHECKING
fi
bool 'Simnow environment (disables time-consuming things)' CONFIG_SIMNOW
#if [ "$CONFIG_SERIAL_CONSOLE" = "y" ]; then
# bool 'Early serial console (ttyS0)' CONFIG_EARLY_SERIAL_CONSOLE
#fi
endmenu
source lib/Config.in
This diff is collapsed.
#
# Makefile for the ia32 kernel emulation subsystem.
#
.S.s:
$(CPP) $(AFLAGS) -o $*.s $<
.S.o:
$(CC) $(AFLAGS) -c -o $*.o $<
all: ia32.o
O_TARGET := ia32.o
obj-$(CONFIG_IA32_EMULATION) := ia32entry.o sys_ia32.o ia32_ioctl.o ia32_signal.o ia32_binfmt.o \
socket32.o ptrace32.o
clean::
include $(TOPDIR)/Rules.make
/*
* Written 2000 by Andi Kleen.
*
* Losely based on the sparc64 and IA64 32bit emulation loaders.
*/
#include <linux/types.h>
#include <linux/config.h>
#include <linux/stddef.h>
#include <linux/module.h>
#include <linux/rwsem.h>
#include <asm/segment.h>
#include <asm/ptrace.h>
#include <asm/processor.h>
#define IA32_EMULATOR 1
#define IA32_PAGE_OFFSET 0xE0000000
#define IA32_STACK_TOP IA32_PAGE_OFFSET
#define ELF_ET_DYN_BASE (IA32_PAGE_OFFSET/3 + 0x1000000)
#undef ELF_ARCH
#define ELF_ARCH EM_386
#undef ELF_CLASS
#define ELF_CLASS ELFCLASS32
#define ELF_DATA ELFDATA2LSB
//#define USE_ELF_CORE_DUMP
#define __ASM_X86_64_ELF_H 1
#include <asm/ia32.h>
#include <linux/elf.h>
typedef __u32 elf_greg_t;
typedef elf_greg_t elf_gregset_t[8];
/* FIXME -- wrong */
typedef struct user_i387_ia32_struct elf_fpregset_t;
typedef struct user_i387_struct elf_fpxregset_t;
#undef elf_check_arch
#define elf_check_arch(x) \
((x)->e_machine == EM_386)
#define ELF_EXEC_PAGESIZE PAGE_SIZE
#define ELF_HWCAP (boot_cpu_data.x86_capability[0])
#define ELF_PLATFORM ("i686")
#define SET_PERSONALITY(ex, ibcs2) \
do { \
set_personality((ibcs2)?PER_SVR4:current->personality); \
} while (0)
/* Override some function names */
#define elf_format elf32_format
#define init_elf_binfmt init_elf32_binfmt
#define exit_elf_binfmt exit_elf32_binfmt
#define load_elf_binary load_elf32_binary
#undef CONFIG_BINFMT_ELF
#ifdef CONFIG_BINFMT_ELF32
# define CONFIG_BINFMT_ELF CONFIG_BINFMT_ELF32
#endif
#undef CONFIG_BINFMT_ELF_MODULE
#ifdef CONFIG_BINFMT_ELF32_MODULE
# define CONFIG_BINFMT_ELF_MODULE CONFIG_BINFMT_ELF32_MODULE
#endif
#define ELF_PLAT_INIT(r) elf32_init(r)
#define setup_arg_pages(bprm) ia32_setup_arg_pages(bprm)
#undef start_thread
#define start_thread(regs,new_rip,new_rsp) do { \
__asm__("movl %0,%%fs": :"r" (0)); \
__asm__("movl %0,%%es; movl %0,%%ds": :"r" (__USER32_DS)); \
wrmsrl(MSR_KERNEL_GS_BASE, 0); \
set_thread_flag(TIF_IA32); \
(regs)->rip = (new_rip); \
(regs)->rsp = (new_rsp); \
(regs)->eflags = 0x200; \
(regs)->cs = __USER32_CS; \
(regs)->ss = __USER32_DS; \
set_fs(USER_DS); \
} while(0)
MODULE_DESCRIPTION("Binary format loader for compatibility with IA32 ELF binaries.");
MODULE_AUTHOR("Eric Youngdale, Andi Kleen");
#undef MODULE_DESCRIPTION
#undef MODULE_AUTHOR
#define elf_addr_t __u32
#define elf_caddr_t __u32
static void elf32_init(struct pt_regs *);
#include "../../../fs/binfmt_elf.c"
static void elf32_init(struct pt_regs *regs)
{
regs->rdi = 0;
regs->rsi = 0;
regs->rdx = 0;
regs->rcx = 0;
regs->rax = 0;
regs->rbx = 0;
regs->rbp = 0;
current->thread.fs = 0; current->thread.gs = 0;
current->thread.fsindex = 0; current->thread.gsindex = 0;
current->thread.ds = __USER_DS; current->thread.es == __USER_DS;
}
extern void put_dirty_page(struct task_struct * tsk, struct page *page, unsigned long address);
int ia32_setup_arg_pages(struct linux_binprm *bprm)
{
unsigned long stack_base;
struct vm_area_struct *mpnt;
int i;
stack_base = IA32_STACK_TOP - MAX_ARG_PAGES*PAGE_SIZE;
bprm->p += stack_base;
if (bprm->loader)
bprm->loader += stack_base;
bprm->exec += stack_base;
mpnt = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
if (!mpnt)
return -ENOMEM;
down_write(&current->mm->mmap_sem);
{
mpnt->vm_mm = current->mm;
mpnt->vm_start = PAGE_MASK & (unsigned long) bprm->p;
mpnt->vm_end = IA32_STACK_TOP;
mpnt->vm_page_prot = PAGE_COPY;
mpnt->vm_flags = VM_STACK_FLAGS;
mpnt->vm_ops = NULL;
mpnt->vm_pgoff = 0;
mpnt->vm_file = NULL;
mpnt->vm_private_data = (void *) 0;
insert_vm_struct(current->mm, mpnt);
current->mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT;
}
for (i = 0 ; i < MAX_ARG_PAGES ; i++) {
struct page *page = bprm->page[i];
if (page) {
bprm->page[i] = NULL;
current->mm->rss++;
put_dirty_page(current,page,stack_base);
}
stack_base += PAGE_SIZE;
}
up_write(&current->mm->mmap_sem);
return 0;
}
This diff is collapsed.
This diff is collapsed.
/*
* Compatibility mode system call entry point for x86-64.
*
* Copyright 2000,2001,2002 Andi Kleen, SuSE Labs.
*
* $Id: ia32entry.S,v 1.24 2001/11/11 17:47:47 ak Exp $
*/
#include <asm/calling.h>
#include <asm/offset.h>
#include <asm/thread_info.h>
#include <linux/linkage.h>
#include <asm/errno.h>
#include <asm/ia32_unistd.h>
.macro IA32_ARG_FIXUP
movl %edi,%r8d
movl %ebp,%r9d
xchg %ecx,%esi
movl %ebx,%edi
movl %edx,%edx /* zero extension */
.endm
/*
* 32bit SYSCALL instruction entry.
* It'll probably kill you because it destroys your segments.
* Should coredump here, but the next instruction will likely do
* that anyways.
*/
ENTRY(ia32_cstar_target)
movq $-ENOSYS,%rax
SYSRET32
/*
* Emulated IA32 system calls via int 0x80.
*
* Arguments:
* %eax System call number.
* %ebx Arg1
* %ecx Arg2
* %edx Arg3
* %esi Arg4
* %edi Arg5
* %ebp Arg6 [note: not saved in the stack frame, should not be touched]
*
* Notes:
* Uses the same stack frame as the x86-64 version.
* All registers except %eax must be saved (but ptrace may violate that)
* Arguments are zero extended. For system calls that want sign extension and
* take long arguments a wrapper is needed. Most calls can just be called
* directly.
* Assumes it is only called from user space and entered with interrups off.
*/
ENTRY(ia32_syscall)
swapgs
sti
pushq %rax
cld
SAVE_ARGS
GET_THREAD_INFO(%r10)
bt $TIF_SYSCALL_TRACE,threadinfo_flags(%r10)
jc ia32_tracesys
ia32_do_syscall:
cmpl $(IA32_NR_syscalls),%eax
jae ia32_badsys
IA32_ARG_FIXUP
movl $1,%r10d
call *ia32_sys_call_table(,%rax,8) # xxx: rip relative
movq %rax,RAX-ARGOFFSET(%rsp)
jmp int_ret_from_sys_call
ia32_tracesys:
SAVE_REST
movq $-ENOSYS,RAX(%rsp) /* really needed? */
movq %rsp,%rdi /* &pt_regs -> arg1 */
call syscall_trace
LOAD_ARGS ARGOFFSET /* reload args from stack in case ptrace changed it */
RESTORE_REST
jmp ia32_do_syscall
ia32_badsys:
movq $-ENOSYS,RAX-ARGOFFSET(%rsp)
jmp int_ret_from_sys_call
ni_syscall:
movq %rax,%rdi
jmp sys32_ni_syscall
.macro PTREGSCALL label, func
.globl \label
\label:
leaq \func(%rip),%rax
jmp ia32_ptregs_common
.endm
PTREGSCALL stub32_rt_sigreturn, sys32_rt_sigreturn
PTREGSCALL stub32_sigreturn, sys32_sigreturn
PTREGSCALL stub32_sigaltstack, sys32_sigaltstack
PTREGSCALL stub32_sigsuspend, sys32_sigsuspend
PTREGSCALL stub32_execve, sys32_execve
PTREGSCALL stub32_fork, sys32_fork
PTREGSCALL stub32_clone, sys32_clone
PTREGSCALL stub32_vfork, sys32_vfork
PTREGSCALL stub32_iopl, sys_iopl
PTREGSCALL stub32_rt_sigsuspend, sys_rt_sigsuspend
ENTRY(ia32_ptregs_common)
popq %r11 /* save return address outside the stack frame. */
SAVE_REST
movq %r11, %r15
call *%rax
movq %r15, %r11
RESTORE_REST
pushq %r11
ret
.data
.align 8
ia32_sys_call_table:
.quad ni_syscall /* 0 - old "setup" system call*/
.quad sys_exit
.quad stub32_fork
.quad sys_read
.quad sys_write
.quad sys_open /* 5 */
.quad sys_close
.quad sys32_waitpid
.quad sys_creat
.quad sys_link
.quad sys_unlink /* 10 */
.quad stub32_execve
.quad sys_chdir
.quad sys32_time
.quad sys_mknod
.quad sys_chmod /* 15 */
.quad sys_lchown16
.quad ni_syscall /* old break syscall holder */
.quad ni_syscall /* (old)stat */
.quad sys32_lseek
.quad sys_getpid /* 20 */
.quad sys_mount /* mount */
.quad sys_oldumount /* old_umount */
.quad sys_setuid16
.quad sys_getuid16
.quad ni_syscall /* stime */ /* 25 */
.quad sys32_ptrace /* ptrace */
.quad sys_alarm /* XXX sign extension??? */
.quad ni_syscall /* (old)fstat */
.quad sys_pause
.quad sys32_utime /* 30 */
.quad ni_syscall /* old stty syscall holder */
.quad ni_syscall /* old gtty syscall holder */
.quad sys_access
.quad sys_nice
.quad ni_syscall /* 35 */ /* old ftime syscall holder */
.quad sys_sync
.quad sys32_kill
.quad sys_rename
.quad sys_mkdir
.quad sys_rmdir /* 40 */
.quad sys_dup
.quad sys32_pipe
.quad sys32_times
.quad ni_syscall /* old prof syscall holder */
.quad sys_brk /* 45 */
.quad sys_setgid16
.quad sys_getgid16
.quad ni_syscall /* signal */
.quad sys_geteuid16
.quad sys_getegid16 /* 50 */
.quad sys_acct
.quad sys_umount /* new_umount */
.quad ni_syscall /* old lock syscall holder */
.quad sys32_ioctl
.quad sys32_fcntl /* 55 */
.quad ni_syscall /* old mpx syscall holder */
.quad sys_setpgid
.quad ni_syscall /* old ulimit syscall holder */
.quad sys32_olduname
.quad sys_umask /* 60 */
.quad sys_chroot
.quad sys32_ustat
.quad sys_dup2
.quad sys_getppid
.quad sys_getpgrp /* 65 */
.quad sys_setsid
.quad sys32_sigaction
.quad sys_sgetmask
.quad sys_ssetmask
.quad sys_setreuid16 /* 70 */
.quad sys_setregid16
.quad stub32_sigsuspend
.quad sys32_sigpending
.quad sys_sethostname
.quad sys32_setrlimit /* 75 */
.quad sys32_old_getrlimit /* old_getrlimit */
.quad sys32_getrusage
.quad sys32_gettimeofday
.quad sys32_settimeofday
.quad sys_getgroups16 /* 80 */
.quad sys_setgroups16
.quad sys32_old_select
.quad sys_symlink
.quad ni_syscall /* (old)lstat */
.quad sys_readlink /* 85 */
.quad sys_uselib
.quad sys_swapon
.quad sys_reboot
.quad sys32_oldreaddir
.quad sys32_mmap /* 90 */
.quad sys_munmap
.quad sys_truncate
.quad sys_ftruncate
.quad sys_fchmod
.quad sys_fchown16 /* 95 */
.quad sys_getpriority
.quad sys_setpriority
.quad ni_syscall /* old profil syscall holder */
.quad sys32_statfs
.quad sys32_fstatfs /* 100 */
.quad sys_ioperm
.quad sys32_socketcall
.quad sys_syslog
.quad sys32_setitimer
.quad sys32_getitimer /* 105 */
.quad sys32_newstat
.quad sys32_newlstat
.quad sys32_newfstat
.quad sys32_uname
.quad stub32_iopl /* 110 */
.quad sys_vhangup
.quad ni_syscall /* old "idle" system call */
.quad ni_syscall /* vm86old */
.quad sys32_wait4
.quad sys_swapoff /* 115 */
.quad sys32_sysinfo
.quad sys32_ipc
.quad sys_fsync
.quad stub32_sigreturn
.quad stub32_clone /* 120 */
.quad sys_setdomainname
.quad sys_newuname
.quad ni_syscall /* modify_ldt */
.quad sys32_adjtimex
.quad sys_mprotect /* 125 */
.quad sys32_sigprocmask
.quad ni_syscall /* query_module */
.quad ni_syscall /* init_module */
.quad ni_syscall /* delete module */
.quad ni_syscall /* 130 get_kernel_syms */
.quad ni_syscall /* quotactl */
.quad sys_getpgid
.quad sys_fchdir
.quad ni_syscall /* bdflush */
.quad sys_sysfs /* 135 */
.quad sys_personality
.quad ni_syscall /* for afs_syscall */
.quad sys_setfsuid16
.quad sys_setfsgid16
.quad sys_llseek /* 140 */
.quad sys32_getdents
.quad sys32_select
.quad sys_flock
.quad sys_msync
.quad sys32_readv /* 145 */
.quad sys32_writev
.quad sys_getsid
.quad sys_fdatasync
.quad sys32_sysctl /* sysctl */
.quad sys_mlock /* 150 */
.quad sys_munlock
.quad sys_mlockall
.quad sys_munlockall
.quad sys_sched_setparam
.quad sys_sched_getparam /* 155 */
.quad sys_sched_setscheduler
.quad sys_sched_getscheduler
.quad sys_sched_yield
.quad sys_sched_get_priority_max
.quad sys_sched_get_priority_min /* 160 */
.quad sys_sched_rr_get_interval
.quad sys32_nanosleep
.quad sys_mremap
.quad sys_setresuid16
.quad sys_getresuid16 /* 165 */
.quad ni_syscall /* vm86 */
.quad ni_syscall /* query_module */
.quad sys_poll
.quad ni_syscall /* nfsserverctl */
.quad sys_setresgid16 /* 170 */
.quad sys_getresgid16
.quad sys_prctl
.quad stub32_rt_sigreturn
.quad sys32_rt_sigaction
.quad sys32_rt_sigprocmask /* 175 */
.quad sys32_rt_sigpending
.quad sys32_rt_sigtimedwait
.quad sys32_rt_sigqueueinfo
.quad stub32_rt_sigsuspend
.quad sys32_pread /* 180 */
.quad sys32_pwrite
.quad sys_chown16
.quad sys_getcwd
.quad ni_syscall /* capget */
.quad ni_syscall /* capset */
.quad stub32_sigaltstack
.quad sys32_sendfile
.quad ni_syscall /* streams1 */
.quad ni_syscall /* streams2 */
.quad stub32_vfork /* 190 */
.quad sys32_getrlimit
.quad sys32_mmap2
.quad sys_truncate
.quad sys_ftruncate
.quad sys32_stat64 /* 195 */
.quad sys32_lstat64
.quad sys32_fstat64
.quad sys_lchown
.quad sys_getuid
.quad sys_getgid /* 200 */
.quad sys_geteuid
.quad sys_getegid
.quad sys32_setreuid
.quad sys32_setregid
.quad sys32_getgroups /* 205 */
.quad sys32_setgroups
.quad sys_fchown
.quad sys32_setresuid
.quad sys32_getresuid
.quad sys32_setresgid /* 210 */
.quad sys32_getresgid
.quad sys_chown
.quad sys_setuid
.quad sys_setgid
.quad sys_setfsuid /* 215 */
.quad sys_setfsgid
.quad sys_pivot_root
.quad sys_mincore
.quad sys_madvise
.quad sys_getdents64 /* 220 */
.quad sys32_fcntl64
.quad sys_ni_syscall /* tux */
.quad sys_ni_syscall /* security */
.quad sys_gettid
.quad sys_readahead /* 225 */
.quad sys_setxattr
.quad sys_lsetxattr
.quad sys_fsetxattr
.quad sys_getxattr
.quad sys_lgetxattr /* 230 */
.quad sys_fgetxattr
.quad sys_listxattr
.quad sys_llistxattr
.quad sys_flistxattr
.quad sys_removexattr /* 235 */
.quad sys_lremovexattr
.quad sys_fremovexattr
.quad sys_tkill /* 238 */
ia32_syscall_end:
.rept IA32_NR_syscalls-(ia32_syscall_end-ia32_sys_call_table)/8
.quad ni_syscall
.endr
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment