mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
intc/arm_gic: Refactor operations on the distributor
In preparation for the virtualization extensions implementation, refactor the name of the functions and macros that act on the GIC distributor to make that fact explicit. It will be useful to differentiate them from the ones that will act on the virtual interfaces. Signed-off-by: Luc Michel <luc.michel@greensocs.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20180727095421.386-2-luc.michel@greensocs.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
55a7cb144d
commit
67ce697ac8
4 changed files with 127 additions and 116 deletions
|
@ -140,10 +140,10 @@ static void translate_group(GICState *s, int irq, int cpu,
|
|||
int cm = (irq < GIC_INTERNAL) ? (1 << cpu) : ALL_CPU_MASK;
|
||||
|
||||
if (to_kernel) {
|
||||
*field = GIC_TEST_GROUP(irq, cm);
|
||||
*field = GIC_DIST_TEST_GROUP(irq, cm);
|
||||
} else {
|
||||
if (*field & 1) {
|
||||
GIC_SET_GROUP(irq, cm);
|
||||
GIC_DIST_SET_GROUP(irq, cm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -154,10 +154,10 @@ static void translate_enabled(GICState *s, int irq, int cpu,
|
|||
int cm = (irq < GIC_INTERNAL) ? (1 << cpu) : ALL_CPU_MASK;
|
||||
|
||||
if (to_kernel) {
|
||||
*field = GIC_TEST_ENABLED(irq, cm);
|
||||
*field = GIC_DIST_TEST_ENABLED(irq, cm);
|
||||
} else {
|
||||
if (*field & 1) {
|
||||
GIC_SET_ENABLED(irq, cm);
|
||||
GIC_DIST_SET_ENABLED(irq, cm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ static void translate_pending(GICState *s, int irq, int cpu,
|
|||
*field = gic_test_pending(s, irq, cm);
|
||||
} else {
|
||||
if (*field & 1) {
|
||||
GIC_SET_PENDING(irq, cm);
|
||||
GIC_DIST_SET_PENDING(irq, cm);
|
||||
/* TODO: Capture is level-line is held high in the kernel */
|
||||
}
|
||||
}
|
||||
|
@ -183,10 +183,10 @@ static void translate_active(GICState *s, int irq, int cpu,
|
|||
int cm = (irq < GIC_INTERNAL) ? (1 << cpu) : ALL_CPU_MASK;
|
||||
|
||||
if (to_kernel) {
|
||||
*field = GIC_TEST_ACTIVE(irq, cm);
|
||||
*field = GIC_DIST_TEST_ACTIVE(irq, cm);
|
||||
} else {
|
||||
if (*field & 1) {
|
||||
GIC_SET_ACTIVE(irq, cm);
|
||||
GIC_DIST_SET_ACTIVE(irq, cm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -195,10 +195,10 @@ static void translate_trigger(GICState *s, int irq, int cpu,
|
|||
uint32_t *field, bool to_kernel)
|
||||
{
|
||||
if (to_kernel) {
|
||||
*field = (GIC_TEST_EDGE_TRIGGER(irq)) ? 0x2 : 0x0;
|
||||
*field = (GIC_DIST_TEST_EDGE_TRIGGER(irq)) ? 0x2 : 0x0;
|
||||
} else {
|
||||
if (*field & 0x2) {
|
||||
GIC_SET_EDGE_TRIGGER(irq);
|
||||
GIC_DIST_SET_EDGE_TRIGGER(irq);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -207,9 +207,10 @@ static void translate_priority(GICState *s, int irq, int cpu,
|
|||
uint32_t *field, bool to_kernel)
|
||||
{
|
||||
if (to_kernel) {
|
||||
*field = GIC_GET_PRIORITY(irq, cpu) & 0xff;
|
||||
*field = GIC_DIST_GET_PRIORITY(irq, cpu) & 0xff;
|
||||
} else {
|
||||
gic_set_priority(s, cpu, irq, *field & 0xff, MEMTXATTRS_UNSPECIFIED);
|
||||
gic_dist_set_priority(s, cpu, irq,
|
||||
*field & 0xff, MEMTXATTRS_UNSPECIFIED);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue