Commit 4666fd84 authored by Jeff Dike's avatar Jeff Dike

UML updates to allow it to build and run as 2.5.38.

parent f20bf018
......@@ -35,9 +35,8 @@ ARCH_SUBDIRS = $(ARCH_DIR)/drivers $(ARCH_DIR)/kernel \
SUBDIRS += $(ARCH_SUBDIRS)
LIBS += $(ARCH_DIR)/kernel/um.o \
$(ARCH_DIR)/drivers/drivers.o \
$(ARCH_DIR)/sys-$(SUBARCH)/sys.o $(ARCH_DIR)/os/os.o
LIBS += $(ARCH_DIR)/kernel/um.o $(ARCH_DIR)/drivers/drivers.o \
$(ARCH_DIR)/sys-$(SUBARCH)/sys.o $(ARCH_DIR)/os/os.o -L/usr/lib -lutil
ifeq ($(CONFIG_PT_PROXY), y)
SUBDIRS += $(ARCH_DIR)/ptproxy
......@@ -61,9 +60,15 @@ LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc
SIZE = (($(CONFIG_NEST_LEVEL) + $(CONFIG_KERNEL_HALF_GIGS)) * 0x20000000)
$(ARCH_DIR)/link.ld: $(ARCH_DIR)/link.ld.in
m4 -DSTART=$$(($(TOP_ADDR) - $(SIZE))) -DELF_ARCH=$(ELF_ARCH) \
-DELF_FORMAT=$(ELF_FORMAT) $< > $@
AFLAGS_vmlinux.lds.o = -U$(SUBARCH) -DSTART=$$(($(TOP_ADDR) - $(SIZE))) \
-DELF_ARCH=$(ELF_ARCH) -DELF_FORMAT=\"$(ELF_FORMAT)\"
LD_vmlinux = $(CC)
LDFLAGS_vmlinux = $(LINK_PROFILE) $(LINK_WRAPS) -static $(ARCH_DIR)/main.o
cmd_link_vmlinux := $(CC) $(LINK_PROFILE) $(LINK_WRAPS) -static \
$(subst $(cmd_link_vmlinux),$(LD),) $(ARCH_DIR)/main.o vmlinux.o \
-L/usr/lib -lutil
SYMLINK_HEADERS = include/asm-um/archparam.h include/asm-um/system.h \
include/asm-um/sigcontext.h include/asm-um/processor.h \
......@@ -74,11 +79,9 @@ ARCH_SYMLINKS = include/asm-um/arch arch/um/include/sysdep arch/um/os \
GEN_HEADERS = $(ARCH_DIR)/include/task.h
linux: scripts $(ARCH_SYMLINKS) $(SYS_HEADERS) $(GEN_HEADERS) $(ARCH_DIR)/main.o \
vmlinux $(ARCH_DIR)/link.ld
mv vmlinux vmlinux.o
$(CC) -Wl,-T,$(ARCH_DIR)/link.ld $(LINK_PROFILE) $(LINK_WRAPS) \
-o linux -static $(ARCH_DIR)/main.o vmlinux.o -L/usr/lib -lutil
linux: $(ARCH_SYMLINKS) $(GEN_HEADERS) $(SYS_HEADERS) $(ARCH_DIR)/main.o \
vmlinux
mv vmlinux linux
USER_CFLAGS := $(patsubst -I%,,$(CFLAGS))
USER_CFLAGS := $(patsubst -Derrno=kernel_errno,,$(USER_CFLAGS))
......@@ -129,7 +132,7 @@ arch/um/os:
$(ARCH_DIR)/include/task.h : $(ARCH_DIR)/util/mk_task
$< > $@
$(ARCH_DIR)/util/mk_task : $(ARCH_DIR)/util/mk_task_user.c \
$(ARCH_DIR)/util/mk_task : $(SYS_HEADERS) $(ARCH_DIR)/util/mk_task_user.c \
$(ARCH_DIR)/util/mk_task_kern.c
$(MAKE) $(MFLAGS) -C $(ARCH_DIR)/util all
......
......@@ -206,6 +206,9 @@ CONFIG_EXT2_FS=y
# CONFIG_UDF_RW is not set
# CONFIG_UFS_FS is not set
# CONFIG_UFS_FS_WRITE is not set
# CONFIG_XFS_FS is not set
# CONFIG_XFS_RT is not set
# CONFIG_XFS_QUOTA is not set
#
# Network File Systems
......
......@@ -233,7 +233,7 @@ struct page *arch_validate(struct page *page, int mask, int order)
addr += PAGE_SIZE;
}
if(i == (1 << order)) return(page);
page = _alloc_pages(mask, order);
page = alloc_pages(mask, order);
goto again;
}
......
......@@ -48,7 +48,7 @@ struct task_struct *get_task(int pid, int require)
ret = NULL;
read_lock(&tasklist_lock);
for_each_task(task){
for_each_process(task){
if(task->pid == pid){
ret = task;
break;
......@@ -64,7 +64,7 @@ int is_valid_pid(int pid)
struct task_struct *task;
read_lock(&tasklist_lock);
for_each_task(task){
for_each_process(task){
if(task->thread.extern_pid == pid){
read_unlock(&tasklist_lock);
return(1);
......
......@@ -15,7 +15,7 @@ static void kill_off_processes(void)
int me;
me = os_getpid();
for_each_task(p){
for_each_process(p){
if(p->thread.extern_pid != me)
os_kill_process(p->thread.extern_pid);
}
......
......@@ -223,6 +223,12 @@ extern syscall_handler_t sys_sendfile64;
extern syscall_handler_t sys_futex;
extern syscall_handler_t sys_sched_setaffinity;
extern syscall_handler_t sys_sched_getaffinity;
extern syscall_handler_t sys_io_setup;
extern syscall_handler_t sys_io_destroy;
extern syscall_handler_t sys_io_getevents;
extern syscall_handler_t sys_io_submit;
extern syscall_handler_t sys_io_cancel;
extern syscall_handler_t sys_exit_group;
#if CONFIG_NFSD
#define NFSSERVCTL sys_nfsserctl
......@@ -234,7 +240,7 @@ extern syscall_handler_t um_mount;
extern syscall_handler_t um_time;
extern syscall_handler_t um_stime;
#define LAST_GENERIC_SYSCALL __NR_sched_getaffinity
#define LAST_GENERIC_SYSCALL __NR_exit_group
#if LAST_GENERIC_SYSCALL > LAST_ARCH_SYSCALL
#define LAST_SYSCALL LAST_GENERIC_SYSCALL
......@@ -465,6 +471,14 @@ syscall_handler_t *sys_call_table[] = {
[ __NR_futex ] = sys_futex,
[ __NR_sched_setaffinity ] = sys_sched_setaffinity,
[ __NR_sched_getaffinity ] = sys_sched_getaffinity,
[ __NR_io_setup ] = sys_io_setup,
[ __NR_io_destroy ] = sys_io_destroy,
[ __NR_io_getevents ] = sys_io_getevents,
[ __NR_io_submit ] = sys_io_submit,
[ __NR_io_cancel ] = sys_io_cancel,
[ __NR_alloc_hugepages ] = sys_ni_syscall,
[ __NR_free_hugepages ] = sys_ni_syscall,
[ __NR_exit_group ] = sys_exit_group,
ARCH_SYSCALLS
[ LAST_SYSCALL + 1 ... NR_syscalls ] =
......
OUTPUT_FORMAT("ELF_FORMAT")
OUTPUT_FORMAT(ELF_FORMAT)
OUTPUT_ARCH(ELF_ARCH)
ENTRY(_start)
jiffies = jiffies_64;
SECTIONS
{
. = START() + SIZEOF_HEADERS;
. = START + SIZEOF_HEADERS;
. = ALIGN(4096);
__binary_start = .;
......
......@@ -6,7 +6,6 @@
*/
struct task_struct;
#include "asm/arch/irq.h"
#include "asm/ptrace.h"
#undef NR_IRQS
......
#ifndef __UM_CACHEFLUSH_H
#define __UM_CACHEFLUSH_H
#ifndef __UM_PERCPU_H
#define __UM_PERCPU_H
#include "asm/arch/percpu.h"
......
......@@ -358,6 +358,18 @@ static inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
#define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0)
#define pte_unmap_nested(pte) kunmap_atomic(pte, KM_PTE1)
#if defined(CONFIG_HIGHPTE) && defined(CONFIG_HIGHMEM4G)
typedef u32 pte_addr_t;
#endif
#if defined(CONFIG_HIGHPTE) && defined(CONFIG_HIGHMEM64G)
typedef u64 pte_addr_t;
#endif
#if !defined(CONFIG_HIGHPTE)
typedef pte_t *pte_addr_t;
#endif
#define update_mmu_cache(vma,address,pte) do ; while (0)
/* Encode and de-code a swap entry */
......
......@@ -3,4 +3,35 @@
#include "asm/system-generic.h"
static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
unsigned long new, int size)
{
unsigned long prev;
switch (size) {
case 1:
__asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2"
: "=a"(prev)
: "q"(new), "m"(*__xg(ptr)), "0"(old)
: "memory");
return prev;
case 2:
__asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2"
: "=a"(prev)
: "q"(new), "m"(*__xg(ptr)), "0"(old)
: "memory");
return prev;
case 4:
__asm__ __volatile__(LOCK_PREFIX "cmpxchgl %1,%2"
: "=a"(prev)
: "q"(new), "m"(*__xg(ptr)), "0"(old)
: "memory");
return prev;
}
return old;
}
#define cmpxchg(ptr,o,n)\
((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\
(unsigned long)(n),sizeof(*(ptr))))
#endif
......@@ -12,4 +12,6 @@ static inline cycles_t get_cycles (void)
return 0;
}
#define CLOCK_TICK_RATE (HZ)
#endif
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