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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [asm-or32/] [processor.h] - Blame information for rev 1633

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
#ifndef _ASM_OR32_PROCESSOR_H
2
#define _ASM_OR32_PROCESSOR_H
3
 
4
#include <linux/config.h>
5
#include <asm/segment.h>
6
#include <asm/ptrace.h>
7
#include <asm/spr_defs.h>
8
#include <asm/board.h>
9
 
10
/*
11
 * Bus types
12
 */
13
#define EISA_bus__is_a_macro    1
14
#define EISA_bus 0
15
#define MCA_bus__is_a_macro     1
16
#define MCA_bus 0
17
 
18
/*
19
 * The or32 has no problems with write protection
20
 */
21
#define wp_works_ok__is_a_macro 1
22
#define wp_works_ok 1
23
 
24
/* MAX floating point unit state size (FSAVE/FRESTORE) */
25
#define FPSTATESIZE   (216/sizeof(unsigned char))
26
 
27
struct thread_struct {
28
        unsigned long  pc;              /* PC when last entered system */
29
        unsigned long  sr;              /* saved status register */
30
        unsigned long  ksp;             /* kernel stack pointer */
31
        unsigned long  usp;             /* user stack pointer */
32
        unsigned long  *regs;           /* pointer to saved register state */
33
        unsigned short fs;              /* saved fs (sfc, dfc) */
34
        unsigned long  crp[2];          /* cpu root pointer */
35
        unsigned long  esp0;            /* points to SR of stack frame */
36
        unsigned long  fp[8*3];
37
        unsigned long  fpcntl[3];       /* fp control regs */
38
        unsigned char  fpstate[FPSTATESIZE];  /* floating point state */
39
};
40
 
41
#define INIT_MMAP { &init_mm, 0, 0x40000000, __pgprot(_PAGE_PRESENT|_PAGE_ACCESSED), VM_READ | VM_WRITE | VM_EXEC }
42
 
43
#define INIT_TSS  {     0x100,        \
44
                        ((DCACHE << SPR_SR_DCE_BIT) | \
45
       (ICACHE << SPR_SR_ICE_BIT) | \
46
                         (DMMU   << SPR_SR_DME_BIT) | \
47
       (IMMU   << SPR_SR_IME_BIT) | \
48
        SPR_SR_IEE                | \
49
        SPR_SR_TEE                | \
50
        SPR_SR_SM),                 \
51
                        sizeof(init_kernel_stack) + (long) init_kernel_stack, \
52
}
53
 
54
#define SR_USER                     \
55
                        ((DCACHE << SPR_SR_DCE_BIT) | \
56
       (ICACHE << SPR_SR_ICE_BIT) | \
57
                         (DMMU   << SPR_SR_DME_BIT) | \
58
       (IMMU   << SPR_SR_IME_BIT) | \
59
        SPR_SR_IEE                | \
60
        SPR_SR_TEE)
61
 
62
#define alloc_kernel_stack()    __get_free_page(GFP_KERNEL)
63
#define free_kernel_stack(page) free_page((page))
64
 
65
/*
66
 * Do necessary setup to start up a newly executed thread.
67
 */
68
static inline void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long usp)
69
{
70
#ifndef NO_MM
71
        unsigned long nilstate = 0;
72
#endif
73
 
74
        /* reads from user space */
75
        set_fs(USER_DS);
76
 
77
        regs->pc = pc;
78
        regs->sp = usp;
79
        regs->sr = SR_USER;
80
}
81
 
82
/*
83
 * Return saved PC of a blocked thread.
84
 */
85
extern inline unsigned long thread_saved_pc(struct thread_struct *t)
86
{
87
        return t->pc;
88
}
89
 
90
#endif

powered by: WebSVN 2.1.0

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