summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/intr.c10
-rw-r--r--sys/arch/amd64/amd64/vector.S3
2 files changed, 12 insertions, 1 deletions
diff --git a/sys/arch/amd64/amd64/intr.c b/sys/arch/amd64/amd64/intr.c
index cb38cd8..685a16d 100644
--- a/sys/arch/amd64/amd64/intr.c
+++ b/sys/arch/amd64/amd64/intr.c
@@ -79,6 +79,8 @@ intr_register(const char *name, const struct intr_hand *ih)
{
uint32_t vec = MAX(ih->priority << IPL_SHIFT, 0x20);
struct intr_hand *ih_new;
+ struct intr_data *idp_new;
+ const struct intr_data *idp;
size_t name_len;
/* Sanity check */
@@ -115,6 +117,14 @@ intr_register(const char *name, const struct intr_hand *ih)
}
memcpy(ih_new->name, name, name_len);
+ idp_new = &ih_new->data;
+ idp = &ih->data;
+
+ /* Pass the interrupt data */
+ idp_new->ihp = ih_new;
+ idp_new->data_u64 = idp->data_u64;
+
+ /* Setup the new intr_hand */
ih_new->func = ih->func;
ih_new->priority = ih->priority;
ih_new->irq = ih->irq;
diff --git a/sys/arch/amd64/amd64/vector.S b/sys/arch/amd64/amd64/vector.S
index e348ff4..c820a41 100644
--- a/sys/arch/amd64/amd64/vector.S
+++ b/sys/arch/amd64/amd64/vector.S
@@ -51,7 +51,8 @@ ioapic_common_func:
jz 1f // Nope, return
mov (%rdx), %rbx // intr_hand.func
- xor %rdi, %rdi // No data
+ add $8, %rdx // Get interrupt data
+ mov %rdx, %rdi // Pass the interrupt data
push %rcx // Save our counter
call *%rbx // Call the handler
pop %rcx // Restore our counter