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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [asm-m68knommu/] [processor.h] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
/*
2
 * include/asm-m68k/processor.h
3
 *
4
 * Copyright (C) 1995 Hamish Macdonald
5
 */
6
 
7
#ifndef __ASM_M68K_PROCESSOR_H
8
#define __ASM_M68K_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 m68k 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
/*
37
 * if you change this structure, you must change the code and offsets
38
 * in m68k/machasm.S
39
 */
40
 
41
struct thread_struct {
42
        unsigned long  ksp;             /* kernel stack pointer */
43
        unsigned long  usp;             /* user stack pointer */
44
        unsigned short sr;              /* saved status register */
45
        unsigned short fs;              /* saved fs (sfc, dfc) */
46
        unsigned long  crp[2];          /* cpu root pointer */
47
        unsigned long  esp0;            /* points to SR of stack frame */
48
        unsigned long  fp[8*3];
49
        unsigned long  fpcntl[3];       /* fp control regs */
50
        unsigned char  fpstate[FPSTATESIZE];  /* floating point state */
51
};
52
 
53
#define INIT_MMAP { &init_mm, 0, 0x40000000, __pgprot(_PAGE_PRESENT|_PAGE_ACCESSED), VM_READ | VM_WRITE | VM_EXEC }
54
 
55
#define INIT_TSS  { \
56
        sizeof(init_kernel_stack) + (long) init_kernel_stack, 0, \
57
        PS_S, KERNEL_DS, \
58
        {0, 0}, 0, {0,}, {0, 0, 0}, {0,} \
59
}
60
 
61
#define alloc_kernel_stack()    __get_free_page(GFP_KERNEL)
62
#define free_kernel_stack(page) free_page((page))
63
 
64
/*
65
 * Do necessary setup to start up a newly executed thread.
66
 */
67
static inline void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long a5,
68
                                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->d5 = a5; /* What, me cheat? */
79
        regs->sr &= ~0x2000;
80
        /*regs->sr |= 0x4000; */  /* Trace on */
81
        wrusp(usp);
82
}
83
 
84
#ifndef CONFIG_COLDFIRE
85
static inline void tron(void)
86
{
87
        __asm__ __volatile__ ("
88
        oriw #0x8000, %sr
89
        ");
90
}
91
 
92
static inline void troncof(void)
93
{
94
        __asm__ __volatile__ ("
95
        oriw #0x4000, %sr
96
        ");
97
}
98
 
99
static inline void troff(void)
100
{
101
        __asm__ __volatile__ ("
102
        andiw #0x3fff, %sr
103
        ");
104
}
105
#endif
106
 
107
/*
108
 * Return saved PC of a blocked thread.
109
 */
110
extern inline unsigned long thread_saved_pc(struct thread_struct *t)
111
{
112
        /*extern unsigned long high_memory;*/
113
        unsigned long frame = ((struct switch_stack *)t->ksp)->a6;
114
        /*if (frame > PAGE_SIZE && frame < high_memory)*/
115
                return ((unsigned long *)frame)[1];
116
        /*else
117
                return 0;*/
118
}
119
 
120
#endif

powered by: WebSVN 2.1.0

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