changeset 47:cf7d541b9331

Re-order patches + quick fixes
author Louis Opter <louis@lse.epitech.net>
date Fri, 13 Jan 2012 11:59:42 +0100
parents 1cf60e316d19
children 7b377e31fea3
files provided_pointcut_in_required_sequences_fail.patch rathaxes_add_lkm_ethernet_sample.patch series
diffstat 3 files changed, 100 insertions(+), 141 deletions(-) [+]
line wrap: on
line diff
--- a/provided_pointcut_in_required_sequences_fail.patch	Thu Jan 12 19:46:49 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-diff --git a/rathaxes/samples/helloworld/hello.rtx b/rathaxes/samples/helloworld/hello.rtx
---- a/rathaxes/samples/helloworld/hello.rtx
-+++ b/rathaxes/samples/helloworld/hello.rtx
-@@ -1,6 +1,6 @@
- device HelloWorld use Main, Types, Log
- {
--    Main::start(Main::Arguments args)
-+    Main::main(Main::Arguments args)
-     {
-         Main::log(args);
- 
-diff --git a/rathaxes/samples/helloworld/log.blt b/rathaxes/samples/helloworld/log.blt
---- a/rathaxes/samples/helloworld/log.blt
-+++ b/rathaxes/samples/helloworld/log.blt
-@@ -12,5 +12,11 @@
-         {
-             puts(${msg});
-         }
-+
-+        chunk Main::at_exit()
-+        {
-+            fflush(stdout);
-+            fflush(stderr);
-+        }
-     }
- }
-diff --git a/rathaxes/samples/helloworld/log.rti b/rathaxes/samples/helloworld/log.rti
---- a/rathaxes/samples/helloworld/log.rti
-+++ b/rathaxes/samples/helloworld/log.rti
-@@ -3,5 +3,6 @@
-     provided sequence Log::info(::string)
-     {
-         provided chunk  ::CALL;
-+        provided chunk  Main::at_exit;
-     }
- }
-diff --git a/rathaxes/samples/helloworld/main.blt b/rathaxes/samples/helloworld/main.blt
---- a/rathaxes/samples/helloworld/main.blt
-+++ b/rathaxes/samples/helloworld/main.blt
-@@ -40,7 +40,7 @@
-         }
-     }
- 
--    template sequence Main::start(Main::Arguments args)
-+    template sequence Main::main(Main::Arguments args)
-     {
-         chunk Main::include_headers
-         {
-@@ -64,6 +64,8 @@
-                 ${args.init(argc, argv, env)};
- 
-                 ${pointcut ::IMPLEMENTATION};
-+
-+                ${pointcut Main::at_exit};
-             }
-         }
-     }
-diff --git a/rathaxes/samples/helloworld/main.rti b/rathaxes/samples/helloworld/main.rti
---- a/rathaxes/samples/helloworld/main.rti
-+++ b/rathaxes/samples/helloworld/main.rti
-@@ -6,10 +6,12 @@
-     provided type       Main::Arguments;
- 
-     /* This sequence is required, i.e: its implementation is in the .rtx */
--    required sequence   Main::start(Main::Arguments)
-+    required sequence   Main::main(Main::Arguments)
-     {
-         provided chunk  Main::include_headers;
-         provided chunk  Main::main;
-+
-+        provided pointcut   Main::at_exit;
-     }
- 
-     /*
--- a/rathaxes_add_lkm_ethernet_sample.patch	Thu Jan 12 19:46:49 2012 +0100
+++ b/rathaxes_add_lkm_ethernet_sample.patch	Fri Jan 13 11:59:42 2012 +0100
@@ -1,10 +1,30 @@
 # HG changeset patch
-# Parent 6d6b478219da142368f4e458b8a348f4d87867d9
-rathaxes: add the PCI/Ethernet part of a Linux Intel e1000 network card driver
+# User Thomas Sanchez <thomas.sanchz@gmail.com>, Louis Opter <louis@lse.epita.fr>
+# Parent 3a7169517431da7a5a9a3c411ff95927c55f214f
+rathaxes: add the beginning of a Linux Intel e1000 network card driver
+
+- With working LKM/PCI/Ethernet parts;
+- Some interruption handling POC;
+- Directly compiles to a .ko object.
 
-diff -r 6d6b478219da maintainers/CMakeScripts/UseRathaxes.cmake
---- a/maintainers/CMakeScripts/UseRathaxes.cmake	Mon Jan 09 19:24:10 2012 +0100
-+++ b/maintainers/CMakeScripts/UseRathaxes.cmake	Mon Jan 09 22:16:54 2012 +0100
+diff --git a/maintainers/CMakeScripts/Templates/MakefileLKM.in b/maintainers/CMakeScripts/Templates/MakefileLKM.in
+--- a/maintainers/CMakeScripts/Templates/MakefileLKM.in
++++ b/maintainers/CMakeScripts/Templates/MakefileLKM.in
+@@ -1,5 +1,9 @@
+-KDIR	= /lib/modules/$(shell uname -r)/build
+-obj-m	:= @LKM_OBJECTS@
++# Disable this "coding-style" warning (seriously, you have to compile with
++# -pedantic to get it...)
++EXTRA_CFLAGS	= -Wno-declaration-after-statement
++
++KDIR		= /lib/modules/$(shell uname -r)/build
++obj-m		:= @LKM_OBJECTS@
+ 
+ all:
+ 	$(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) modules
+diff --git a/maintainers/CMakeScripts/UseRathaxes.cmake b/maintainers/CMakeScripts/UseRathaxes.cmake
+--- a/maintainers/CMakeScripts/UseRathaxes.cmake
++++ b/maintainers/CMakeScripts/UseRathaxes.cmake
 @@ -193,6 +193,8 @@
  
          SET(KERNEL_OBJECT_NAME "${RATHAXES_SOURCE}_${SYSTEM}.ko")
@@ -14,27 +34,29 @@
                             # The linux Makefile to build kernel module is quite
                             # picky about file location and its own name. Let's
                             # copy our source side by side with the Makefile:
-diff -r 6d6b478219da rathaxes/samples/CMakeLists.txt
---- a/rathaxes/samples/CMakeLists.txt	Mon Jan 09 19:24:10 2012 +0100
-+++ b/rathaxes/samples/CMakeLists.txt	Mon Jan 09 22:16:54 2012 +0100
+diff --git a/rathaxes/samples/CMakeLists.txt b/rathaxes/samples/CMakeLists.txt
+--- a/rathaxes/samples/CMakeLists.txt
++++ b/rathaxes/samples/CMakeLists.txt
 @@ -1,2 +1,3 @@
  ADD_SUBDIRECTORY(helloworld)
-+ADD_SUBDIRECTORY(lkm)
  ADD_SUBDIRECTORY(syntax)
-diff -r 6d6b478219da rathaxes/samples/lkm/CMakeLists.txt
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/rathaxes/samples/lkm/CMakeLists.txt	Mon Jan 09 22:16:54 2012 +0100
++ADD_SUBDIRECTORY(e1000)
+diff --git a/rathaxes/samples/e1000/CMakeLists.txt b/rathaxes/samples/e1000/CMakeLists.txt
+new file mode 100644
+--- /dev/null
++++ b/rathaxes/samples/e1000/CMakeLists.txt
 @@ -0,0 +1,7 @@
-+ADD_RATHAXES_SOURCES(lkm_src lkm.rtx
++ADD_RATHAXES_SOURCES(e1000_src lkm.rtx
 +                     RTI log.rti lkm.rti pci.rti socket.rti ethernet.rti e1000.rti
 +                     BLT log.blt lkm.blt pci.blt socket.blt ethernet.blt e1000.blt)
 +
 +# We can't name lkm since it's already used as the target name to generate the
 +# source (with ADD_RATHAXES_SOURCES).
-+ADD_RATHAXES_LKM(lkm lkm_src)
-diff -r 6d6b478219da rathaxes/samples/lkm/e1000.blt
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/rathaxes/samples/lkm/e1000.blt	Mon Jan 09 22:16:54 2012 +0100
++ADD_RATHAXES_LKM(e1000 e1000_src)
+diff --git a/rathaxes/samples/e1000/e1000.blt b/rathaxes/samples/e1000/e1000.blt
+new file mode 100644
+--- /dev/null
++++ b/rathaxes/samples/e1000/e1000.blt
 @@ -0,0 +1,435 @@
 +with e1000, Ethernet, Socket, PCI, LKM, Log
 +{
@@ -163,8 +185,7 @@
 +                E1000_INTR_RXDMT0               = 0x00000010, /* rx desc min. threshold (0) */
 +                E1000_INTR_RXO                  = 0x00000040, /* rx overrun */
 +                E1000_INTR_RXT0                 = 0x00000080, /* rx timer intr (ring 0) */
