Rev 2131 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2131 | Rev 2178 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /* |
1 | /* |
2 | * Copyright (c) 2003-2004 Jakub Jermar |
2 | * Copyright (c) 2007 Michal Kebrt |
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: |
Line 36... | Line 36... | ||
36 | #define KERN_arm32_EXCEPTION_H_ |
36 | #define KERN_arm32_EXCEPTION_H_ |
37 | 37 | ||
38 | #include <arch/types.h> |
38 | #include <arch/types.h> |
39 | 39 | ||
40 | typedef struct { |
40 | typedef struct { |
- | 41 | ||
- | 42 | uint32_t cpsr; |
|
- | 43 | uint32_t retaddr; |
|
- | 44 | ||
- | 45 | uint32_t r0; |
|
- | 46 | uint32_t r1; |
|
- | 47 | uint32_t r2; |
|
41 | /* TODO */ |
48 | uint32_t r3; |
- | 49 | uint32_t r4; |
|
- | 50 | uint32_t r5; |
|
- | 51 | uint32_t r6; |
|
- | 52 | uint32_t r7; |
|
- | 53 | uint32_t r8; |
|
- | 54 | uint32_t r10; |
|
- | 55 | uint32_t r11; |
|
- | 56 | uint32_t r12; |
|
- | 57 | uint32_t sp; |
|
- | 58 | uint32_t lr; |
|
- | 59 | ||
42 | } istate_t; |
60 | } istate_t; |
43 | 61 | ||
44 | static inline void istate_set_retaddr(istate_t *istate, uintptr_t retaddr) |
62 | static inline void istate_set_retaddr(istate_t *istate, uintptr_t retaddr) |
45 | { |
63 | { |
46 | /* TODO */ |
64 | istate->retaddr = retaddr; |
47 | } |
65 | } |
48 | 66 | ||
49 | /** Return true if exception happened while in userspace */ |
67 | /** Return true if exception happened while in userspace */ |
50 | static inline int istate_from_uspace(istate_t *istate) |
68 | static inline int istate_from_uspace(istate_t *istate) |
51 | { |
69 | { |
52 | /* TODO */ |
- | |
53 | return 0; |
70 | return !(istate->retaddr & 0x80000000); |
54 | } |
71 | } |
55 | static inline unative_t istate_get_pc(istate_t *istate) |
72 | static inline unative_t istate_get_pc(istate_t *istate) |
56 | { |
73 | { |
57 | /* TODO */ |
- | |
58 | return 0; |
74 | return istate->retaddr; |
59 | } |
75 | } |
60 | 76 | ||
61 | #endif |
77 | #endif |
62 | 78 | ||
63 | /** @} |
79 | /** @} |