FreeNOS
lib
libarch
arm64
ARM64Exception.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2025 Ivan Tan
3
* Copyright (C) 2015 Niek Linnenbank
4
*
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
19
#ifndef __LIBARCH_ARM64_EXCEPTION_H
20
#define __LIBARCH_ARM64_EXCEPTION_H
21
22
#include <
Types.h
>
23
#include <
IntController.h
>
24
26
struct
CPUState
;
27
40
#define ARM64_EX_VECTAB_SIZE (64)
41
45
class
ARM64Exception
46
{
47
public
:
48
52
enum
ExceptionType
53
{
54
Sync_SP_EL0
= 0,
55
IRQ_SP_EL0
,
56
FIQ_SP_EL0
,
57
SError_SP_EL0
,
58
Sync_SP_ELx
,
59
IRQ_SP_ELx
,
60
FIQ_SP_ELx
,
61
SError_SP_ELx
,
62
Sync_Lower_EL
,
63
IRQ_Lower_EL
,
64
FIQ_Lower_EL
,
65
SError_Lower_EL
,
66
Sync_Lower_EL_AA32
,
67
IRQ_Lower_EL_AA32
,
68
FIQ_Lower_EL_AA32
,
69
SError_Lower_EL_AA32
,
70
};
71
75
enum
Result
76
{
77
Success
,
78
NotFound
,
79
IOError
80
};
81
87
typedef
void
Handler
(
struct
CPUState
state);
88
89
public
:
90
95
ARM64Exception
();
96
105
Result
install
(
ExceptionType
vector,
Handler
handler);
106
107
private
:
108
120
Address
m_vecTable
;
121
};
122
129
#endif
/* __LIBARCH_ARM64_EXCEPTION_H */
IntController.h
Types.h
ARM64Exception
ARM64 exception handling functionality.
Definition
ARM64Exception.h:46
ARM64Exception::Result
Result
Result codes.
Definition
ARM64Exception.h:76
ARM64Exception::IOError
@ IOError
Definition
ARM64Exception.h:79
ARM64Exception::NotFound
@ NotFound
Definition
ARM64Exception.h:78
ARM64Exception::Success
@ Success
Definition
ARM64Exception.h:77
ARM64Exception::ExceptionType
ExceptionType
ARM64 exception types.
Definition
ARM64Exception.h:53
ARM64Exception::FIQ_SP_ELx
@ FIQ_SP_ELx
Definition
ARM64Exception.h:60
ARM64Exception::FIQ_Lower_EL
@ FIQ_Lower_EL
Definition
ARM64Exception.h:64
ARM64Exception::SError_SP_ELx
@ SError_SP_ELx
Definition
ARM64Exception.h:61
ARM64Exception::Sync_Lower_EL
@ Sync_Lower_EL
Definition
ARM64Exception.h:62
ARM64Exception::Sync_SP_ELx
@ Sync_SP_ELx
Definition
ARM64Exception.h:58
ARM64Exception::SError_Lower_EL
@ SError_Lower_EL
Definition
ARM64Exception.h:65
ARM64Exception::SError_SP_EL0
@ SError_SP_EL0
Definition
ARM64Exception.h:57
ARM64Exception::IRQ_Lower_EL_AA32
@ IRQ_Lower_EL_AA32
Definition
ARM64Exception.h:67
ARM64Exception::Sync_Lower_EL_AA32
@ Sync_Lower_EL_AA32
Definition
ARM64Exception.h:66
ARM64Exception::SError_Lower_EL_AA32
@ SError_Lower_EL_AA32
Definition
ARM64Exception.h:69
ARM64Exception::FIQ_Lower_EL_AA32
@ FIQ_Lower_EL_AA32
Definition
ARM64Exception.h:68
ARM64Exception::IRQ_Lower_EL
@ IRQ_Lower_EL
Definition
ARM64Exception.h:63
ARM64Exception::Sync_SP_EL0
@ Sync_SP_EL0
Definition
ARM64Exception.h:54
ARM64Exception::IRQ_SP_ELx
@ IRQ_SP_ELx
Definition
ARM64Exception.h:59
ARM64Exception::IRQ_SP_EL0
@ IRQ_SP_EL0
Definition
ARM64Exception.h:55
ARM64Exception::FIQ_SP_EL0
@ FIQ_SP_EL0
Definition
ARM64Exception.h:56
ARM64Exception::m_vecTable
Address m_vecTable
ARM64 exception vector jump table.
Definition
ARM64Exception.h:120
ARM64Exception::install
Result install(ExceptionType vector, Handler handler)
Install an exception handler.
Definition
ARM64Exception.cpp:33
ARM64Exception::Handler
void Handler(struct CPUState state)
Function which is called when the CPU is interrupted.
Definition
ARM64Exception.h:87
ARM64Exception::ARM64Exception
ARM64Exception()
Constructor.
Definition
ARM64Exception.cpp:27
Address
unsigned long Address
A memory address.
Definition
Types.h:131
CPUState
Contains all the CPU registers.
Definition
ARMCore.h:244
Generated by
1.9.8