Skip to content

Commit

Permalink
fix(armv8/vgic): add missing explicit casts
Browse files Browse the repository at this point in the history
Signed-off-by: joaopeixoto13 <[email protected]>
  • Loading branch information
joaopeixoto13 committed Sep 13, 2024
1 parent e2f8cd2 commit 5a6c93d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/arch/armv8/vgicv2.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ void vgic_init(struct vm* vm, const struct vgic_dscrp* vgic_dscrp)
vm->arch.vgicd.CTLR = 0;
size_t vtyper_itln = vgic_get_itln(vgic_dscrp);
vm->arch.vgicd.int_num = 32 * (vtyper_itln + 1);
vm->arch.vgicd.TYPER = ((vtyper_itln << GICD_TYPER_ITLN_OFF) & GICD_TYPER_ITLN_MSK) |
(((vm->cpu_num - 1) << GICD_TYPER_CPUNUM_OFF) & GICD_TYPER_CPUNUM_MSK);
vm->arch.vgicd.TYPER = (uint32_t)(((vtyper_itln << GICD_TYPER_ITLN_OFF) & GICD_TYPER_ITLN_MSK) |
(((vm->cpu_num - 1) << GICD_TYPER_CPUNUM_OFF) & GICD_TYPER_CPUNUM_MSK));
vm->arch.vgicd.IIDR = gicd->IIDR;

size_t n = NUM_PAGES(sizeof(struct gicc_hw));
Expand Down
4 changes: 2 additions & 2 deletions src/arch/armv8/vgicv3.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,9 @@ void vgic_init(struct vm* vm, const struct vgic_dscrp* vgic_dscrp)
vm->arch.vgicd.CTLR = 0;
size_t vtyper_itln = vgic_get_itln(vgic_dscrp);
vm->arch.vgicd.int_num = 32 * (vtyper_itln + 1);
vm->arch.vgicd.TYPER = ((vtyper_itln << GICD_TYPER_ITLN_OFF) & GICD_TYPER_ITLN_MSK) |
vm->arch.vgicd.TYPER = (uint32_t)(((vtyper_itln << GICD_TYPER_ITLN_OFF) & GICD_TYPER_ITLN_MSK) |
(((vm->cpu_num - 1) << GICD_TYPER_CPUNUM_OFF) & GICD_TYPER_CPUNUM_MSK) |
(((10 - 1) << GICD_TYPER_IDBITS_OFF) & GICD_TYPER_IDBITS_MSK);
(((10 - 1) << GICD_TYPER_IDBITS_OFF) & GICD_TYPER_IDBITS_MSK));
vm->arch.vgicd.IIDR = gicd->IIDR;

size_t vgic_int_size = vm->arch.vgicd.int_num * sizeof(struct vgic_int);
Expand Down

0 comments on commit 5a6c93d

Please sign in to comment.