# HG changeset patch # User Louis Opter # Date 1391023364 28800 # Node ID a291b41efb69dff32f097b35d59e6f5eb6ca8294 # Parent ab3a2aa22f952c36d833cc42ea42f00cff6a7edc Wip.. diff -r ab3a2aa22f95 -r a291b41efb69 rathaxes_sample_e1000_rewrite_device_dependent_code.patch --- a/rathaxes_sample_e1000_rewrite_device_dependent_code.patch Sun Jan 19 18:13:17 2014 -0800 +++ b/rathaxes_sample_e1000_rewrite_device_dependent_code.patch Wed Jan 29 11:22:44 2014 -0800 @@ -87,12 +87,21 @@ IF (LINUX_KBUILD_DIR) ADD_RATHAXES_LKM(e1000 e1000_src) +diff --git a/rathaxes/samples/e1000/dma.blt b/rathaxes/samples/e1000/dma.blt +--- a/rathaxes/samples/e1000/dma.blt ++++ b/rathaxes/samples/e1000/dma.blt +@@ -1,4 +1,4 @@ +-with DMA, Builtin, LKM, Device ++with Builtin, LKM, Device, DMA + { + template type DMA::AbstractDMAHandle() + { diff --git a/rathaxes/samples/e1000/e1000.blt b/rathaxes/samples/e1000/e1000.blt --- a/rathaxes/samples/e1000/e1000.blt +++ b/rathaxes/samples/e1000/e1000.blt @@ -1,564 +1,8 @@ -with e1000, Ethernet, Socket, DMA, PCI, LKM, Log, Builtin -+with e1000, Ethernet, Socket, Device, DMA, PCI, LKM, Log, Builtin ++with LKM, e1000, Ethernet, Socket, Device, DMA, PCI, Log, Builtin { - template type e1000::RxDescriptor() + template type e1000::Register() @@ -1126,10 +1135,10 @@ { - /* FIXME: See issue #54 */ - static unsigned int rtx_e1000_register_read32(/*const*/ ${e1000::Context.ref}, unsigned int); -+ ${e1000::Context} hw_ctx; ++ ${e1000::Context.ref} hw_ctx; + ${DMA::DMAHandle} dma; + unsigned int size; -+ ${Builtin::symbol.ref} descs; ++ void *descs; + ${e1000::Buffer.ref} buffs; } @@ -1143,7 +1152,7 @@ + + chunk LKM::code() + { -+ static void rtx_e1000_ring_init(${e1000::Ring.ref} self, ${e1000::Context} hw_ctx, ++ static void rtx_e1000_ring_init(${e1000::Ring.ref} self, ${e1000::Context.ref} hw_ctx, + int desc_count, int desc_size) { - return ioread32(ctx->ioaddr + reg_offset); @@ -1932,7 +1941,7 @@ +++ b/rathaxes/samples/e1000/ethernet.blt @@ -1,4 +1,4 @@ -with Ethernet, PCI, LKM, Log, Builtin -+with Ethernet, Socket, PCI, LKM, Log, Builtin ++with LKM, Socket, PCI, Log, Builtin, Ethernet { template type Ethernet::ProtocolId() { @@ -1963,9 +1972,18 @@ } map -@@ -104,9 +104,12 @@ +@@ -97,16 +97,19 @@ + + chunk LKM::prototypes() { - static int rtx_ethernet_alloc_rx_skbuff(${Ethernet::Device.ref} self, ${Socket::SKBuff.ref} sk_buff, ${Builtin::number} size) +- static int rtx_ethernet_alloc_rx_skbuff(${Ethernet::Device.ref}, ${Socket::SKBuff.ref}, ${Builtin::number}); ++ static int rtx_ethernet_alloc_rx_skbuff(${Ethernet::Device.ref}, ${Socket::SKBuff.ref}, unsigned int); + } + + chunk LKM::code() + { +- static int rtx_ethernet_alloc_rx_skbuff(${Ethernet::Device.ref} self, ${Socket::SKBuff.ref} sk_buff, ${Builtin::number} size) ++ static int rtx_ethernet_alloc_rx_skbuff(${Ethernet::Device.ref} self, ${Socket::SKBuff.ref} sk_buff, unsigned int size) { - ${Socket::AbstractSKBuff} k_sk_buff = netdev_alloc_skb(${local.self.net_device.k_net_dev}, ${local.size}); - if (${local.k_sk_buff) { @@ -2607,6 +2625,12 @@ diff --git a/rathaxes/samples/e1000/pci.blt b/rathaxes/samples/e1000/pci.blt --- a/rathaxes/samples/e1000/pci.blt +++ b/rathaxes/samples/e1000/pci.blt +@@ -1,4 +1,4 @@ +-with PCI, LKM, Log ++with LKM, Log, PCI + { + template type PCI::AbstractDevice() + { @@ -73,9 +73,8 @@ method init(PCI::AbstractDevice pdev) @@ -2688,6 +2712,12 @@ diff --git a/rathaxes/samples/e1000/socket.blt b/rathaxes/samples/e1000/socket.blt --- a/rathaxes/samples/e1000/socket.blt +++ b/rathaxes/samples/e1000/socket.blt +@@ -1,4 +1,4 @@ +-with Socket, LKM, Device, DMA, Ethernet ++with LKM, Device, DMA, Ethernet, Socket + { + template type Socket::AbstractSKBuff() + { @@ -22,16 +22,12 @@ { decl data_types()