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

Subversion Repositories or1k

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

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 <asm/segment.h>
11
 
12
/*
13
 * User space process size: 3.75GB. This is hardcoded into a few places,
14
 * so don't change it unless you know what you are doing.
15
 */
16
#define TASK_SIZE       (0xF0000000UL)
17
#define MAX_USER_ADDR   TASK_SIZE
18
#define MMAP_SEARCH_START (TASK_SIZE/3)
19
 
20
/*
21
 * Bus types
22
 */
23
#define EISA_bus__is_a_macro    1
24
#define EISA_bus 0
25
#define MCA_bus__is_a_macro     1
26
#define MCA_bus 0
27
 
28
/*
29
 * The m68k has no problems with write protection
30
 */
31
#define wp_works_ok__is_a_macro 1
32
#define wp_works_ok 1
33
 
34
/* MAX floating point unit state size (FSAVE/FRESTORE) */
35
#define FPSTATESIZE   (216/sizeof(unsigned short))
36
 
37
/*
38
 * if you change this structure, you must change the code and offsets
39
 * in m68k/machasm.S
40
 */
41
 
42
struct thread_struct {
43
        unsigned long  ksp;             /* kernel stack pointer */
44
        unsigned long  usp;             /* user stack pointer */
45
        unsigned short sr;              /* saved status register */
46
        unsigned short fs;              /* saved fs (sfc, dfc) */
47
        unsigned long  *pagedir_v;      /* root page table virtual addr */
48
        unsigned long  pagedir_p;       /* root page table physaddr */
49
        unsigned long  crp[2];          /* cpu root pointer */
50
        unsigned long  esp0;            /* points to SR of stack frame */
51
        unsigned long  fp[8*3];
52
        unsigned long  fpcntl[3];       /* fp control regs */
53
        unsigned short fpstate[FPSTATESIZE];  /* floating point state */
54
};
55
 
56
#define INIT_MMAP { &init_mm, 0, 0x40000000, __pgprot(_PAGE_PRESENT|_PAGE_ACCESSED), VM_READ | VM_WRITE | VM_EXEC }
57
 
58
#define INIT_TSS  { \
59
        sizeof(init_kernel_stack) + (long) init_kernel_stack, 0, \
60
        PS_S, KERNEL_DS, \
61
        NULL, 0, {0, 0}, 0 \
62
}
63
 
64
#define alloc_kernel_stack()    get_free_page(GFP_KERNEL)
65
#define free_kernel_stack(page) free_page((page))
66
 
67
/*
68
 * Do necessary setup to start up a newly executed thread.
69
 */
70
static inline void start_thread(struct pt_regs * regs, unsigned long pc,
71
                                unsigned long usp)
72
{
73
        unsigned long nilstate = 0;
74
 
75
        /* clear floating point state */
76
        __asm__ __volatile__ ("frestore %0@" : : "a" (&nilstate));
77
 
78
        /* reads from user space */
79
        set_fs(USER_DS);
80
 
81
        regs->pc = pc;
82
        regs->sr &= ~0x2000;
83
        wrusp(usp);
84
}
85
 
86
/*
87
 * Return saved PC of a blocked thread.
88
 */
89
extern inline unsigned long thread_saved_pc(struct thread_struct *t)
90
{
91
        return ((unsigned long *)((struct switch_stack *)t->ksp)->a6)[1];
92
}
93
 
94
#endif

powered by: WebSVN 2.1.0

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