File: processor.h

package info (click to toggle)
kernel-source-2.0.35 2.0.35-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 32,456 kB
  • ctags: 94,327
  • sloc: ansic: 587,014; asm: 26,388; makefile: 4,055; sh: 1,221; perl: 727; tcl: 408; cpp: 277; lisp: 211; awk: 134
file content (97 lines) | stat: -rw-r--r-- 2,566 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*
 * include/asm-alpha/processor.h
 *
 * Copyright (C) 1994 Linus Torvalds
 */

#ifndef __ASM_ALPHA_PROCESSOR_H
#define __ASM_ALPHA_PROCESSOR_H

/*
 * We have a 41-bit user address space: 2TB user VM.
 * Under certain circumstances (e.g. when emulating 32-bit code)
 * we may want to voluntarily limit this...
 */
#define TASK_SIZE (0x40000000000UL)
#define MAX_USER_ADDR ((current->personality&ADDR_MAX_32BIT) ? 0x100000000UL : \
	((current->personality & ADDR_MAX_31BIT) ? 0x80000000UL : \
							0x40000000000UL))
#define MMAP_SEARCH_START ((current->personality & ADDR_MAX_31BIT) ? \
			(MAX_USER_ADDR/2) : (MAX_USER_ADDR/3))


/*
 * Bus types
 */
#define EISA_bus 1
#define EISA_bus__is_a_macro /* for versions in ksyms.c */
#define MCA_bus 0
#define MCA_bus__is_a_macro /* for versions in ksyms.c */

/*
 * The alpha has no problems with write protection
 */
#define wp_works_ok 1
#define wp_works_ok__is_a_macro /* for versions in ksyms.c */

struct thread_struct {
	/* the fields below are used by PALcode and must match struct pcb: */
	unsigned long ksp;
	unsigned long usp;
	unsigned long ptbr;
	unsigned int pcc;
	unsigned int asn;
	unsigned long unique;
	/*
	 * bit  0: floating point enable
	 * bit 62: performance monitor enable
	 */
	unsigned long pal_flags;
	unsigned long res1, res2;

	/* the fields below are Linux-specific: */
	/*
	 * bit 0:	perform syscall argument validation (get/set_fs)
	 * bit 1..5:	IEEE_TRAP_ENABLE bits (see fpu.h)
	 * bit 17..21:	IEEE_STATUS bits (see fpu.h)
	 */
	unsigned long flags;
};

#define INIT_MMAP { &init_mm, 0xfffffc0000000000,  0xfffffc0010000000, \
	PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC }

#define INIT_TSS  { \
	0, 0, 0, \
	0, 0, 0, \
	0, 0, 0, \
	0 \
}

#define alloc_kernel_stack()    __get_free_page(GFP_KERNEL)
#define free_kernel_stack(page) free_page((page))

#include <asm/ptrace.h>

/*
 * Return saved PC of a blocked thread.  This assumes the frame
 * pointer is the 6th saved long on the kernel stack and that the
 * saved return address is the first long in the frame.  This all
 * holds provided the thread blocked through a call to schedule() ($15
 * is the frame pointer in schedule() and $15 is saved at offset 48 by
 * entry.S:do_switch_stack).
 */
extern inline unsigned long thread_saved_pc(struct thread_struct *t)
{
	unsigned long fp;

	fp = ((unsigned long*)t->ksp)[6];
	return *(unsigned long*)fp;
}

/*
 * Do necessary setup to start up a newly executed thread.
 */
extern void start_thread(struct pt_regs *, unsigned long, unsigned long);

#endif /* __ASM_ALPHA_PROCESSOR_H */