This source file includes following definitions.
- check_dscr
- dscr_user
- main
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #include "dscr.h"
20
21 static int check_dscr(char *str)
22 {
23 unsigned long cur_dscr, cur_dscr_usr;
24
25 cur_dscr = get_dscr();
26 cur_dscr_usr = get_dscr_usr();
27 if (cur_dscr != cur_dscr_usr) {
28 printf("%s set, kernel get %lx != user get %lx\n",
29 str, cur_dscr, cur_dscr_usr);
30 return 1;
31 }
32 return 0;
33 }
34
35 int dscr_user(void)
36 {
37 int i;
38
39 check_dscr("");
40
41 for (i = 0; i < COUNT; i++) {
42 set_dscr(i);
43 if (check_dscr("kernel"))
44 return 1;
45 }
46
47 for (i = 0; i < COUNT; i++) {
48 set_dscr_usr(i);
49 if (check_dscr("user"))
50 return 1;
51 }
52 return 0;
53 }
54
55 int main(int argc, char *argv[])
56 {
57 return test_harness(dscr_user, "dscr_user_test");
58 }