-+                E1000_INTR_MDAC                 = 0x00000200 /* MDIO access complete */
-+
++                E1000_INTR_MDAC                 = 0x00000200  /* MDIO access complete */
 +            };
 +        }
 +
@@ -433,11 +454,11 @@
 +        chunk  ::CALL()
 +        {
 +            rtx_e1000_register_write32(ctx, E1000_IMS,
-+                    E1000_INTR_TXDW |
-+                    E1000_INTR_TXQE |
-+                    E1000_INTR_LSC  |
-+                    E1000_INTR_RXO  |
-+                    E1000_INTR_RXT0);
++                                       E1000_INTR_TXDW |
++                                       E1000_INTR_TXQE |
++                                       E1000_INTR_LSC  |
++                                       E1000_INTR_RXO  |
++                                       E1000_INTR_RXT0);
 +        }
 +    }
 +
@@ -445,10 +466,11 @@
 +    {
 +        chunk  ::CALL()
 +        {
-+            rtx_e1000_register_set32(ctx, E1000_CTRL, E1000_CMD_ASDE
-+                    | E1000_CMD_SLU
-+                    | E1000_CMD_LRST
-+                    | E1000_CMD_PHY_RST);
++            rtx_e1000_register_set32(ctx, E1000_CTRL,
++                                     E1000_CMD_ASDE |
++                                     E1000_CMD_SLU  |
++                                     E1000_CMD_LRST |
++                                     E1000_CMD_PHY_RST);
 +        }
 +    }
 +
