This source file includes following definitions.
- sun4c_get_synchronous_error
- sun4c_get_synchronous_address
1
2
3
4
5
6 #ifndef _SPARC_PGTSUN4C_H
7 #define _SPARC_PGTSUN4C_H
8
9
10 #define SUN4C_PMD_SHIFT 22
11 #define SUN4C_PMD_SIZE (1UL << SUN4C_PMD_SHIFT)
12 #define SUN4C_PMD_MASK (~(SUN4C_PMD_SIZE-1))
13 #define SUN4C_PMD_ALIGN(addr) (((addr)+SUN4C_PMD_SIZE-1)&SUN4C_PMD_MASK)
14
15
16 #define SUN4C_PGDIR_SHIFT 22
17 #define SUN4C_PGDIR_SIZE (1UL << SUN4C_PGDIR_SHIFT)
18 #define SUN4C_PGDIR_MASK (~(SUN4C_PGDIR_SIZE-1))
19 #define SUN4C_PGDIR_ALIGN(addr) (((addr)+SUN4C_PGDIR_SIZE-1)&SUN4C_PGDIR_MASK)
20
21
22 #define SUN4C_REAL_PGDIR_SHIFT 18
23 #define SUN4C_REAL_PGDIR_SIZE (1UL << SUN4C_REAL_PGDIR_SHIFT)
24 #define SUN4C_REAL_PGDIR_MASK (~(SUN4C_REAL_PGDIR_SIZE-1))
25 #define SUN4C_REAL_PGDIR_ALIGN(addr) (((addr)+SUN4C_REAL_PGDIR_SIZE-1)&SUN4C_REAL_PGDIR_MASK)
26
27
28
29
30
31
32 #define SUN4C_PTRS_PER_PTE 1024
33 #define SUN4C_PTRS_PER_PMD 1
34 #define SUN4C_PTRS_PER_PGD 1024
35
36
37
38
39
40 #define SUN4C_VMALLOC_START (0xfe100000)
41
42
43
44
45 #define _SUN4C_PAGE_VALID 0x80000000
46 #define _SUN4C_PAGE_WRITE 0x40000000
47 #define _SUN4C_PAGE_PRIV 0x20000000
48 #define _SUN4C_PAGE_USER 0x00000000
49 #define _SUN4C_PAGE_NOCACHE 0x10000000
50 #define _SUN4C_PAGE_IO 0x04000000
51 #define _SUN4C_PAGE_REF 0x02000000
52 #define _SUN4C_PAGE_DIRTY 0x01000000
53 #define _SUN4C_PAGE_COW 0x00800000
54
55
56
57
58
59 #define _SUN4C_PAGE_CHG_MASK (0xffff | _SUN4C_PAGE_REF | _SUN4C_PAGE_DIRTY)
60
61 #define SUN4C_PAGE_NONE __pgprot(_SUN4C_PAGE_VALID | _SUN4C_PAGE_PRIV | \
62 _SUN4C_PAGE_REF)
63 #define SUN4C_PAGE_SHARED __pgprot(_SUN4C_PAGE_VALID | _SUN4C_PAGE_WRITE | \
64 _SUN4C_PAGE_USER | _SUN4C_PAGE_REF)
65 #define SUN4C_PAGE_COPY __pgprot(_SUN4C_PAGE_VALID | _SUN4C_PAGE_USER | \
66 _SUN4C_PAGE_REF | _SUN4C_PAGE_COW)
67 #define SUN4C_PAGE_READONLY __pgprot(_SUN4C_PAGE_VALID | _SUN4C_PAGE_USER | \
68 _SUN4C_PAGE_REF)
69 #define SUN4C_PAGE_KERNEL __pgprot(_SUN4C_PAGE_VALID | _SUN4C_PAGE_WRITE | \
70 _SUN4C_PAGE_PRIV | _SUN4C_PAGE_DIRTY | \
71 _SUN4C_PAGE_REF)
72 #define SUN4C_PAGE_INVALID __pgprot(0)
73
74 struct pseg_list {
75 struct pseg_list *next;
76 struct pseg_list *prev;
77 struct pseg_list *ctx_next;
78 struct pseg_list *ctx_prev;
79 unsigned long vaddr;
80 unsigned char context;
81 unsigned char pseg;
82 unsigned ref_cnt:21,
83 hardlock:1;
84 };
85
86 extern char *sun4c_lockarea(char *vaddr, unsigned long size);
87 extern void sun4c_unlockarea(char *vaddr, unsigned long size);
88
89 extern __inline__ unsigned long sun4c_get_synchronous_error(void)
90 {
91 unsigned long sync_err;
92
93 __asm__ __volatile__("lda [%1] %2, %0\n\t" :
94 "=r" (sync_err) :
95 "r" (AC_SYNC_ERR), "i" (ASI_CONTROL));
96 return sync_err;
97 }
98
99 extern __inline__ unsigned long sun4c_get_synchronous_address(void)
100 {
101 unsigned long sync_addr;
102
103 __asm__ __volatile__("lda [%1] %2, %0\n\t" :
104 "=r" (sync_addr) :
105 "r" (AC_SYNC_VA), "i" (ASI_CONTROL));
106 return sync_addr;
107 }
108
109 #endif