summaryrefslogtreecommitdiffstats
path: root/arch/alpha
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-06-01 03:16:17 +0000
committerRalf Baechle <ralf@linux-mips.org>1997-06-01 03:16:17 +0000
commitd8d9b8f76f22b7a16a83e261e64f89ee611f49df (patch)
tree3067bc130b80d52808e6390c9fc7fc087ec1e33c /arch/alpha
parent19c9bba94152148523ba0f7ef7cffe3d45656b11 (diff)
Initial revision
Diffstat (limited to 'arch/alpha')
-rw-r--r--arch/alpha/defconfig32
-rw-r--r--arch/alpha/kernel/entry.S31
-rw-r--r--arch/alpha/kernel/head.S24
-rw-r--r--arch/alpha/kernel/process.c20
-rw-r--r--arch/alpha/kernel/ptrace.c35
-rw-r--r--arch/alpha/kernel/setup.c2
-rw-r--r--arch/alpha/mm/fault.c2
-rw-r--r--arch/alpha/mm/init.c3
-rw-r--r--arch/alpha/vmlinux.lds6
9 files changed, 83 insertions, 72 deletions
diff --git a/arch/alpha/defconfig b/arch/alpha/defconfig
index a6ee5a17c..0c3c65d28 100644
--- a/arch/alpha/defconfig
+++ b/arch/alpha/defconfig
@@ -42,6 +42,13 @@ CONFIG_SYSVIPC=y
CONFIG_SYSCTL=y
CONFIG_BINFMT_AOUT=y
CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_EM86=y
+# CONFIG_PNP_PARPORT is not set
+
+#
+# Plug and Play support
+#
+# CONFIG_PNP is not set
#
# Floppy, IDE, and other block devices
@@ -72,9 +79,10 @@ CONFIG_BLK_DEV_RAM=y
# CONFIG_FIREWALL is not set
# CONFIG_NET_ALIAS is not set
CONFIG_INET=y
-# CONFIG_IP_FORWARD is not set
# CONFIG_IP_MULTICAST is not set
# CONFIG_IP_ACCT is not set
+# CONFIG_IP_ROUTER is not set
+# CONFIG_NET_IPIP is not set
#
# (it is safe to leave these untouched)
@@ -133,11 +141,11 @@ CONFIG_SCSI_CONSTANTS=y
# CONFIG_SCSI_NCR53C406A is not set
# CONFIG_SCSI_NCR53C7xx is not set
# CONFIG_SCSI_NCR53C8XX is not set
-# CONFIG_SCSI_PPA is not set
# CONFIG_SCSI_PAS16 is not set
# CONFIG_SCSI_QLOGIC_FAS is not set
CONFIG_SCSI_QLOGIC_ISP=y
# CONFIG_SCSI_SEAGATE is not set
+# CONFIG_SCSI_DC390T is not set
# CONFIG_SCSI_T128 is not set
# CONFIG_SCSI_U14_34F is not set
# CONFIG_SCSI_ULTRASTOR is not set
@@ -155,19 +163,22 @@ CONFIG_NET_ETHERNET=y
# CONFIG_NET_VENDOR_SMC is not set
# CONFIG_NET_ISA is not set
CONFIG_NET_EISA=y
+# CONFIG_PCNET32 is not set
# CONFIG_APRICOT is not set
+# CONFIG_CS89x0 is not set
CONFIG_DE4X5=y
# CONFIG_DEC_ELCP is not set
# CONFIG_DGRS is not set
+# CONFIG_EEXPRESS_PRO100 is not set
# CONFIG_NET_POCKET is not set
# CONFIG_FDDI is not set
# CONFIG_DLCI is not set
-# CONFIG_PLIP is not set
# CONFIG_PPP is not set
# CONFIG_NET_RADIO is not set
-# CONFIG_LAPBETHER is not set
# CONFIG_SLIP is not set
# CONFIG_TR is not set
+# CONFIG_LAPBETHER is not set
+# CONFIG_X25_ASY is not set
#
# ISDN subsystem
@@ -192,12 +203,16 @@ CONFIG_MSDOS_FS=y
CONFIG_PROC_FS=y
CONFIG_NFS_FS=y
# CONFIG_ROOT_NFS is not set
+# CONFIG_NFSD is not set
+CONFIG_SUNRPC=y
+CONFIG_LOCKD=y
# CONFIG_SMB_FS is not set
CONFIG_ISO9660_FS=y
# CONFIG_HPFS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_AFFS_FS is not set
# CONFIG_ROMFS_FS is not set
+# CONFIG_AUTOFS_FS is not set
# CONFIG_UFS_FS is not set
#
@@ -206,12 +221,8 @@ CONFIG_ISO9660_FS=y
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
CONFIG_SERIAL=y
-# CONFIG_DIGI is not set
-# CONFIG_CYCLADES is not set
-# CONFIG_STALDRV is not set
-# CONFIG_RISCOM8 is not set
-# CONFIG_ESPSERIAL is not set
-# CONFIG_PRINTER is not set
+# CONFIG_SERIAL_EXTENDED is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
CONFIG_MOUSE=y
# CONFIG_ATIXL_BUSMOUSE is not set
# CONFIG_BUSMOUSE is not set
@@ -224,7 +235,6 @@ CONFIG_PSMOUSE=y
# CONFIG_APM is not set
# CONFIG_WATCHDOG is not set
# CONFIG_RTC is not set
-CONFIG_RTC_ARC=y
#
# Sound
diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S
index ef582b80e..af26f8996 100644
--- a/arch/alpha/kernel/entry.S
+++ b/arch/alpha/kernel/entry.S
@@ -126,7 +126,8 @@
.ent entInt
entInt:
SAVE_ALL
- ldq $8,current_set
+ lda $8,0x3fff
+ bic $30,$8,$8
jsr $26,do_entInt
br $31,ret_from_sys_call
.end entInt
@@ -147,7 +148,8 @@ entMM:
stq $15,48($30)
addq $30,56,$19
/* handle the fault */
- ldq $8,current_set
+ lda $8,0x3fff
+ bic $30,$8,$8
jsr $26,do_page_fault
/* reload the registers after the exception code played. */
ldq $9,0($30)
@@ -167,7 +169,8 @@ entMM:
.ent entArith
entArith:
SAVE_ALL
- ldq $8,current_set
+ lda $8,0x3fff
+ bic $30,$8,$8
/* How much of a win is this clockwise? We are, after all, messing
up the call/return prefetch stack. -- rth */
lda $27,do_entArith
@@ -180,7 +183,8 @@ entArith:
.ent entIF
entIF:
SAVE_ALL
- ldq $8,current_set
+ lda $8,0x3fff
+ bic $30,$8,$8
lda $27,do_entIF
lda $26,ret_from_sys_call
jsr $31,($27),do_entIF
@@ -221,12 +225,13 @@ kernel_clone:
.globl __kernel_thread
.ent __kernel_thread
__kernel_thread:
+ ldgp $29,0($27) /* we can be called from a module */
.frame $30, 4*8, $26
subq $30,4*8,$30
stq $10,16($30)
stq $9,8($30)
stq $26,0($30)
- .prologue 0
+ .prologue 1
bis $17,$17,$9 /* save fn */
bis $18,$18,$10 /* save arg */
bsr $26,kernel_clone
@@ -238,10 +243,9 @@ __kernel_thread:
ret $31,($26),1
/* this is in child: look out as we don't have any stack here.. */
1: bis $9,$9,$27 /* get fn */
- br $29,2f
-2: ldgp $29,0($29)
+ lda $8,0x3fff
bis $10,$10,$16 /* get arg */
- ldq $8,current_set
+ bic $30,$8,$8 /* get current */
jsr $26,($27)
bis $0,$0,$16
jsr $26,sys_exit
@@ -382,7 +386,8 @@ entUna:
stq $29,232($30)
stq $30,240($30)
stq $31,248($30)
- ldq $8,current_set
+ lda $8,0x3fff
+ bic $30,$8,$8
jsr $26,do_entUna
ldq $0,0($30)
ldq $1,8($30)
@@ -432,7 +437,8 @@ entUnaUser:
stq $14,40($30)
stq $15,48($30)
bis $31,$30,$19
- ldq $8,current_set
+ lda $8,0x3fff
+ bic $30,$8,$8
jsr $26,do_entUnaUser
ldq $9,0($30)
ldq $10,8($30)
@@ -497,7 +503,8 @@ alpha_switch_to:
.ent entSys
entSys:
SAVE_ALL
- ldq $8,current_set
+ lda $8,0x3fff
+ bic $30,$8,$8
lda $4,NR_SYSCALLS($31)
stq $16,SP_OFF+24($30)
lda $5,sys_call_table
@@ -532,7 +539,7 @@ ret_from_handle_bh:
ret_from_reschedule:
lda $0,need_resched
ldl $2,0($0)
- lda $4,init_task
+ lda $4,init_task_union
bne $2,reschedule
xor $4,$8,$4
beq $4,restore_all
diff --git a/arch/alpha/kernel/head.S b/arch/alpha/kernel/head.S
index 17ca4581a..f76213624 100644
--- a/arch/alpha/kernel/head.S
+++ b/arch/alpha/kernel/head.S
@@ -23,9 +23,11 @@ _stext:
__start:
br $27,1f
1: ldgp $29,0($27)
- /* We need to get current loaded up with our first task. */
- ldq $8,current_set
- /* And then we can start the kernel. */
+ /* We need to get current loaded up with our first task... */
+ lda $8,init_task_union
+ /* ... and find our stack ... */
+ lda $30,0x4000($8)
+ /* ... and then we can start the kernel. */
jsr $26,start_kernel
halt
.end __start
@@ -63,22 +65,6 @@ rdusp:
.end rdusp
.align 3
- .globl tbi
- .ent tbi
-tbi:
- call_pal PAL_tbi
- ret ($26)
- .end tbi
-
- .align 3
- .globl imb
- .ent imb
-imb:
- call_pal PAL_imb
- ret ($26)
- .end imb
-
- .align 3
.globl rdmces
.ent rdmces
rdmces:
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index 2eb2d51b7..b6c97e726 100644
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -37,6 +37,24 @@
#include <asm/uaccess.h>
#include <asm/system.h>
#include <asm/io.h>
+#include <asm/pgtable.h>
+
+/*
+ * Initial task structure. Make this a per-architecture thing,
+ * because different architectures tend to have different
+ * alignment requirements and potentially different initial
+ * setup.
+ */
+
+unsigned long init_user_stack[1024] = { STACK_MAGIC, };
+static struct vm_area_struct init_mmap = INIT_MMAP;
+static struct fs_struct init_fs = INIT_FS;
+static struct files_struct init_files = INIT_FILES;
+static struct signal_struct init_signals = INIT_SIGNALS;
+struct mm_struct init_mm = INIT_MM;
+
+union task_union init_task_union __attribute__((section("init_task")))
+ = { task: INIT_TASK };
/*
* No need to acquire the kernel lock, we're entirely local..
@@ -186,7 +204,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
stack_offset = PAGE_SIZE - sizeof(struct pt_regs);
if (!(regs->ps & 8))
stack_offset = (PAGE_SIZE-1) & (unsigned long) regs;
- childregs = (struct pt_regs *) (p->kernel_stack_page + stack_offset);
+ childregs = (struct pt_regs *) (stack_offset + PAGE_SIZE + (unsigned long)p);
*childregs = *regs;
childregs->r0 = 0;
diff --git a/arch/alpha/kernel/ptrace.c b/arch/alpha/kernel/ptrace.c
index 019fb6b95..c388f0b51 100644
--- a/arch/alpha/kernel/ptrace.c
+++ b/arch/alpha/kernel/ptrace.c
@@ -67,7 +67,7 @@
* | | |
* | | v
* +================================+ <-------------------------
- * task->kernel_stack_page
+ * task + PAGE_SIZE
*/
#define PT_REG(reg) (PAGE_SIZE - sizeof(struct pt_regs) \
+ (long)&((struct pt_regs *)0)->reg)
@@ -107,19 +107,6 @@ static unsigned short regoff[] = {
static long zero;
-
-/* change a pid into a task struct. */
-static inline struct task_struct * get_task(int pid)
-{
- int i;
-
- for (i = 1; i < NR_TASKS; i++) {
- if (task[i] != NULL && (task[i]->pid == pid))
- return task[i];
- }
- return NULL;
-}
-
/*
* Get contents of register REGNO in task TASK.
*/
@@ -133,7 +120,7 @@ static inline long get_reg(struct task_struct * task, long regno)
zero = 0;
addr = &zero;
} else {
- addr = (long *) (task->kernel_stack_page + regoff[regno]);
+ addr = (long *) (regoff[regno] + PAGE_SIZE + (long)task);
}
return *addr;
}
@@ -150,7 +137,7 @@ static inline int put_reg(struct task_struct *task, long regno, long data)
} else if (regno == 31) {
addr = &zero;
} else {
- addr = (long *) (task->kernel_stack_page + regoff[regno]);
+ addr = (long *) (regoff[regno] + PAGE_SIZE + (long)task);
}
*addr = data;
return 0;
@@ -174,7 +161,7 @@ static unsigned long get_long(struct task_struct * tsk,
repeat:
pgdir = pgd_offset(vma->vm_mm, addr);
if (pgd_none(*pgdir)) {
- do_no_page(tsk, vma, addr, 0);
+ handle_mm_fault(tsk, vma, addr, 0);
goto repeat;
}
if (pgd_bad(*pgdir)) {
@@ -184,7 +171,7 @@ repeat:
}
pgmiddle = pmd_offset(pgdir, addr);
if (pmd_none(*pgmiddle)) {
- do_no_page(tsk, vma, addr, 0);
+ handle_mm_fault(tsk, vma, addr, 0);
goto repeat;
}
if (pmd_bad(*pgmiddle)) {
@@ -194,7 +181,7 @@ repeat:
}
pgtable = pte_offset(pgmiddle, addr);
if (!pte_present(*pgtable)) {
- do_no_page(tsk, vma, addr, 0);
+ handle_mm_fault(tsk, vma, addr, 0);
goto repeat;
}
page = pte_page(*pgtable);
@@ -225,7 +212,7 @@ static void put_long(struct task_struct * tsk, struct vm_area_struct * vma,
repeat:
pgdir = pgd_offset(vma->vm_mm, addr);
if (!pgd_present(*pgdir)) {
- do_no_page(tsk, vma, addr, 1);
+ handle_mm_fault(tsk, vma, addr, 1);
goto repeat;
}
if (pgd_bad(*pgdir)) {
@@ -235,7 +222,7 @@ repeat:
}
pgmiddle = pmd_offset(pgdir, addr);
if (pmd_none(*pgmiddle)) {
- do_no_page(tsk, vma, addr, 1);
+ handle_mm_fault(tsk, vma, addr, 1);
goto repeat;
}
if (pmd_bad(*pgmiddle)) {
@@ -245,12 +232,12 @@ repeat:
}
pgtable = pte_offset(pgmiddle, addr);
if (!pte_present(*pgtable)) {
- do_no_page(tsk, vma, addr, 1);
+ handle_mm_fault(tsk, vma, addr, 1);
goto repeat;
}
page = pte_page(*pgtable);
if (!pte_write(*pgtable)) {
- do_wp_page(tsk, vma, addr, 1);
+ handle_mm_fault(tsk, vma, addr, 1);
goto repeat;
}
/* this is a hack for non-kernel-mapped video buffers and similar */
@@ -507,7 +494,7 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data,
if (pid == 1) /* you may not mess with init */
goto out;
ret = -ESRCH;
- if (!(child = get_task(pid)))
+ if (!(child = find_task_by_pid(pid)))
goto out;
if (request == PTRACE_ATTACH) {
ret = -EPERM;
diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c
index 0fa1129ee..31a1f21fc 100644
--- a/arch/alpha/kernel/setup.c
+++ b/arch/alpha/kernel/setup.c
@@ -21,9 +21,9 @@
#include <linux/tty.h>
#include <linux/delay.h>
#include <linux/config.h> /* CONFIG_ALPHA_LCA etc */
+#include <linux/ioport.h>
#ifdef CONFIG_RTC
-#include <linux/ioport.h>
#include <linux/timex.h>
#endif
diff --git a/arch/alpha/mm/fault.c b/arch/alpha/mm/fault.c
index a7b1e6f2c..a8bc34108 100644
--- a/arch/alpha/mm/fault.c
+++ b/arch/alpha/mm/fault.c
@@ -97,7 +97,7 @@ good_area:
if (!(vma->vm_flags & VM_WRITE))
goto bad_area;
}
- handle_mm_fault(vma, address, cause > 0);
+ handle_mm_fault(tsk, vma, address, cause > 0);
up(&mm->mmap_sem);
return;
diff --git a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c
index 13e8e4ce4..67faa97d4 100644
--- a/arch/alpha/mm/init.c
+++ b/arch/alpha/mm/init.c
@@ -133,7 +133,6 @@ unsigned long paging_init(unsigned long start_mem, unsigned long end_mem)
init_task.tss.ptbr = newptbr;
init_task.tss.pal_flags = 1; /* set FEN, clear everything else */
init_task.tss.flags = 0;
- init_task.kernel_stack_page = INIT_STACK;
load_PCB(&init_task.tss);
flush_tlb_all();
@@ -182,7 +181,7 @@ void free_initmem (void)
atomic_set(&mem_map[MAP_NR(addr)].count, 1);
free_page(addr);
}
- printk ("Freeing unused kernel memory: %dk freed\n",
+ printk ("Freeing unused kernel memory: %ldk freed\n",
(&__init_end - &__init_begin) >> 10);
}
diff --git a/arch/alpha/vmlinux.lds b/arch/alpha/vmlinux.lds
index 2a5f00989..0fb2276ea 100644
--- a/arch/alpha/vmlinux.lds
+++ b/arch/alpha/vmlinux.lds
@@ -5,6 +5,7 @@ SECTIONS
. = 0xfffffc0000310000;
_text = .;
.text : { *(.text) }
+ .text2 : { *(.text2) }
_etext = .;
/* Exception table */
@@ -25,9 +26,12 @@ SECTIONS
__init_begin = .;
.text.init : { *(.text.init) }
.data.init : { *(.data.init) }
- . = ALIGN(8192);
+ . = ALIGN(2*8192); /* Align double page for init_task_union */
__init_end = .;
+ /* The initial task and kernel stack */
+ init_task : { *(init_task) }
+
/* Global data */
_data = .;
.rodata : { *(.rodata) }