@@ -471,9 +493,10 @@
 +        }
 +    }
 +}
-diff -r 6d6b478219da rathaxes/samples/lkm/e1000.rti
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/rathaxes/samples/lkm/e1000.rti	Mon Jan 09 22:16:54 2012 +0100
+diff --git a/rathaxes/samples/e1000/e1000.rti b/rathaxes/samples/e1000/e1000.rti
+new file mode 100644
+--- /dev/null
++++ b/rathaxes/samples/e1000/e1000.rti
 @@ -0,0 +1,89 @@
 +interface e1000 : Socket, Ethernet, PCI, LKM
 +{
@@ -564,9 +587,10 @@
 +        provided chunk  ::CALL;
 +    }
 +}
-diff -r 6d6b478219da rathaxes/samples/lkm/ethernet.blt
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/rathaxes/samples/lkm/ethernet.blt	Mon Jan 09 22:16:54 2012 +0100
+diff --git a/rathaxes/samples/e1000/ethernet.blt b/rathaxes/samples/e1000/ethernet.blt
+new file mode 100644
+--- /dev/null
++++ b/rathaxes/samples/e1000/ethernet.blt
 @@ -0,0 +1,218 @@
 +with Ethernet, PCI, LKM, Log
 +{
@@ -786,9 +810,10 @@
 +    }
 +}
 +
-diff -r 6d6b478219da rathaxes/samples/lkm/ethernet.rti
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/rathaxes/samples/lkm/ethernet.rti	Mon Jan 09 22:16:54 2012 +0100
+diff --git a/rathaxes/samples/e1000/ethernet.rti b/rathaxes/samples/e1000/ethernet.rti
+new file mode 100644
+--- /dev/null
++++ b/rathaxes/samples/e1000/ethernet.rti
 @@ -0,0 +1,47 @@
 +interface Ethernet : Socket, PCI, LKM
 +{
@@ -837,9 +862,10 @@
 +        provided pointcut   Ethernet::destroy_device;
 +    }
 +}
-diff -r 6d6b478219da rathaxes/samples/lkm/lkm.blt
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/rathaxes/samples/lkm/lkm.blt	Mon Jan 09 22:16:54 2012 +0100
+diff --git a/rathaxes/samples/e1000/lkm.blt b/rathaxes/samples/e1000/lkm.blt
+new file mode 100644
+--- /dev/null
++++ b/rathaxes/samples/e1000/lkm.blt
 @@ -0,0 +1,55 @@
 +with LKM
 +{
@@ -896,9 +922,10 @@
 +        }
 +    }
 +}
-diff -r 6d6b478219da rathaxes/samples/lkm/lkm.rti
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/rathaxes/samples/lkm/lkm.rti	Mon Jan 09 22:16:54 2012 +0100
+diff --git a/rathaxes/samples/e1000/lkm.rti b/rathaxes/samples/e1000/lkm.rti
+new file mode 100644
+--- /dev/null
++++ b/rathaxes/samples/e1000/lkm.rti
 @@ -0,0 +1,25 @@
 +interface LKM
 +{
@@ -925,9 +952,10 @@
 +        provided pointcut   LKM::deinit_bus_hook;
 +    }
 +}
