1 |
149 |
jeremybenn |
typedef BYTE unsigned char; /* { dg-error "expected" } */
|
2 |
|
|
typedef int item_n;
|
3 |
|
|
typedef int perm_set;
|
4 |
|
|
struct PENT { caddr_t v_addr; };/* { dg-error "expected" } */
|
5 |
|
|
typedef struct PENT prec;
|
6 |
|
|
typedef struct PENT *prec_t;
|
7 |
|
|
prec_t mem_hash;
|
8 |
|
|
BYTE *mem_base; /* { dg-error "expected" } */
|
9 |
|
|
struct PTE {
|
10 |
|
|
BYTE *p_page; /* { dg-error "expected" } */
|
11 |
|
|
perm_set p_perms;
|
12 |
|
|
};
|
13 |
|
|
typedef struct PTE pte;
|
14 |
|
|
struct PTP {
|
15 |
|
|
union {
|
16 |
|
|
struct *PTP p_tablep; /* { dg-error "expected" } */
|
17 |
|
|
struct *PTE p_entry;
|
18 |
|
|
} u;
|
19 |
|
|
int valid;
|
20 |
|
|
};
|
21 |
|
|
typedef struct PTP (u.p_tablep);/* { dg-error "expected" } */
|
22 |
|
|
int pfree=0;
|
23 |
|
|
int pcount=0;
|
24 |
|
|
|
25 |
|
|
void
|
26 |
|
|
mmu_walk_find(va)
|
27 |
|
|
caddr_t va; /* { dg-error "expected" } */
|
28 |
|
|
{
|
29 |
|
|
BYTE *page_addr; /* { dg-error "undeclared|for each function" } */
|
30 |
|
|
if (mmu_base[Level1(va)]->valid==0x0) { /* { dg-error "undeclared" } */
|
31 |
|
|
l1_base = mmu_base[Level1(va)]->(u.p_tablep) = p_alloc(); /* { dg-error "expected|undeclared" } */
|
32 |
|
|
mmu_base[Level1(va)]->valid = 0x3;
|
33 |
|
|
for (idx=0; idx<LEVEL1_ENTRIES; idx++) /* { dg-error "undeclared" } */
|
34 |
|
|
l1_base[idx]->valid = 0x0;
|
35 |
|
|
goto build_level2;
|
36 |
|
|
} else
|
37 |
|
|
l1_base = mmu_base[Level1(va)]->(u.p_tablep); /* { dg-error "expected" } */
|
38 |
|
|
|
39 |
|
|
if (l1_base[Level2(va)]->valid==0x0) {
|
40 |
|
|
build_level2:
|
41 |
|
|
l2_base = l1_base[Level2(va)]->(u.p_tablep) = p_alloc(); /* { dg-error "expected|undeclared" } */
|
42 |
|
|
l1_base[Level2(va)]->valid = 0x3;
|
43 |
|
|
for (idx=0; idx<LEVEL2_ENTRIES; idx++) /* { dg-error "undeclared" } */
|
44 |
|
|
l2_base[idx]->valid=0x0;
|
45 |
|
|
goto build_page; /* { dg-error "used but not defined" } */
|
46 |
|
|
} else
|
47 |
|
|
l2_base = mmu_base[Level2(va)]->(u.p_tablep); /* { dg-error "expected" } */
|
48 |
|
|
|
49 |
|
|
page_addr = l2_base[Level2(va)]->valid;
|
50 |
|
|
}
|
51 |
|
|
|
52 |
|
|
void *
|
53 |
|
|
a_translate(va_op, v_addr)
|
54 |
|
|
int va_op;
|
55 |
|
|
caddr_t v_addr; /* { dg-error "expected" } */
|
56 |
|
|
{
|
57 |
|
|
register prec_t bucket;
|
58 |
|
|
register caddr_t p_addr; /* { dg-error "expected|undeclared" } */
|
59 |
|
|
bucket = mem_hash+((((v_addr)>>ITEMBITS))&hash_mask); /* { dg-error "undeclared" } */
|
60 |
|
|
do {
|
61 |
|
|
if (bucket->v_addr == ((v_addr)>>ITEMBITS) { /* { dg-error "expected|undeclared|no member" } */
|
62 |
|
|
if(!(bucket->perm_set&va_op))
|
63 |
|
|
goto prot_fault;
|
64 |
|
|
return mem_base + v_addr;
|
65 |
|
|
}
|
66 |
|
|
} while((bucket++)->v_addr != ((caddr_t)0)); /* { dg-error "expected|undeclared|no member" } */
|
67 |
|
|
|
68 |
|
|
page_miss:
|
69 |
|
|
p_addr = (--bucket)->p_addr; /* { dg-error "no member" } */
|
70 |
|
|
page_type:
|
71 |
|
|
switch (p_addr) {
|
72 |
|
|
case BUCKET_FULL: /* { dg-error "undeclared" } */
|
73 |
|
|
enlarge_hash_table(mem_hash);
|
74 |
|
|
case((caddr_t)0): /* { dg-error "expected" } */
|
75 |
|
|
p_addr = fill_item_entry(va_op, v_addr);
|
76 |
|
|
goto page_type;
|
77 |
|
|
case((caddr_t)1): /* { dg-error "expected" } */
|
78 |
|
|
default:
|
79 |
|
|
((void)(((0))?0:(__eprintf("Failed assertion`%s'at line%d of`%s'.\n",
|
80 |
|
|
"FALSE", 327, "b.c"), 0)));
|
81 |
|
|
}
|
82 |
|
|
}
|
83 |
|
|
|
84 |
|
|
void
|
85 |
|
|
flush_hash(hasht, hash_size)
|
86 |
|
|
prec_t hasht;
|
87 |
|
|
int hash_size;
|
88 |
|
|
{
|
89 |
|
|
register prec_t bucket;
|
90 |
|
|
register int idx;
|
91 |
|
|
bucket = hasht;
|
92 |
|
|
for(idx=(hash_size*3)-1; idx>=0; idx--) {
|
93 |
|
|
bucket->v_addr = ((caddr_t)0);/* { dg-error "undeclared|expected|no member" } */
|
94 |
|
|
bucket->p_addr = ((caddr_t)0);/* { dg-error "no member|expected" } */
|
95 |
|
|
bucket->perm_set = VA_EMPTY; /* { dg-error "undeclared|no member" } */
|
96 |
|
|
}
|
97 |
|
|
}
|
98 |
|
|
|
99 |
|
|
extern void *calloc(__SIZE_TYPE__, __SIZE_TYPE__);
|
100 |
|
|
|
101 |
|
|
void
|
102 |
|
|
init_mem()
|
103 |
|
|
{
|
104 |
|
|
mem_base = (BYTE *) calloc(1024, (1<<13)); /* { dg-error "undeclared|expected" } */
|
105 |
|
|
((void)((mem_base != (BYTE *)0) /* { dg-error "expected" } */
|
106 |
|
|
? 0
|
107 |
|
|
: (__eprintf("Failed assertion`%s'at line%d of`%s'.\n",
|
108 |
|
|
"mem_base != (BYTE *)0", 366, "b.c"),
|
109 |
|
|
0)));
|
110 |
|
|
hash_num = INIT_NUM_ENTRIES * 3; /* { dg-error "undeclared" } */
|
111 |
|
|
mem_hash = (prec_t) calloc(hash_num, sizeof(prec));
|
112 |
|
|
((void)((mem_hash != (prec_t)0)
|
113 |
|
|
? 0
|
114 |
|
|
: (__eprintf("Failed assertion`%s'at line%d of`%s'.\n",
|
115 |
|
|
"mem_hash != (prec_t)0", 370, "b.c"),
|
116 |
|
|
0)));
|
117 |
|
|
flush_hash(mem_hash, 32);
|
118 |
|
|
build_ptables(mem_base, 1024*(1<<13)); /* { dg-bogus "integer overflow" "int smaller than 32 bits" { xfail int16 } } */
|
119 |
|
|
}
|
120 |
|
|
|
121 |
|
|
struct tm {
|
122 |
|
|
int tm_sec; int tm_min; int tm_hour;
|
123 |
|
|
int tm_mday;int tm_mon; int tm_year;
|
124 |
|
|
int tm_wday;int tm_yday;int tm_isdst;
|
125 |
|
|
char*tm_zone; long tm_gmtoff;
|
126 |
|
|
};
|