Subversion Repositories HelenOS

Rev

Rev 220 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 220 Rev 238
1
/*
1
/*
2
 * Copyright (C) 2005 Jakub Vana
2
 * Copyright (C) 2005 Jakub Vana
3
 * All rights reserved.
3
 * All rights reserved.
4
 *
4
 *
5
 * Redistribution and use in source and binary forms, with or without
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
6
 * modification, are permitted provided that the following conditions
7
 * are met:
7
 * are met:
8
 *
8
 *
9
 * - Redistributions of source code must retain the above copyright
9
 * - Redistributions of source code must retain the above copyright
10
 *   notice, this list of conditions and the following disclaimer.
10
 *   notice, this list of conditions and the following disclaimer.
11
 * - Redistributions in binary form must reproduce the above copyright
11
 * - Redistributions in binary form must reproduce the above copyright
12
 *   notice, this list of conditions and the following disclaimer in the
12
 *   notice, this list of conditions and the following disclaimer in the
13
 *   documentation and/or other materials provided with the distribution.
13
 *   documentation and/or other materials provided with the distribution.
14
 * - The name of the author may not be used to endorse or promote products
14
 * - The name of the author may not be used to endorse or promote products
15
 *   derived from this software without specific prior written permission.
15
 *   derived from this software without specific prior written permission.
16
 *
16
 *
17
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 *
27
 *
28
 */
28
 */
29
 
29
 
30
 
30
 
31
#include <panic.h>
31
#include <panic.h>
-
 
32
#include <print.h>
32
#include <arch/types.h>
33
#include <arch/types.h>
-
 
34
#include <arch/asm.h>
-
 
35
 
-
 
36
extern __u64 REG_DUMP;
33
 
37
 
34
 
38
 
35
void general_exception(void);
39
void general_exception(void);
36
void general_exception(void)
40
void general_exception(void)
37
{
41
{
38
    panic("\nGeneral Exception\n");
42
    panic("\nGeneral Exception\n");
39
}
43
}
40
 
44
 
41
 
45
 
42
 
46
 
43
void break_instruction(void);
47
void break_instruction(void);
44
void break_instruction(void)
48
void break_instruction(void)
45
{
49
{
46
    panic("\nBreak Instruction\n");
50
    panic("\nBreak Instruction\n");
47
}
51
}
48
 
52
 
49
 
53
 
-
 
54
#define cr_dump(r) {__u64 val; get_control_register(r,val); printf("cr"#r":%Q\n",val);}
-
 
55
#define ar_dump(r) {__u64 val; get_aplication_register(r,val); printf("ar"#r":%Q\n",val);}
-
 
56
 
50
void universal_handler(void);
57
void universal_handler(void);
51
void universal_handler(void)
58
void universal_handler(void)
52
{
59
{
-
 
60
    __u64 vector,psr;
53
    __u64 i;
61
    __u64 *p;
-
 
62
    int i;
-
 
63
   
-
 
64
   
-
 
65
    get_shadow_register(16,vector);
-
 
66
 
-
 
67
   
-
 
68
    p=&REG_DUMP;
-
 
69
 
-
 
70
    for(i=0;i<128;i+=2) printf("gr%d:%Q\tgr%d:%Q\n",i,p[i],i+1,p[i+1]);
-
 
71
 
54
 
72
 
-
 
73
    cr_dump(0);
55
    __asm__ (
74
    cr_dump(1);
56
        "mov  %0 = r12;;"
75
    cr_dump(2);
57
        : "=r" (i)
76
    cr_dump(8);
-
 
77
    cr_dump(16);   
-
 
78
    cr_dump(17);   
-
 
79
    cr_dump(19);   
-
 
80
    cr_dump(20);   
-
 
81
    cr_dump(21);   
-
 
82
    cr_dump(22);   
-
 
83
    cr_dump(23);   
-
 
84
    cr_dump(24);   
-
 
85
    cr_dump(25);   
-
 
86
    cr_dump(64);   
-
 
87
    cr_dump(65);   
-
 
88
    cr_dump(66);   
-
 
89
    cr_dump(67);   
-
 
90
    cr_dump(68);   
-
 
91
    cr_dump(69);   
-
 
92
    cr_dump(70);   
-
 
93
    cr_dump(71);   
-
 
94
    cr_dump(72);   
-
 
95
    cr_dump(73);   
-
 
96
    cr_dump(74);   
-
 
97
    cr_dump(80);   
-
 
98
    cr_dump(81);   
58
        :
99
   
-
 
100
    ar_dump(0);
-
 
101
    ar_dump(1);
-
 
102
    ar_dump(2);
-
 
103
    ar_dump(3);
-
 
104
    ar_dump(4);
59
        : "r15"
105
    ar_dump(5);
-
 
106
    ar_dump(6);
-
 
107
    ar_dump(7);
-
 
108
    ar_dump(16);   
-
 
109
    ar_dump(17);   
-
 
110
    ar_dump(18);   
-
 
111
    ar_dump(19);   
-
 
112
    ar_dump(21);   
-
 
113
    ar_dump(24);   
-
 
114
    ar_dump(25);   
-
 
115
    ar_dump(26);   
-
 
116
    ar_dump(27);   
-
 
117
    ar_dump(28);   
-
 
118
    ar_dump(29);   
-
 
119
    ar_dump(30);   
-
 
120
    ar_dump(32);   
-
 
121
    ar_dump(36);   
-
 
122
    ar_dump(40);   
-
 
123
    ar_dump(44);   
-
 
124
    ar_dump(64);   
-
 
125
    ar_dump(65);   
-
 
126
    ar_dump(66);   
60
    );
127
 
-
 
128
    get_psr(psr);
61
 
129
 
-
 
130
    printf("\nPSR:%Q\n",psr);
-
 
131
   
62
    panic("\nException:%Q\n",i);
132
    panic("\nException:%Q\n",vector);
63
}
133
}
64
 
134
 
65
 
135
 
66
 
136