OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [uclinux/] [uClinux-2.0.x/] [include/] [asm-sparc/] [processor.h] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
/* $Id: processor.h,v 1.1.1.1 2001-09-10 07:44:43 simons Exp $
2
 * include/asm-sparc/processor.h
3
 *
4
 * Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu)
5
 */
6
 
7
#ifndef __ASM_SPARC_PROCESSOR_H
8
#define __ASM_SPARC_PROCESSOR_H
9
 
10
#include <linux/a.out.h>
11
 
12
#include <asm/psr.h>
13
#include <asm/ptrace.h>
14
#include <asm/head.h>
15
#include <asm/signal.h>
16
#include <asm/segment.h>
17
 
18
/*
19
 * Bus types
20
 */
21
#define EISA_bus 0
22
#define EISA_bus__is_a_macro /* for versions in ksyms.c */
23
#define MCA_bus 0
24
#define MCA_bus__is_a_macro /* for versions in ksyms.c */
25
 
26
/*
27
 * The sparc has no problems with write protection
28
 */
29
#define wp_works_ok 1
30
#define wp_works_ok__is_a_macro /* for versions in ksyms.c */
31
 
32
/* Whee, this is STACK_TOP and the lowest kernel address too... */
33
#define TASK_SIZE       (KERNBASE)
34
#define MAX_USER_ADDR   TASK_SIZE
35
#define MMAP_SEARCH_START (TASK_SIZE/3)
36
 
37
/* The Sparc processor specific thread struct. */
38
struct thread_struct {
39
        unsigned long uwinmask __attribute__ ((aligned (8)));
40
        struct pt_regs *kregs;
41
 
42
        /* For signal handling */
43
        unsigned long sig_address __attribute__ ((aligned (8)));
44
        unsigned long sig_desc;
45
 
46
        /* Context switch saved kernel state. */
47
        unsigned long ksp __attribute__ ((aligned (8)));
48
        unsigned long kpc;
49
        unsigned long kpsr;
50
        unsigned long kwim;
51
 
52
        /* Special child fork kpsr/kwim values. */
53
        unsigned long fork_kpsr __attribute__ ((aligned (8)));
54
        unsigned long fork_kwim;
55
 
56
        /* A place to store user windows and stack pointers
57
         * when the stack needs inspection.
58
         */
59
#define NSWINS 8
60
        struct reg_window reg_window[NSWINS] __attribute__ ((aligned (8)));
61
        unsigned long rwbuf_stkptrs[NSWINS] __attribute__ ((aligned (8)));
62
        unsigned long w_saved;
63
 
64
        /* Floating point regs */
65
        unsigned long   float_regs[64] __attribute__ ((aligned (8)));
66
        unsigned long   fsr;
67
        unsigned long   fpqdepth;
68
        struct fpq {
69
                unsigned long *insn_addr;
70
                unsigned long insn;
71
        } fpqueue[16];
72
        struct sigstack sstk_info;
73
        unsigned long flags;
74
        int current_ds;
75
        struct exec core_exec;     /* just what it says. */
76
};
77
 
78
#define SPARC_FLAG_KTHREAD      0x1    /* task is a kernel thread */
79
 
80
#define INIT_MMAP { &init_mm, (0), (0), \
81
                    __pgprot(0x0) , VM_READ | VM_WRITE | VM_EXEC }
82
 
83
#define INIT_TSS  { \
84
/* uwinmask, kregs, sig_address, sig_desc, ksp, kpc, kpsr, kwim */ \
85
   0,        0,     0,           0,        0,   0,   0,    0, \
86
/* fork_kpsr, fork_kwim */ \
87
   0,         0, \
88
/* reg_window */  \
89
{ { { 0, }, { 0, } }, }, \
90
/* rwbuf_stkptrs */  \
91
{ 0, 0, 0, 0, 0, 0, 0, 0, }, \
92
/* w_saved */ \
93
   0, \
94
/* FPU regs */   { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
95
                   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
96
                   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
97
                   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, \
98
/* FPU status, FPU qdepth, FPU queue */ \
99
   0,          0,  { { 0, 0, }, }, \
100
/* sstk_info */ \
101
{ 0, 0, }, \
102
/* flags,              current_ds, */ \
103
   SPARC_FLAG_KTHREAD, USER_DS, \
104
/* core_exec */ \
105
{ 0, }, \
106
}
107
 
108
/* Return saved PC of a blocked thread. */
109
extern inline unsigned long thread_saved_pc(struct thread_struct *t)
110
{
111
        return t->kregs->pc;
112
}
113
 
114
/*
115
 * Do necessary setup to start up a newly executed thread.
116
 */
117
extern inline void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp)
118
{
119
        unsigned long saved_psr = (regs->psr & (PSR_CWP)) | PSR_S;
120
        int i;
121
 
122
        for(i = 0; i < 16; i++) regs->u_regs[i] = 0;
123
        regs->y = 0;
124
        regs->pc = ((pc & (~3)) - 4);
125
        regs->npc = regs->pc + 4;
126
        regs->psr = saved_psr;
127
        regs->u_regs[UREG_FP] = (sp - REGWIN_SZ);
128
}
129
 
130
#ifdef __KERNEL__
131
extern unsigned long (*alloc_kernel_stack)(struct task_struct *tsk);
132
extern void (*free_kernel_stack)(unsigned long stack);
133
extern struct task_struct *(*alloc_task_struct)(void);
134
extern void (*free_task_struct)(struct task_struct *tsk);
135
#endif
136
 
137
#endif /* __ASM_SPARC_PROCESSOR_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.