changeset 32:c7c59cebab85

Add a patch to illustrate pointcuts in type definition to illustrate #8
author Louis Opter <louis@lse.epitech.net>
date Sat, 07 Jan 2012 23:56:11 +0100
parents cd3e61d6759a
children 60a59bf708df 29c22fa5ec20
files rathaxes_add_a_patch_to_illustrate_issue_8.patch series
diffstat 2 files changed, 86 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rathaxes_add_a_patch_to_illustrate_issue_8.patch	Sat Jan 07 23:56:11 2012 +0100
@@ -0,0 +1,85 @@
+# HG changeset patch
+# Parent f91d274916763989466df5f948ee32a48930b028
+Add a patch to illustrate pointcuts in type definition to illustrate #8
+
+diff --git a/rathaxes/samples/lkm/e1000.blt b/rathaxes/samples/lkm/e1000.blt
+--- a/rathaxes/samples/lkm/e1000.blt
++++ b/rathaxes/samples/lkm/e1000.blt
+@@ -2,25 +2,20 @@
+ {
+     template type   e1000::Context()
+     {
+-        chunk   LKM::includes()
++        chunk   Ethernet::Context()
+         {
+-            /*
+-             * Force the generation of the structure in the "headers part, we
+-             * have to do this since we do not use the structure in this blt
+-             * (we hacked a bit and used it in ethernet.blt directly).
+-             */
+-            typedef int ${e1000::Context}; /* CNorm __std__ workaround */
+-            ${e1000::Context} force_declaration_in_includes;
++            struct
++            {
++                int                         bars;
++                unsigned char /* __iomem */ *ioaddr;
++            }   rtx_e1000_ctx;
+         }
+ 
+-        chunk   ::decl()
+-        {
+-            struct rtx_e1000_ctx
+-            {
+-                int                             bars;
+-                unsigned char /* __iomem */     *ioaddr;
+-            };
+-        }
++        /*
++         * Not sure about how chunk ::init will look in that case maybe we
++         * would need a second pointcut that would insert code in chunk ::init
++         * in Ethernet::Context? (and this chunk would be implemented here).
++         */
+ 
+         map
+         {
+diff --git a/rathaxes/samples/lkm/e1000.rti b/rathaxes/samples/lkm/e1000.rti
+--- a/rathaxes/samples/lkm/e1000.rti
++++ b/rathaxes/samples/lkm/e1000.rti
+@@ -1,6 +1,9 @@
+ interface e1000 : Socket, Ethernet, PCI, LKM
+ {
+-    provided type   e1000::Context;
++    provided type   e1000::Context
++    {
++        provided chunk  Ethernet::Context;
++    }
+ 
+     /* Not sure if we need the argument */
+     provided sequence   e1000::create()
+diff --git a/rathaxes/samples/lkm/ethernet.blt b/rathaxes/samples/lkm/ethernet.blt
+--- a/rathaxes/samples/lkm/ethernet.blt
++++ b/rathaxes/samples/lkm/ethernet.blt
+@@ -22,7 +22,8 @@
+                 struct net_device       *net_dev;
+ 
+                 /* while waiting on issue #8 */
+-                struct rtx_e1000_ctx    hw_ctx;
++                /* struct rtx_e1000_ctx    hw_ctx; */
++                ${pointcut  Ethernet::Context};
+             };
+         }
+ 
+diff --git a/rathaxes/samples/lkm/ethernet.rti b/rathaxes/samples/lkm/ethernet.rti
+--- a/rathaxes/samples/lkm/ethernet.rti
++++ b/rathaxes/samples/lkm/ethernet.rti
+@@ -1,6 +1,9 @@
+ interface Ethernet : Socket, PCI, LKM
+ {
+-    provided type       Ethernet::Device;
++    provided type       Ethernet::Device
++    {
++        provided pointcut   Ethernet::Context;
++    }
+ 
+     required variable ::string  Ethernet::ifname;
+ 
--- a/series	Sat Jan 07 21:19:40 2012 +0100
+++ b/series	Sat Jan 07 23:56:11 2012 +0100
@@ -3,3 +3,4 @@
 rathaxes_start_to_implement_pci_stuff_in_the_lkm.patch
 rathaxes_start_to_implement_the_ethernet_subsystem_in_the_lkm.patch
 rathaxes_start_to_implement_sk_buff_in_the_lkm.patch
+rathaxes_add_a_patch_to_illustrate_issue_8.patch