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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uC-libc/] [include/] [asm/] [processor.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
/*
2
 * include/asm-or1k/processor.h
3
 *
4
 * Copyright (C) 1995 Hamish Macdonald
5
 */
6
 
7
#ifndef __ASM_OR1K_PROCESSOR_H
8
#define __ASM_OR1K_PROCESSOR_H
9
 
10
#include <linux/config.h>
11
#include <asm/segment.h>
12
 
13
/*
14
 * User space process size: 3.75GB. This is hardcoded into a few places,
15
 * so don't change it unless you know what you are doing.
16
 */
17
/*#define TASK_SIZE     (0xF0000000UL)*/
18
 
19
/*
20
 * Bus types
21
 */
22
#define EISA_bus__is_a_macro    1
23
#define EISA_bus 0
24
#define MCA_bus__is_a_macro     1
25
#define MCA_bus 0
26
 
27
/*
28
 * The or1k has no problems with write protection
29
 */
30
#define wp_works_ok__is_a_macro 1
31
#define wp_works_ok 1
32
 
33
/* MAX floating point unit state size (FSAVE/FRESTORE) */
34
#define FPSTATESIZE   (216/sizeof(unsigned char))
35
 
36
struct thread_struct {
37
        unsigned long  pc;              /* PC when last entered system */
38
        unsigned long  sr;              /* saved status register */
39
        unsigned long  ksp;             /* kernel stack pointer */
40
        unsigned long  usp;             /* user stack pointer */
41
        unsigned long  *regs;           /* pointer to saved register state */
42
        unsigned short fs;              /* saved fs (sfc, dfc) */
43
        unsigned long  crp[2];          /* cpu root pointer */
44
        unsigned long  esp0;            /* points to SR of stack frame */
45
        unsigned long  fp[8*3];
46
        unsigned long  fpcntl[3];       /* fp control regs */
47
        unsigned char  fpstate[FPSTATESIZE];  /* floating point state */
48
};
49
 
50
#define INIT_MMAP { &init_mm, 0, 0x40000000, __pgprot(_PAGE_PRESENT|_PAGE_ACCESSED), VM_READ | VM_WRITE | VM_EXEC }
51
 
52
#define INIT_TSS  {     0x100,\
53
                        (SPR_SR_EIR | SPR_SR_EXR | SPR_SR_SUPV), \
54
                        sizeof(init_kernel_stack) + (long) init_kernel_stack, \
55
}
56
 
57
#define alloc_kernel_stack()    __get_free_page(GFP_KERNEL)
58
#define free_kernel_stack(page) free_page((page))
59
 
60
#define SR_USER (SPR_SR_EIR | SPR_SR_EXR)
61
/*
62
 * Do necessary setup to start up a newly executed thread.
63
 */
64
static inline void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long usp)
65
{
66
#ifndef NO_MM
67
        unsigned long nilstate = 0;
68
#endif
69
 
70
        /* reads from user space */
71
        set_fs(USER_DS);
72
 
73
        regs->pc = pc;
74
        regs->sp = usp;
75
        regs->sr = SR_USER;
76
}
77
 
78
#ifndef CONFIG_COLDFIRE
79
static inline void tron(void)
80
{
81
        __asm__ __volatile__ ("
82
        oriw #0x8000, %sr
83
        ");
84
}
85
 
86
static inline void troncof(void)
87
{
88
        __asm__ __volatile__ ("
89
        oriw #0x4000, %sr
90
        ");
91
}
92
 
93
static inline void troff(void)
94
{
95
        __asm__ __volatile__ ("
96
        andiw #0x3fff, %sr
97
        ");
98
}
99
#endif
100
 
101
/*
102
 * Return saved PC of a blocked thread.
103
 */
104
extern inline unsigned long thread_saved_pc(struct thread_struct *t)
105
{
106
        /*extern unsigned long high_memory;*/
107
        unsigned long frame = ((struct switch_stack *)t->ksp)->a6;
108
        /*if (frame > PAGE_SIZE && frame < high_memory)*/
109
                return ((unsigned long *)frame)[1];
110
        /*else
111
                return 0;*/
112
}
113
 
114
#endif

powered by: WebSVN 2.1.0

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