-
Notifications
You must be signed in to change notification settings - Fork 0
/
exceptions.c
62 lines (46 loc) · 915 Bytes
/
exceptions.c
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
#include<stdio.h>
#include <internal/thread_def.h>
#include <internal/trcctx_def.h>
void dtabort()
{
int a = 0xfffffff0;
*(int *)a = 1;
}
void prefatch1(int b, char c)
{
int_fn_t a;
a = 0xfffffff0;
a();
}
void undifined1()
{
__asm__ __volatile__ (".word 0xffffffff" : : );
}
void undifined2()
{
int_fn_t *a;
a = (int_fn_t *)malloc(100);
*(int_fn_t *)a = 0x3000ff00;
((int_fn_t)a)();
}
void fun2()
{
int b;
b = 999;
b /= 0;
printf("b = %d\n",b);
}
void prefatch2()
{
cpu_regset_t regset;
thread_attr_t attrib;
thread_entry_param_t params;
int tid;
attrib.name = "trc-test";
attrib.priority = 50;
attrib.options = 0;
attrib.stack_size = 40000;
bzero((char *)¶ms, sizeof(thread_entry_param_t));
tid = kt_thread_set_up(&attrib, (int_fn_t)0x3000ff00, ¶ms, TRUE);
kt_thread_pause(2);
}