changeset 7:eead270c9bb6

WIP on the LKM sample, we just need #include to work to make it compile
author Louis Opter <louis@lse.epitech.net>
date Fri, 06 Jan 2012 11:45:25 +0100
parents 5b128dbd2c17
children 7089717b63b7
files rathaxes_fix_lkm_sample_build.patch series
diffstat 2 files changed, 92 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rathaxes_fix_lkm_sample_build.patch	Fri Jan 06 11:45:25 2012 +0100
@@ -0,0 +1,91 @@
+# HG changeset patch
+# Parent 563beffa32c982c746f6e26be2c89cab7b3608a4
+rathaxes: fix the necessary bits in the LKM sample to build a minimal linux LKM
+
+diff --git a/rathaxes/samples/lkm/lkm.blt b/rathaxes/samples/lkm/lkm.blt
+--- a/rathaxes/samples/lkm/lkm.blt
++++ b/rathaxes/samples/lkm/lkm.blt
+@@ -12,8 +12,13 @@
+         {
+             #include <linux/module.h>
+             #include <linux/kernel.h>
+-            typedef int  lkm_headers_include_stamp;
+ 
++            typedef int  include_linux_module_stamp;
++            typedef int  include_linux_kernel_stamp;
++        }
++
++        chunk   LKM::data()
++        {
+             MODULE_DESCRIPTION(${config.description});
+             MODULE_AUTHOR(${config.author});
+             MODULE_LICENSE(${config.license});
+@@ -25,7 +30,7 @@
+              * Rathaxes doesn't yet support arbitrary "decorators" like __init
+              * or __exit.
+              */
+-            static int __attribute__((__section__(.init.text)))  rtx_module_init(void)
++            static int __attribute__((__section__(".init.text")))  rtx_module_init(void)
+             {
+                 ${pointcut ::IMPLEMENTATION};
+             }
+@@ -38,12 +43,12 @@
+     {
+         chunk   LKM::code()
+         {
+-            static void __attribute((__section__(.exit.text)))   rtx_module_exit(void)
++            static void __attribute__((__section__(".exit.text")))   rtx_module_exit(void)
+             {
+                 ${pointcut ::IMPLEMENTATION};
+             }
+ 
+-            module_exit(rtx_module_init);
++            module_exit(rtx_module_exit);
+         }
+     }
+ }
+diff --git a/rathaxes/samples/lkm/lkm.rtx b/rathaxes/samples/lkm/lkm.rtx
+--- a/rathaxes/samples/lkm/lkm.rtx
++++ b/rathaxes/samples/lkm/lkm.rtx
+@@ -27,6 +27,6 @@
+     LKM::description = "Hello World Loadable Kernel Module (LKM)";
+     LKM::license = "BSD";
+ 
+-    PCI::vendor_id = "0x8080";
+-    PCI::product_id = "0x42";
++    PCI::vendor_id = 0x8080;
++    PCI::product_id = 0x42;
+ }
+diff --git a/rathaxes/samples/lkm/pci.blt b/rathaxes/samples/lkm/pci.blt
+--- a/rathaxes/samples/lkm/pci.blt
++++ b/rathaxes/samples/lkm/pci.blt
+@@ -2,14 +2,12 @@
+ {
+     template type   PCI::Device()
+     {
+-        /*
+-         * chunk   LKM::includes()
+-         * {
+-         *     #include <linux/pci.h>
+-         *
+-         *     typedef int include_linux_pci_stamp;
+-         * }
+-         */
++        chunk   LKM::includes()
++        {
++            #include <linux/pci.h>
++
++            typedef int include_linux_pci_stamp;
++        }
+ 
+         chunk   ::decl()
+         {
+@@ -65,7 +63,7 @@
+                 typedef int ${PCI::Device};
+ 
+                 int             err;
+-                ${PCI::Device}  dev = NULL; /* Doesn't work with a pointer */
++                ${PCI::Device}  *dev = NULL;
+ 
+                 err = pci_enable_device(pdev);
+ //              if (err < 0) /* `if' doesn't work */
--- a/series	Thu Jan 05 23:27:32 2012 +0100
+++ b/series	Fri Jan 06 11:45:25 2012 +0100
@@ -1,3 +1,4 @@
 rathaxes_add_a_linux_lkm.patch
 rathaxes_start_to_implement_pci_stuff_in_the_lkm.patch
 maintainers_add_add_rathaxes_lkm_in_use_rathaxes_cmake_file.patch
+rathaxes_fix_lkm_sample_build.patch