From ac0e5261ba0de119d4553da44040382d54035b7e Mon Sep 17 00:00:00 2001 From: ngiddings Date: Thu, 15 Apr 2021 04:51:57 -0500 Subject: [PATCH] Implemented apic_send_ipi() --- src/x86/apic.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/x86/apic.c b/src/x86/apic.c index 1d677e7..9d6d113 100644 --- a/src/x86/apic.c +++ b/src/x86/apic.c @@ -7,7 +7,7 @@ void apic_enable() void apic_eoi() { - + apic_registers->eoi.value = 0; } void apic_send_ipi( @@ -19,5 +19,17 @@ void apic_send_ipi( enum apic_destination_shorthand_t shorthand, uint32_t destination) { - + struct apic_icr_t value = { + .vector = vector, + .delivery_mode = delivery_mode, + .destination_mode = destination_mode, + .level = level, + .trigger_mode = trigger_mode, + .destination_shorthand = shorthand, + .destination = destination + }; + uint32_t *value_addr = (uint32_t*) &value; + uint32_t *icr_addr = (uint32_t*)&apic_registers->interrput_command; + icr_addr[4] = value_addr[4]; + icr_addr[0] = value_addr[0]; } \ No newline at end of file