Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Miosix Kernel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Avionics
Software Development
Miosix Kernel
Commits
98a6f49d
Commit
98a6f49d
authored
6 months ago
by
Federico
Browse files
Options
Downloads
Patches
Plain Diff
Simplify interrupt table generation metaprogram
parent
394650fb
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
miosix/arch/cpu/common/cortexMx_interrupts.cpp
+4
-15
4 additions, 15 deletions
miosix/arch/cpu/common/cortexMx_interrupts.cpp
with
4 additions
and
15 deletions
miosix/arch/cpu/common/cortexMx_interrupts.cpp
+
4
−
15
View file @
98a6f49d
...
@@ -134,19 +134,14 @@ template<unsigned N, fnptr... args>
...
@@ -134,19 +134,14 @@ template<unsigned N, fnptr... args>
struct
TableGenerator
struct
TableGenerator
{
{
typedef
typename
TableGenerator
<
N
-
1
,
&
irqProxy
<
N
-
1
>
,
args
...
>::
type
type
;
typedef
typename
TableGenerator
<
N
-
1
,
&
irqProxy
<
N
-
1
>
,
args
...
>::
type
type
;
static
const
type
table
;
};
};
template
<
fnptr
...
args
>
template
<
fnptr
...
args
>
struct
TableGenerator
<
0
,
args
...
>
struct
TableGenerator
<
0
,
args
...
>
{
{
typedef
InterruptProxyTable
<
args
...
>
type
;
typedef
InterruptProxyTable
<
args
...
>
type
;
static
const
type
table
;
};
};
template
<
unsigned
N
,
fnptr
...
args
>
const
typename
TableGenerator
<
N
,
args
...
>::
type
TableGenerator
<
N
,
args
...
>::
table
;
/**
/**
* \internal
* \internal
* This struct is the type whose memory layout corresponds to the ARM Cortex
* This struct is the type whose memory layout corresponds to the ARM Cortex
...
@@ -157,11 +152,9 @@ struct InterruptTable
...
@@ -157,11 +152,9 @@ struct InterruptTable
constexpr
InterruptTable
(
char
*
stackptr
,
fnptr
i1
,
fnptr
i2
,
fnptr
i3
,
constexpr
InterruptTable
(
char
*
stackptr
,
fnptr
i1
,
fnptr
i2
,
fnptr
i3
,
fnptr
i4
,
fnptr
i5
,
fnptr
i6
,
fnptr
i7
,
fnptr
i4
,
fnptr
i5
,
fnptr
i6
,
fnptr
i7
,
fnptr
i8
,
fnptr
i9
,
fnptr
i10
,
fnptr
i11
,
fnptr
i8
,
fnptr
i9
,
fnptr
i10
,
fnptr
i11
,
fnptr
i12
,
fnptr
i13
,
fnptr
i14
,
fnptr
i15
,
fnptr
i12
,
fnptr
i13
,
fnptr
i14
,
fnptr
i15
)
TableGenerator
<
numInterrupts
>::
type
interruptProxyTable
)
:
stackptr
(
stackptr
),
i1
(
i1
),
i2
(
i2
),
i3
(
i3
),
i4
(
i4
),
i5
(
i5
),
i6
(
i6
),
i7
(
i7
),
:
stackptr
(
stackptr
),
i1
(
i1
),
i2
(
i2
),
i3
(
i3
),
i4
(
i4
),
i5
(
i5
),
i6
(
i6
),
i7
(
i7
),
i8
(
i8
),
i9
(
i9
),
i10
(
i10
),
i11
(
i11
),
i12
(
i12
),
i13
(
i13
),
i14
(
i14
),
i15
(
i15
),
i8
(
i8
),
i9
(
i9
),
i10
(
i10
),
i11
(
i11
),
i12
(
i12
),
i13
(
i13
),
i14
(
i14
),
i15
(
i15
)
{}
interruptProxyTable
(
interruptProxyTable
)
{}
// The first entries of the interrupt table are the stack pointer, reset
// The first entries of the interrupt table are the stack pointer, reset
// vector and "system" interrupt entries. We don't make these run-time
// vector and "system" interrupt entries. We don't make these run-time
...
@@ -196,7 +189,7 @@ __attribute__((section(".isr_vector"))) extern const InterruptTable hardwareInte
...
@@ -196,7 +189,7 @@ __attribute__((section(".isr_vector"))) extern const InterruptTable hardwareInte
DebugMon_Handler
,
// Debug Monitor Handler
DebugMon_Handler
,
// Debug Monitor Handler
nullptr
,
// Reserved
nullptr
,
// Reserved
PendSV_Handler
,
// PendSV Handler
PendSV_Handler
,
// PendSV Handler
nullptr
,
// SysTick Handler (Miosix does not use it)
nullptr
// SysTick Handler (Miosix does not use it)
#else //__CORTEX_M != 0
#else //__CORTEX_M != 0
&
_main_stack_top
,
// Stack pointer
&
_main_stack_top
,
// Stack pointer
Reset_Handler
,
// Reset Handler
Reset_Handler
,
// Reset Handler
...
@@ -213,12 +206,8 @@ __attribute__((section(".isr_vector"))) extern const InterruptTable hardwareInte
...
@@ -213,12 +206,8 @@ __attribute__((section(".isr_vector"))) extern const InterruptTable hardwareInte
nullptr
,
// Reserved
nullptr
,
// Reserved
nullptr
,
// Reserved
nullptr
,
// Reserved
PendSV_Handler
,
// PendSV Handler
PendSV_Handler
,
// PendSV Handler
nullptr
,
// SysTick Handler (Miosix does not use it)
nullptr
// SysTick Handler (Miosix does not use it)
#endif //__CORTEX_M != 0
#endif //__CORTEX_M != 0
// The rest of the interrupt table, the one for peripheral interrupts is
// generated programmatically using template metaprogramming to produce the
// proxy functions that allow dynamically registering interrupts.
TableGenerator
<
numInterrupts
>::
table
);
);
//
//
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment