Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
seL4
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Panda
seL4
Commits
759a8c76
Commit
759a8c76
authored
6 years ago
by
Kent McLeod
Browse files
Options
Downloads
Patches
Plain Diff
gic_v3: Add setIRQTrigger
This enables invocations to change the trigger mode of an IRQ.
parent
53f08062
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/arch/arm/arch/machine/gic_v3.h
+3
-0
3 additions, 0 deletions
include/arch/arm/arch/machine/gic_v3.h
src/arch/arm/machine/gic_v3.c
+36
-0
36 additions, 0 deletions
src/arch/arm/machine/gic_v3.c
with
39 additions
and
0 deletions
include/arch/arm/arch/machine/gic_v3.h
+
3
−
0
View file @
759a8c76
...
...
@@ -18,6 +18,9 @@
#ifndef ARCH_MACHINE_GIC_3_H
#define ARCH_MACHINE_GIC_3_H
/* tell the kernel we have the set trigger feature */
#define HAVE_SET_TRIGGER 1
#include
<stdint.h>
#include
<util.h>
#include
<linker.h>
...
...
This diff is collapsed.
Click to expand it.
src/arch/arm/machine/gic_v3.c
+
36
−
0
View file @
759a8c76
...
...
@@ -272,6 +272,42 @@ BOOT_CODE static void cpu_iface_init(void)
isb
();
}
void
setIRQTrigger
(
irq_t
irq
,
bool_t
trigger
)
{
/* GICv3 has read-only GICR_ICFG0 for SGI with
* default value 0xaaaaaaaa, and read-write GICR_ICFG1
* for PPI with default 0x00000000.*/
if
(
is_sgi
(
irq
))
{
return
;
}
int
word
=
irq
>>
4
;
int
bit
=
((
irq
&
0xf
)
*
2
);
uint32_t
icfgr
=
0
;
if
(
is_ppi
(
irq
))
{
icfgr
=
gic_rdist_sgi_ppi_map
[
CURRENT_CPU_INDEX
()]
->
icfgr1
;
}
else
{
icfgr
=
gic_dist
->
icfgrn
[
word
];
}
if
(
trigger
)
{
icfgr
|=
(
0
b10
<<
bit
);
}
else
{
icfgr
&=
~
(
0
b11
<<
bit
);
}
if
(
is_ppi
(
irq
))
{
gic_rdist_sgi_ppi_map
[
CURRENT_CPU_INDEX
()]
->
icfgr1
=
icfgr
;
}
else
{
/* Update GICD_ICFGR<n>. Note that the interrupt should
* be disabled before changing the field, and this function
* assumes the caller has disabled the interrupt. */
gic_dist
->
icfgrn
[
word
]
=
icfgr
;
}
return
;
}
BOOT_CODE
void
initIRQController
(
void
)
{
dist_init
();
...
...
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