patch-2.1.9 linux/include/asm-sparc/processor.h

Next file: linux/include/asm-sparc/psr.h
Previous file: linux/include/asm-sparc/posix_types.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.8/linux/include/asm-sparc/processor.h linux/include/asm-sparc/processor.h
@@ -1,4 +1,4 @@
-/* $Id: processor.h,v 1.43 1996/03/23 02:40:05 davem Exp $
+/* $Id: processor.h,v 1.48 1996/10/27 08:55:36 davem Exp $
  * include/asm-sparc/processor.h
  *
  * Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu)
@@ -30,7 +30,15 @@
 #define wp_works_ok__is_a_macro /* for versions in ksyms.c */
 
 /* Whee, this is STACK_TOP and the lowest kernel address too... */
-#define TASK_SIZE	(KERNBASE)
+#define TASK_SIZE	(page_offset)
+
+/* Ok this is hot.  Sparc exception save area. */
+struct exception_struct {
+	unsigned long count;   /* Exception count */
+	unsigned long pc;      /* Callers PC for copy/clear user */
+	unsigned long expc;    /* Where to jump when exception signaled */
+	unsigned long address; /* Saved user base address for transfer */
+};
 
 /* The Sparc processor specific thread struct. */
 struct thread_struct {
@@ -69,11 +77,13 @@
 	} fpqueue[16];
 	struct sigstack sstk_info;
 	unsigned long flags;
+	struct exception_struct ex __attribute__ ((aligned (8)));
 	int current_ds;
 	struct exec core_exec;     /* just what it says. */
 };
 
 #define SPARC_FLAG_KTHREAD      0x1    /* task is a kernel thread */
+#define SPARC_FLAG_UNALIGNED    0x2    /* is allowed to do unaligned accesses */
 
 #define INIT_MMAP { &init_mm, (0), (0), \
 		    __pgprot(0x0) , VM_READ | VM_WRITE | VM_EXEC }
@@ -97,33 +107,43 @@
    0,          0,  { { 0, 0, }, }, \
 /* sstk_info */ \
 { 0, 0, }, \
-/* flags,              current_ds, */ \
-   SPARC_FLAG_KTHREAD, USER_DS, \
+/* flags,              ex,       current_ds, */ \
+   SPARC_FLAG_KTHREAD, { 0, }, USER_DS, \
 /* core_exec */ \
 { 0, }, \
 }
 
 /* Return saved PC of a blocked thread. */
-extern inline unsigned long thread_saved_pc(struct thread_struct *t)
+extern __inline__ unsigned long thread_saved_pc(struct thread_struct *t)
 {
-	return t->kregs->pc;
+	return t->kpc;
 }
 
-/*
- * Do necessary setup to start up a newly executed thread.
- */
-extern inline void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp)
+/* Do necessary setup to start up a newly executed thread. */
+extern __inline__ void start_thread(struct pt_regs * regs, unsigned long pc,
+				    unsigned long sp)
 {
-	unsigned long saved_psr = (regs->psr & (PSR_CWP)) | PSR_S;
-	int i;
+	register unsigned long zero asm("g1");
 
-	for(i = 0; i < 16; i++) regs->u_regs[i] = 0;
-	regs->y = 0;
+	regs->psr = (regs->psr & (PSR_CWP)) | PSR_S;
 	regs->pc = ((pc & (~3)) - 4);
 	regs->npc = regs->pc + 4;
-	regs->psr = saved_psr;
-	regs->u_regs[UREG_FP] = (sp - REGWIN_SZ);
+	regs->y = 0;
+	zero = 0;
+	__asm__ __volatile__("std\t%%g0, [%0 + %3 + 0x00]\n\t"
+			     "std\t%%g0, [%0 + %3 + 0x08]\n\t"
+			     "std\t%%g0, [%0 + %3 + 0x10]\n\t"
+			     "std\t%%g0, [%0 + %3 + 0x18]\n\t"
+			     "std\t%%g0, [%0 + %3 + 0x20]\n\t"
+			     "std\t%%g0, [%0 + %3 + 0x28]\n\t"
+			     "std\t%%g0, [%0 + %3 + 0x30]\n\t"
+			     "st\t%1, [%0 + %3 + 0x38]\n\t"
+			     "st\t%%g0, [%0 + %3 + 0x3c]"
+			     : : "r" (regs), "r" (sp - REGWIN_SZ), "r" (zero),
+			     "i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0])));
 }
+
+#define release_thread(tsk)		do { } while(0)
 
 #ifdef __KERNEL__
 extern unsigned long (*alloc_kernel_stack)(struct task_struct *tsk);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov