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

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

diff -u --recursive --new-file v1.3.43/linux/include/asm-sparc/processor.h linux/include/asm-sparc/processor.h
@@ -1,4 +1,5 @@
-/* include/asm-sparc/processor.h
+/* $Id: processor.h,v 1.28 1995/11/25 02:32:30 davem Exp $
+ * include/asm-sparc/processor.h
  *
  * Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu)
  */
@@ -6,9 +7,12 @@
 #ifndef __ASM_SPARC_PROCESSOR_H
 #define __ASM_SPARC_PROCESSOR_H
 
-#include <linux/sched.h>  /* For intr_count */
+#include <linux/string.h>
 
-#include <asm/ptrace.h>   /* For pt_regs declaration */
+#include <asm/psr.h>
+#include <asm/ptrace.h>
+#include <asm/head.h>
+#include <asm/signal.h>
 
 /*
  * Bus types
@@ -19,125 +23,89 @@
 #define MCA_bus__is_a_macro /* for versions in ksyms.c */
 
 /*
- * Write Protection works right in supervisor mode on the Sparc
+ * Write Protection works right in supervisor mode on the Sparc...
+ * And then there came the Swift module, which isn't so swift...
  */
-#if 0  /* Let's try this out ;) */
-#define wp_works_ok 1
-#define wp_works_ok__is_a_macro /* for versions in ksyms.c */
-#else
 extern char wp_works_ok;
-#endif
 
-/*
- * User space process size: 3GB. This is hardcoded into a few places,
- * so don't change it unless you know what you are doing.
- *
- * With the way identity mapping works on the sun4c, this is the best
- * value to use.
- *
- * This has to be looked into for a unified sun4c/sun4m task size.
- */
-#define TASK_SIZE	(0xC000000UL)
+/* Whee, this is STACK_TOP and the lowest kernel address too... */
+#define TASK_SIZE	(KERNBASE)
 
-/*
- * Size of io_bitmap in longwords: 32 is ports 0-0x3ff.
- */
-#define IO_BITMAP_SIZE	32
+/* The Sparc processor specific thread struct. */
+struct thread_struct {
+	unsigned long uwinmask __attribute__ ((aligned (8)));
 
-/* The first four entries here MUST be the first four. This allows me to
- * do %lo(offset) loads and stores in entry.S. See TRAP_WIN_CLEAN to see
- * why.
- */
+	/* For signal handling */
+	unsigned long sig_address __attribute__ ((aligned (8)));
+	unsigned long sig_desc;
+
+	/* Context switch saved kernel state. */
+	unsigned long ksp __attribute__ ((aligned (8)));
+	unsigned long kpc;
+	unsigned long kpsr;
+	unsigned long kwim;
+
+	/* A place to store user windows and stack pointers
+	 * when the stack needs inspection.
+	 */
+#define NSWINS 8
+	struct reg_window reg_window[NSWINS] __attribute__ ((aligned (8)));
+	unsigned long rwbuf_stkptrs[NSWINS] __attribute__ ((aligned (8)));
+	unsigned long w_saved;
 
-struct thread_struct {
-	unsigned long uwindows;       /* how many user windows are in the set */
-	unsigned long wim;            /* user's window invalid mask */
-	unsigned long w_saved;        /* how many windows saved in reg_window[] */
-	unsigned long ksp;            /* kernel stack pointer */
-	unsigned long usp;            /* user's sp, throw reg windows here */
-	unsigned long psr;            /* save for condition codes */
-	unsigned long pc;             /* program counter */
-	unsigned long npc;            /* next program counter */
-	unsigned long yreg;
-	unsigned long align;          /* to get 8-byte alignment  XXX  */
-	unsigned long reg_window[16];
+	/* Where our page table lives. */
 	unsigned long pgd_ptr;
-	int context;                  /* The context allocated to this thread */
 
-/* 8 local registers + 8 in registers * 24 register windows.
- * Most sparcs I know of only have 7 or 8 windows implemented,
- * we determine how many at boot time and store that value
- * in nwindows.
- */
-	unsigned long float_regs[64]; /* V8 and below have 32, V9 has 64 */
+	/* The context currently allocated to this process
+	 * or -1 if no context has been allocated to this
+	 * task yet.
+	 */
+	int context;
+
+	/* Floating point regs */
+	unsigned long   float_regs[64] __attribute__ ((aligned (8)));
+	unsigned long   fsr;
+	unsigned long   fpqdepth;
+	struct fpq {
+		unsigned long *insn_addr;
+		unsigned long insn;
+	} fpqueue[16];
+	struct sigstack sstk_info;
 };
 
-#define INIT_MMAP { &init_task, (PAGE_OFFSET), (0xff000000UL), \
-		    0x0 , VM_READ | VM_WRITE | VM_EXEC }
+#define INIT_MMAP { &init_mm, (0xf0000000UL), (0xffffffffUL), \
+		    __pgprot(0x0) , VM_READ | VM_WRITE | VM_EXEC }
 
 #define INIT_TSS  { \
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
-        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, \
-	(long) &swapper_pg_dir, -1,  \
-        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, \
+/* uwinmask, sig_address, sig_desc, ksp, kpc, kpsr, kwim */ \
+   0,        0,           0,        0,   0,   0,    0, \
+/* reg_window */  \
+{ { { 0, }, { 0, } }, }, \
+/* rwbuf_stkptrs */  \
+{ 0, 0, 0, 0, 0, 0, 0, 0, }, \
+/* w_saved, pgd_ptr,                context */  \
+   0,       (long) &swapper_pg_dir, -1, \
+/* FPU regs */   { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
+                   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
+                   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
+                   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, \
+/* FPU status, FPU qdepth, FPU queue */ \
+   0,          0,  { { 0, 0, }, }, \
+/* sstk_info */ \
+{ 0, 0, }, \
 }
 
