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

Subversion Repositories or1k_soc_on_altera_embedded_dev_kit

[/] [or1k_soc_on_altera_embedded_dev_kit/] [trunk/] [linux-2.6/] [linux-2.6.24/] [include/] [asm-or32/] [processor.h] - Blame information for rev 7

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 7 xianfeng
/*
2
 * include/asm-or32/processor.h
3
 *
4
 * Based on:
5
 * include/asm-cris/processor.h
6
 * Copyright (C) 2000, 2001, 2002 Axis Communications AB
7
 *
8
 */
9
 
10
#ifndef _OR32_PROCESSOR_H
11
#define _OR32_PROCESSOR_H
12
 
13
#include <asm/spr_defs.h>
14
#include <asm/page.h>
15
#include <asm/ptrace.h>
16
 
17
/* Kernel and user SR register setting */
18
#define KERNEL_SR (SPR_SR_DME | SPR_SR_IME | SPR_SR_ICE | SPR_SR_DCE | SPR_SR_SM)
19
#define USER_SR   (SPR_SR_DME | SPR_SR_IME | SPR_SR_ICE | SPR_SR_DCE | SPR_SR_IEE | SPR_SR_TEE)
20
/*
21
 * Default implementation of macro that returns current
22
 * instruction pointer ("program counter").
23
 */
24
#define current_text_addr() ({ __label__ _l; _l: &&_l;})
25
 
26
/* or32has no problems with write protection */
27
 
28
#define wp_works_ok 1
29
 
30
/*
31
 * User space process size. This is hardcoded into a few places,
32
 * so don't change it unless you know what you are doing.
33
 */
34
 
35
#define TASK_SIZE       (0x80000000UL)
36
 
37
/* This decides where the kernel will search for a free chunk of vm
38
 * space during mmap's.
39
 */
40
#define TASK_UNMAPPED_BASE      (TASK_SIZE / 8 * 3)
41
 
42
/* THREAD_SIZE is the size of the task_struct/kernel_stack combo.
43
 * normally, the stack is found by doing something like p + THREAD_SIZE
44
 * in or32, a page is 8192 bytes, which seems like a sane size
45
 */
46
 
47
#define THREAD_SIZE       PAGE_SIZE
48
 
49
#ifndef __ASSEMBLY__
50
 
51
struct task_struct;
52
 
53
typedef struct {
54
        unsigned long seg;
55
} mm_segment_t;
56
 
57
struct thread_struct {
58
        unsigned long  usp;     /* user space pointer */
59
        unsigned long  ksp;     /* kernel stack pointer */
60
        struct pt_regs *regs;   /* pointer to saved register state */
61
        mm_segment_t   fs;      /* for get_fs() validation */
62
        signed long    last_syscall;
63
};
64
 
65
/*
66
 * At user->kernel entry, the pt_regs struct is stacked on the top of the kernel-stack.
67
 * This macro allows us to find those regs for a task.
68
 * Notice that subsequent pt_regs stackings, like recursive interrupts occuring while
69
 * we're in the kernel, won't affect this - only the first user->kernel transition
70
 * registers are reached by this.
71
 */
72
#define user_regs(thread_info) (((struct pt_regs *)((unsigned long)(thread_info) + THREAD_SIZE)) - 1)
73
 
74
/*
75
 * Dito but for the currently running task
76
 */
77
 
78
#define current_regs() user_regs(current->thread_info)
79
 
80
extern inline void prepare_to_copy(struct task_struct *tsk)
81
{
82
}
83
 
84
#define INIT_SP         (sizeof(init_stack) + (unsigned long) &init_stack)
85
 
86
#define INIT_THREAD  { \
87
   0, INIT_SP, NULL, KERNEL_DS, 0 }
88
 
89
 
90
#define KSTK_EIP(tsk)   ((tsk)->thread.regs? (tsk)->thread.regs->pc: 0)
91
#define KSTK_ESP(tsk)   ((tsk)->thread.regs? (tsk)->thread.regs->sp: 0)
92
 
93
 
94
extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
95
 
96
void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp);
97
void release_thread(struct task_struct *);
98
unsigned long get_wchan(struct task_struct *p);
99
 
100
/*
101
 * Free current thread data structures etc..
102
 */
103
 
104
extern inline void exit_thread(void)
105
{
106
         /* Nothing needs to be done.  */
107
}
108
 
109
/*
110
 * Return saved PC of a blocked thread. For now, this is the "user" PC
111
 */
112
extern unsigned long thread_saved_pc(struct task_struct *t);
113
 
114
#define init_stack      (init_thread_union.stack)
115
 
116
#define cpu_relax()     do { } while (0)
117
 
118
#endif /* __ASSEMBLY__ */
119
#endif /* _OR32_PROCESSOR_H */

powered by: WebSVN 2.1.0

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