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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [asm-armnommu/] [proc-trio/] [processor.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
/*
2
 * linux/include/asm-arm/proc-armv/processor.h
3
 *
4
 * Copyright (c) 1996 Russell King.
5
 *
6
 * Changelog:
7
 *  20-09-1996  RMK     Created
8
 *  26-09-1996  RMK     Added 'EXTRA_THREAD_STRUCT*'
9
 *  28-09-1996  RMK     Moved start_thread into the processor dependencies
10
 */
11
#ifndef __ASM_PROC_PROCESSOR_H
12
#define __ASM_PROC_PROCESSOR_H
13
 
14
#ifdef __KERNEL__
15
 
16
#define KERNEL_STACK_SIZE       PAGE_SIZE
17
#define alloc_kernel_stack()    __get_free_page(GFP_KERNEL)
18
#define free_kernel_stack(page) free_page((page))
19
 
20
/*
21
 * on arm2,3 wp does not work
22
 */
23
#define wp_works_ok 0
24
#define wp_works_ok__is_a_macro /* for versions in ksyms.c */
25
 
26
struct context_save_struct {
27
        unsigned long cpsr;
28
        unsigned long r4;
29
        unsigned long r5;
30
        unsigned long r6;
31
        unsigned long r7;
32
        unsigned long r8;
33
        unsigned long r9;
34
        unsigned long fp;
35
        unsigned long pc;
36
};
37
 
38
#define EXTRA_THREAD_STRUCT                             \
39
        struct context_save_struct *save;               \
40
        unsigned long memmap;
41
 
42
#define EXTRA_THREAD_STRUCT_INIT                        \
43
        0,                                               \
44
        ((unsigned long) swapper_pg_dir) - PAGE_OFFSET
45
 
46
DECLARE_THREAD_STRUCT;
47
 
48
/*
49
 * Return saved PC of a blocked thread.
50
 */
51
extern __inline__ unsigned long thread_saved_pc (struct thread_struct *t)
52
{
53
        if (t->save)
54
                return t->save->pc;
55
        else
56
                return 0;
57
}
58
 
59
extern __inline__ unsigned long get_css_fp (struct thread_struct *t)
60
{
61
        if (t->save)
62
                return t->save->fp;
63
        else
64
                return 0;
65
}
66
 
67
asmlinkage void ret_from_sys_call(void) __asm__("_ret_from_sys_call");
68
 
69
extern __inline__ void copy_thread_css (struct context_save_struct *save)
70
{
71
        save->cpsr = SVC_MODE;
72
        save->r4 =
73
        save->r5 =
74
        save->r6 =
75
        save->r7 =
76
        save->r8 =
77
        save->r9 =
78
        save->fp = 0;
79
        save->pc = (unsigned long) ret_from_sys_call;
80
}
81
 
82
#define start_thread(regs,pc,sp)                                        \
83
({                                                                      \
84
        unsigned long *stack = (unsigned long *)sp;                     \
85
        set_fs(USER_DS);                                                \
86
        memzero(regs->uregs, sizeof(regs->uregs));                      \
87
        if (current->personality == PER_LINUX_32BIT)                    \
88
                regs->ARM_cpsr = USR_MODE;                              \
89
        else                                                            \
90
                regs->ARM_cpsr = USR26_MODE;                            \
91
        regs->ARM_pc = pc;              /* pc */                        \
92
        regs->ARM_sp = sp;              /* sp */                        \
93
        regs->ARM_r2 = stack[2];        /* r2 (envp) */                 \
94
        regs->ARM_r1 = stack[1];        /* r1 (argv) */                 \
95
        regs->ARM_r0 = stack[0]; /* r0 (argc) */                 \
96
})
97
 
98
#endif
99
 
100
#endif

powered by: WebSVN 2.1.0

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