summaryrefslogtreecommitdiff
path: root/sys/arch/atari
diff options
context:
space:
mode:
authormatt <matt@NetBSD.org>2009-11-26 00:19:11 +0000
committermatt <matt@NetBSD.org>2009-11-26 00:19:11 +0000
commit11af2f9cfaf7c0dabb4c8dfb59b3a863bc6d23b1 (patch)
treed7ed2143bc0f5c987aa4e7eb2aa536052d083a4b /sys/arch/atari
parentf3d037fec47bbee9044382b06e61b105fe1750a0 (diff)
Kill proc0paddr. Use lwp0.l_addr instead.
Diffstat (limited to 'sys/arch/atari')
-rw-r--r--sys/arch/atari/atari/atari_init.c20
-rw-r--r--sys/arch/atari/atari/locore.s13
2 files changed, 12 insertions, 21 deletions
diff --git a/sys/arch/atari/atari/atari_init.c b/sys/arch/atari/atari/atari_init.c
index 6614cd139d5..af2ab1a10d3 100644
--- a/sys/arch/atari/atari/atari_init.c
+++ b/sys/arch/atari/atari/atari_init.c
@@ -1,4 +1,4 @@
-/* $NetBSD: atari_init.c,v 1.86 2009/08/23 01:27:13 mrg Exp $ */
+/* $NetBSD: atari_init.c,v 1.87 2009/11/26 00:19:13 matt Exp $ */
/*
* Copyright (c) 1995 Leo Weppelman
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: atari_init.c,v 1.86 2009/08/23 01:27:13 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atari_init.c,v 1.87 2009/11/26 00:19:13 matt Exp $");
#include "opt_ddb.h"
#include "opt_mbtype.h"
@@ -118,7 +118,6 @@ int iomem_malloc_safe;
static cpu_kcore_hdr_t cpu_kcore_hdr;
extern u_int lowram;
-extern u_int proc0paddr;
int machineid, mmutype, cputype, astpending;
#if defined(M68040) || defined(M68060)
extern int protostfree;
@@ -275,9 +274,9 @@ start_c(int id, u_int ttphystart, u_int ttphysize, u_int stphysize,
avail = stphysize - pstart;
/*
- * Save KVA of proc0 user-area and allocate it
+ * Save KVA of lwp0 user-area and allocate it
*/
- proc0paddr = vstart;
+ lwp.l_addr = (struct user *)vstart;
pstart += USPACE;
vstart += USPACE;
avail -= USPACE;
@@ -408,7 +407,7 @@ start_c(int id, u_int ttphystart, u_int ttphysize, u_int stphysize,
/*
* go till end of data allocated so far
- * plus proc0 u-area (to be allocated)
+ * plus lwp0 u-area (to be allocated)
*/
for (; kva < vstart; kva += PAGE_SIZE) {
*pg++ = pg_proto;
@@ -568,19 +567,14 @@ start_c(int id, u_int ttphystart, u_int ttphysize, u_int stphysize,
__asm volatile ("pmove %0@,%%tc" : : "a" (&tc));
}
- /* Is this to fool the optimizer?? */
- i = *(int *)proc0paddr;
- *(volatile int *)proc0paddr = i;
-
/*
* Initialize the "u-area" pages.
* Must initialize p_addr before autoconfig or the
* fault handler will get a NULL reference.
*/
- memset((u_char *)proc0paddr, 0, USPACE);
- lwp0.l_addr = (struct user *)proc0paddr;
+ memset(lwp0.l_addr, 0, USPACE);
curlwp = &lwp0;
- curpcb = &((struct user *)proc0paddr)->u_pcb;
+ curpcb = &lwp0.l_addr->u_pcb;
/*
* Get the hardware into a defined state
diff --git a/sys/arch/atari/atari/locore.s b/sys/arch/atari/atari/locore.s
index 318ff76c973..4aaecbad725 100644
--- a/sys/arch/atari/atari/locore.s
+++ b/sys/arch/atari/atari/locore.s
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.102 2008/12/27 16:17:24 tsutsui Exp $ */
+/* $NetBSD: locore.s,v 1.103 2009/11/26 00:19:13 matt Exp $ */
/*
* Copyright (c) 1980, 1990 The Regents of the University of California.
@@ -1026,10 +1026,9 @@ Lend_cpuset:
/*
* set kernel stack, user SP, and initial pcb
*/
- movl _C_LABEL(proc0paddr),%a1| lwp0 kernel stack
+ lea _C_LABEL(lwp0),%a0 | grab lwp0.p_addr
+ movl %a0@(L_ADDR),%a1
lea %a1@(USPACE-4),%sp | set kernel stack to end of area
- lea _C_LABEL(lwp0),%a2 | initialize lwp0.p_addr so that
- movl %a1,%a2@(L_ADDR) | we don't deref NULL in trap()
movl #USRSTACK-4,%a2
movl %a2,%usp | init user SP
movl %a2,%a1@(PCB_USP) | and save it
@@ -1078,8 +1077,8 @@ Lcacheon:
movw #PSL_USER,%sp@- | in user mode
clrl %sp@- | stack adjust count
lea %sp@(-64),%sp | construct space for D0-D7/A0-A7
- lea _C_LABEL(lwp0),%a0 | proc0 in a0
- movl %sp,%a0@(L_MD_REGS) | save frame for proc0
+ #lea _C_LABEL(lwp0),%a0 | lwp0 in a0
+ movl %sp,%a0@(L_MD_REGS) | save frame for lwp0
movl %usp,%a1
movl %a1,%sp@(FR_SP) | save user stack pointer in frame
pea %sp@ | addr of space for D0
@@ -1464,8 +1463,6 @@ ASLOCAL(tmpstk)
GLOBAL(protorp)
.long 0x80000002,0 | prototype root pointer
-GLOBAL(proc0paddr)
- .long 0 | KVA of proc0 u-area
#ifdef M68060 /* XXX */
L60iem: .long 0
L60fpiem: .long 0