-diff -r 6d6b478219da rathaxes/samples/lkm/lkm.rtx
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/rathaxes/samples/lkm/lkm.rtx	Mon Jan 09 22:16:54 2012 +0100
+diff --git a/rathaxes/samples/e1000/lkm.rtx b/rathaxes/samples/e1000/lkm.rtx
+new file mode 100644
+--- /dev/null
++++ b/rathaxes/samples/e1000/lkm.rtx
 @@ -0,0 +1,52 @@
 +device LKM use LKM, PCI, Ethernet, Log
 +{
@@ -981,9 +1009,10 @@
 +
 +    Ethernet::ifname = "rtx%d";
 +}
-diff -r 6d6b478219da rathaxes/samples/lkm/log.blt
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/rathaxes/samples/lkm/log.blt	Mon Jan 09 22:16:54 2012 +0100
+diff --git a/rathaxes/samples/e1000/log.blt b/rathaxes/samples/e1000/log.blt
+new file mode 100644
+--- /dev/null
++++ b/rathaxes/samples/e1000/log.blt
 @@ -0,0 +1,10 @@
 +with Log
 +{
@@ -995,9 +1024,10 @@
 +        }
 +    }
 +}
-diff -r 6d6b478219da rathaxes/samples/lkm/log.rti
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/rathaxes/samples/lkm/log.rti	Mon Jan 09 22:16:54 2012 +0100
+diff --git a/rathaxes/samples/e1000/log.rti b/rathaxes/samples/e1000/log.rti
+new file mode 100644
+--- /dev/null
++++ b/rathaxes/samples/e1000/log.rti
 @@ -0,0 +1,7 @@
 +interface Log
 +{
@@ -1006,9 +1036,10 @@
 +        provided chunk  ::CALL;
 +    }
 +}
-diff -r 6d6b478219da rathaxes/samples/lkm/pci.blt
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/rathaxes/samples/lkm/pci.blt	Mon Jan 09 22:16:54 2012 +0100
+diff --git a/rathaxes/samples/e1000/pci.blt b/rathaxes/samples/e1000/pci.blt
+new file mode 100644
+--- /dev/null
++++ b/rathaxes/samples/e1000/pci.blt
 @@ -0,0 +1,143 @@
 +with PCI, LKM, Log
 +{
@@ -1153,9 +1184,10 @@
 +        }
 +    }
 +}
-diff -r 6d6b478219da rathaxes/samples/lkm/pci.rti
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/rathaxes/samples/lkm/pci.rti	Mon Jan 09 22:16:54 2012 +0100
+diff --git a/rathaxes/samples/e1000/pci.rti b/rathaxes/samples/e1000/pci.rti
+new file mode 100644
+--- /dev/null
++++ b/rathaxes/samples/e1000/pci.rti
 @@ -0,0 +1,36 @@
 +interface PCI : LKM
 +{
@@ -1193,9 +1225,10 @@
 +        provided pointcut   PCI::pci_remove_hook;
 +    }
 +}
-diff -r 6d6b478219da rathaxes/samples/lkm/socket.blt
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/rathaxes/samples/lkm/socket.blt	Mon Jan 09 22:16:54 2012 +0100
+diff --git a/rathaxes/samples/e1000/socket.blt b/rathaxes/samples/e1000/socket.blt
+new file mode 100644
+--- /dev/null
++++ b/rathaxes/samples/e1000/socket.blt
 @@ -0,0 +1,27 @@
 +with Socket, LKM
 +{
@@ -1219,14 +1252,15 @@
 +        {
 +            // some work may have to be done here in order
 +            // to access to some field of the sk_buff.
-+            // We should determine if all the sk_buff managment
++            // We should determine if all the sk_buff management
 +            // can be abstracted from the user.
 +        }
 +    }
 +}
-diff -r 6d6b478219da rathaxes/samples/lkm/socket.rti
---- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-+++ b/rathaxes/samples/lkm/socket.rti	Mon Jan 09 22:16:54 2012 +0100
+diff --git a/rathaxes/samples/e1000/socket.rti b/rathaxes/samples/e1000/socket.rti
+new file mode 100644
+--- /dev/null
++++ b/rathaxes/samples/e1000/socket.rti
 @@ -0,0 +1,4 @@
 +interface Socket : LKM
 +{
--- a/series	Thu Jan 12 19:46:49 2012 +0100
+++ b/series	Fri Jan 13 11:59:42 2012 +0100
@@ -1,3 +1,2 @@
+rathaxes_add_lkm_ethernet_sample.patch
 maintainers_update_the_binaries_installed_with_make_install.patch
-provided_pointcut_in_required_sequences_fail.patch
-rathaxes_add_lkm_ethernet_sample.patch