-/* The thread_frame is what needs to be set up in certain circumstances
- * upon entry to a trap. It is also loaded sometimes during a window
- * spill if things don't go right (bad user stack pointer). In reality
- * it is not per-process per se, it just sits in the kernel stack while
- * the current process is in a handler then it is basically forgotten
- * about the next time flow control goes back to that process.
- */
-
-/* Sparc stack save area allocated for each save, not very exciting. */
-struct sparc_save_stack {
-  unsigned int locals[8];
-  unsigned int ins[8];
-  unsigned int padd[8];
-};
-
-/*
- * These are the "cli()" and "sti()" for software interrupts
- * They work by increasing/decreasing the "intr_count" value, 
- * and as such can be nested arbitrarily.
- */
-extern inline void start_bh_atomic(void)
+/* Return saved PC of a blocked thread. */
+extern inline unsigned long thread_saved_pc(struct thread_struct *t)
 {
-	__asm__ __volatile__("rd %%psr, %%g2\n\t"
-			     "wr %%g2, 0x20, %%psr\n\t"  /* disable traps */
-			     "ld %0,%%g3\n\t"
-			     "add %%g3,1,%%g3\n\t"
-			     "st %%g3,%0\n\t"
-			     "wr %%g2, 0x0, %%psr\n\t"   /* enable traps */
-			     : "=m" (intr_count)
-			     : : "g2", "g3", "memory");
-}
-
-extern inline void end_bh_atomic(void)
-{
-	__asm__ __volatile__("rd %%psr, %%g2\n\t"
-			     "wr %%g2, 0x20, %%psr\n\t"
-			     "ld %0,%%g3\n\t"
-			     "sub %%g3,1,%%g3\n\t"
-			     "st %%g3,%0\n\t"
-			     "wr %%g2, 0x0, %%psr\n\t"
-			     : "=m" (intr_count)
-			     : : "g2", "g3", "memory");
+	return ((struct pt_regs *)
+		((t->ksp&(~0xfff))+(0x1000-TRACEREG_SZ)))->pc;
 }
 
 /*
  * Do necessary setup to start up a newly executed thread.
  */
-static inline void start_thread(struct pt_regs * regs, unsigned long sp,
-				unsigned long fp)
-{
-  printk("start_thread called, halting..n");
-  halt();
-}
+extern void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp);
 
 #endif /* __ASM_SPARC_PROCESSOR_H */
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this