Mercurial > archived > louis > epitech > mq > rathaxes
diff rathaxes_change_the_abstract_type_notation_in_the_e1000_sample.patch @ 105:fb20f01ea997
Wip, note: the interrupt handler refactoring patch is broken, I have to find the fix from the abstract type notation patch
author | Louis Opter <louis@lse.epita.fr> |
---|---|
date | Fri, 22 Mar 2013 00:25:52 -0700 |
parents | c4c33ac02b93 |
children | 976a4b87803f |
line wrap: on
line diff
--- a/rathaxes_change_the_abstract_type_notation_in_the_e1000_sample.patch Fri Mar 22 00:06:00 2013 -0700 +++ b/rathaxes_change_the_abstract_type_notation_in_the_e1000_sample.patch Fri Mar 22 00:25:52 2013 -0700 @@ -1,5 +1,5 @@ # HG changeset patch -# Parent 6603911e89e5f98231c90bccf4f4cb9d5534e000 +# Parent 1fa9b24e6012b2d53f1a84d4606cf3b6b9685fef rathaxes: change the abstract type notation in the e1000 sample Starting with ra24db32bf134 Rathaxes types are generated differently: you @@ -37,7 +37,6 @@ initialize the my_struct pointer here with a return value from the kernel (i.e: with a cast into rtx_GeneratedType *). - diff --git a/rathaxes/samples/e1000/device.blt b/rathaxes/samples/e1000/device.blt --- a/rathaxes/samples/e1000/device.blt +++ b/rathaxes/samples/e1000/device.blt @@ -287,7 +286,7 @@ } } -@@ -88,24 +94,33 @@ +@@ -88,25 +94,33 @@ #include <linux/etherdevice.h> } @@ -321,13 +320,14 @@ net_device: ${self}->net_dev; - perm_addr: ${self}->net_dev->ndev.perm_addr; - dev_addr: ${self}->net_dev->ndev.dev_addr; +- irq: ${self}->pci_dev->data.irq; + perm_addr: ((struct net_device *)(${self})->net_dev)->perm_addr; + dev_addr: ((struct net_device *)(${self})->net_dev)->dev_addr; + irq: ((struct pci_dev *)(${self})->pci_dev)->irq; } } -@@ -125,8 +140,17 @@ +@@ -126,8 +140,17 @@ { static int rtx_ethernet_open(struct net_device *dev) { @@ -346,7 +346,7 @@ ${cast local.rtx_ether_ctx as Ethernet::Device}; int error; -@@ -186,8 +210,13 @@ +@@ -187,8 +210,13 @@ { static int rtx_ethernet_close(struct net_device *dev) { @@ -361,7 +361,7 @@ ${cast local.rtx_ether_ctx as Ethernet::Device}; /* TODO: change this pointcut into a pointcut/adapter/callback: */ -@@ -220,9 +249,13 @@ +@@ -221,9 +249,13 @@ { static enum irqreturn rtx_ethernet_interrupt_handler(int irq, void *dev_id) { @@ -376,7 +376,7 @@ ${pointcut ::IMPLEMENTATION(local.rtx_ether_ctx)}; return IRQ_NONE; -@@ -252,23 +285,26 @@ +@@ -253,23 +285,26 @@ */ chunk PCI::pci_probe_hook(PCI::Device rtx_pci_dev) { @@ -412,7 +412,7 @@ if (error) { ${Log::info("cannot register the driver in the net subsystem")}; -@@ -280,14 +316,11 @@ +@@ -281,14 +316,11 @@ * XXX: the cast is here because the compiler resolve the * type of rtx_pci_dev.pci_device to the type of * rtx_pci_dev instead of the type of rtx_pci_dev.pci_device. @@ -431,7 +431,7 @@ } /* Register ourselves in the parent context: */ -@@ -309,7 +342,7 @@ +@@ -310,7 +342,7 @@ ${pointcut Ethernet::adapter_load_mac_address(local.rtx_ether_ctx)}; memcpy(${local.rtx_ether_ctx.perm_addr}, ${local.rtx_ether_ctx.dev_addr}, @@ -440,7 +440,7 @@ } /* This chunk should be removed (see #26) */ -@@ -326,15 +359,15 @@ +@@ -327,15 +359,15 @@ */ chunk PCI::pci_remove_hook(PCI::Device rtx_pci_dev) { @@ -483,12 +483,13 @@ } provided type Device -@@ -34,8 +41,9 @@ +@@ -34,9 +41,9 @@ * I'd like to use better names here, but I'd like to understand the * difference between the two first: */ - attribute Builtin::symbol perm_addr; - attribute Builtin::symbol dev_addr; +- attribute Builtin::symbol irq; + attribute Builtin::symbol perm_addr; + attribute Builtin::symbol dev_addr; + attribute Builtin::symbol irq;