Skip to content

Commit fb3b203

Browse files
committed
fdt/aarch64: fix serial irq line on macOS
Apply the same hypervisor-specific correction we do for other devices. Signed-off-by: Sergio Lopez <slp@redhat.com>
1 parent 2b281e8 commit fb3b203

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/devices/src/fdt/aarch64.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,14 @@ fn create_serial_node<T: DeviceInfoForFDT + Clone + Debug>(
324324
dev_info: &T,
325325
) -> Result<()> {
326326
let serial_reg_prop = generate_prop64(&[dev_info.addr(), dev_info.length()]);
327+
#[cfg(target_os = "linux")]
327328
let irq = generate_prop32(&[GIC_FDT_IRQ_TYPE_SPI, dev_info.irq(), IRQ_TYPE_EDGE_RISING]);
329+
#[cfg(target_os = "macos")]
330+
let irq = generate_prop32(&[
331+
GIC_FDT_IRQ_TYPE_SPI,
332+
dev_info.irq() - 32,
333+
IRQ_TYPE_EDGE_RISING,
334+
]);
328335

329336
let node = fdt.begin_node(&format!("uart@{:x}", dev_info.addr()))?;
330337
fdt.property_string("compatible", "arm,pl011")?;

0 commit comments

Comments
 (0)