annotate rathaxes_start_to_implement_pci_stuff_in_the_lkm.patch @ 30:b4ca25b88690

Finish patches on the CMake library and on #includes
author Louis Opter <louis@lse.epitech.net>
date Sat, 07 Jan 2012 21:11:13 +0100
parents 65523c345b40
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
1 # HG changeset patch
22
65523c345b40 rathaxes:: add logs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 21
diff changeset
2 # Parent 6e00628ccba9fd82577a8a30fe4e730bc982e987
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
3 rathaxes: start to implement the PCI registration part in the LKM sample
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
4
22
65523c345b40 rathaxes:: add logs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 21
diff changeset
5 diff -r 6e00628ccba9 rathaxes/samples/lkm/CMakeLists.txt
65523c345b40 rathaxes:: add logs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 21
diff changeset
6 --- a/rathaxes/samples/lkm/CMakeLists.txt Sat Jan 07 19:07:39 2012 +0100
65523c345b40 rathaxes:: add logs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 21
diff changeset
7 +++ b/rathaxes/samples/lkm/CMakeLists.txt Sat Jan 07 19:10:21 2012 +0100
6
5b128dbd2c17 WIP on the PCI LKM + improve the UseRathaxes CMake "library" to easily build a kernel module from the sources generated by rathaxes
Louis Opter <louis@lse.epitech.net>
parents: 5
diff changeset
8 @@ -1,3 +1,7 @@
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
9 ADD_RATHAXES_SOURCES(lkm lkm.rtx
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
10 - RTI log.rti lkm.rti
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
11 - BLT log.blt lkm.blt)
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
12 + RTI log.rti lkm.rti pci.rti
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
13 + BLT log.blt lkm.blt pci.blt)
6
5b128dbd2c17 WIP on the PCI LKM + improve the UseRathaxes CMake "library" to easily build a kernel module from the sources generated by rathaxes
Louis Opter <louis@lse.epitech.net>
parents: 5
diff changeset
14 +
5b128dbd2c17 WIP on the PCI LKM + improve the UseRathaxes CMake "library" to easily build a kernel module from the sources generated by rathaxes
Louis Opter <louis@lse.epitech.net>
parents: 5
diff changeset
15 +# We can't name lkm since it's already used as the target name to generate the
5b128dbd2c17 WIP on the PCI LKM + improve the UseRathaxes CMake "library" to easily build a kernel module from the sources generated by rathaxes
Louis Opter <louis@lse.epitech.net>
parents: 5
diff changeset
16 +# source (with ADD_RATHAXES_SOURCES).
5b128dbd2c17 WIP on the PCI LKM + improve the UseRathaxes CMake "library" to easily build a kernel module from the sources generated by rathaxes
Louis Opter <louis@lse.epitech.net>
parents: 5
diff changeset
17 +ADD_RATHAXES_LKM(lkm_hello lkm)
22
65523c345b40 rathaxes:: add logs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 21
diff changeset
18 diff -r 6e00628ccba9 rathaxes/samples/lkm/lkm.blt
65523c345b40 rathaxes:: add logs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 21
diff changeset
19 --- a/rathaxes/samples/lkm/lkm.blt Sat Jan 07 19:07:39 2012 +0100
65523c345b40 rathaxes:: add logs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 21
diff changeset
20 +++ b/rathaxes/samples/lkm/lkm.blt Sat Jan 07 19:10:21 2012 +0100
5
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
21 @@ -1,8 +1,10 @@
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
22 with LKM
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
23 {
5
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
24 + /* Skel of the generated C file: */
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
25 ${pointcut LKM::includes};
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
26 - ${pointcut LKM::init};
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
27 - ${pointcut LKM::exit};
5
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
28 + ${pointcut LKM::prototypes};
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
29 + ${pointcut LKM::data};
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
30 + ${pointcut LKM::code};
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
31
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
32 template sequence LKM::init()
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
33 {
10
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
34 @@ -10,22 +12,29 @@
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
35 {
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
36 #include <linux/module.h>
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
37 #include <linux/kernel.h>
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
38 - typedef int lkm_headers_include_stamp;
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
39
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
40 + typedef int include_linux_module_stamp;
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
41 + typedef int include_linux_kernel_stamp;
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
42 + }
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
43 +
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
44 + chunk LKM::data()
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
45 + {
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
46 MODULE_DESCRIPTION(${config.description});
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
47 MODULE_AUTHOR(${config.author});
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
48 MODULE_LICENSE(${config.license});
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
49 }
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
50
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
51 - chunk LKM::init()
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
52 + chunk LKM::code()
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
53 {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
54 /*
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
55 * Rathaxes doesn't yet support arbitrary "decorators" like __init
10
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
56 * or __exit.
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
57 */
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
58 - static int __attribute__((__section__(.init.text))) rtx_module_init(void)
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
59 + static int __attribute__((__section__(".init.text"))) rtx_module_init(void)
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
60 {
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
61 ${pointcut ::IMPLEMENTATION};
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
62 +
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
63 + return 0;
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
64 }
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
65
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
66 module_init(rtx_module_init);
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
67 @@ -34,14 +43,14 @@
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
68
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
69 template sequence LKM::exit()
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
70 {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
71 - chunk LKM::exit
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
72 + chunk LKM::code()
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
73 {
10
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
74 - static void __attribute((__section__(.exit.text))) rtx_module_exit(void)
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
75 + static void __attribute__((__section__(".exit.text"))) rtx_module_exit(void)
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
76 {
10
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
77 ${pointcut ::IMPLEMENTATION};
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
78 }
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
79
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
80 - module_exit(rtx_module_init);
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
81 + module_exit(rtx_module_exit);
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
82 }
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
83 }
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
84 }
22
65523c345b40 rathaxes:: add logs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 21
diff changeset
85 diff -r 6e00628ccba9 rathaxes/samples/lkm/lkm.rti
65523c345b40 rathaxes:: add logs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 21
diff changeset
86 --- a/rathaxes/samples/lkm/lkm.rti Sat Jan 07 19:07:39 2012 +0100
65523c345b40 rathaxes:: add logs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 21
diff changeset
87 +++ b/rathaxes/samples/lkm/lkm.rti Sat Jan 07 19:10:21 2012 +0100
6
5b128dbd2c17 WIP on the PCI LKM + improve the UseRathaxes CMake "library" to easily build a kernel module from the sources generated by rathaxes
Louis Opter <louis@lse.epitech.net>
parents: 5
diff changeset
88 @@ -1,8 +1,10 @@
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
89 interface LKM
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
90 {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
91 provided pointcut LKM::includes;
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
92 - provided pointcut LKM::init;
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
93 - provided pointcut LKM::exit;
6
5b128dbd2c17 WIP on the PCI LKM + improve the UseRathaxes CMake "library" to easily build a kernel module from the sources generated by rathaxes
Louis Opter <louis@lse.epitech.net>
parents: 5
diff changeset
94 + /* maybe it should be possible to use chunk ::decl in sequence templates? */
5
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
95 + provided pointcut LKM::prototypes;
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
96 + provided pointcut LKM::data;
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
97 + provided pointcut LKM::code;
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
98
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
99 required variable ::string LKM::author;
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
100 required variable ::string LKM::description;
6
5b128dbd2c17 WIP on the PCI LKM + improve the UseRathaxes CMake "library" to easily build a kernel module from the sources generated by rathaxes
Louis Opter <louis@lse.epitech.net>
parents: 5
diff changeset
101 @@ -11,11 +13,11 @@
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
102 required sequence LKM::init()
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
103 {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
104 provided chunk LKM::includes;
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
105 - provided chunk LKM::init;
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
106 + provided chunk LKM::code;
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
107 }
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
108
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
109 required sequence LKM::exit()
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
110 {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
111 - provided chunk LKM::exit;
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
112 + provided chunk LKM::code;
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
113 }
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
114 }
22
65523c345b40 rathaxes:: add logs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 21
diff changeset
115 diff -r 6e00628ccba9 rathaxes/samples/lkm/lkm.rtx
65523c345b40 rathaxes:: add logs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 21
diff changeset
116 --- a/rathaxes/samples/lkm/lkm.rtx Sat Jan 07 19:07:39 2012 +0100
65523c345b40 rathaxes:: add logs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 21
diff changeset
117 +++ b/rathaxes/samples/lkm/lkm.rtx Sat Jan 07 19:10:21 2012 +0100
10
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
118 @@ -1,19 +1,35 @@
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
119 -device LKM use LKM, Log
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
120 +device LKM use LKM, PCI, Log
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
121 {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
122 + PCI::probe(PCI::Device dev)
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
123 + {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
124 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
125 + }
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
126 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
127 + PCI::remove(PCI::Device dev)
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
128 + {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
129 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
130 + }
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
131 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
132 LKM::init()
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
133 {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
134 Log::info("Hello this is LKM");
10
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
135 + PCI::register();
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
136 }
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
137
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
138 LKM::exit()
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
139 {
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
140 Log::info("Good bye this was LKM");
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
141 + PCI::unregister();
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
142 }
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
143 }
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
144
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
145 configuration
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
146 {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
147 + LKM::name = "hello";
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
148 LKM::author = "Rathaxes";
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
149 LKM::description = "Hello World Loadable Kernel Module (LKM)";
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
150 LKM::license = "BSD";
5
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
151 +
10
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
152 + PCI::vendor_id = 0x8086;
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
153 + PCI::product_id = 0x100f;
5
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
154 }
22
65523c345b40 rathaxes:: add logs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 21
diff changeset
155 diff -r 6e00628ccba9 rathaxes/samples/lkm/pci.blt
21
052f9209ca09 rathaxes:: add the ifs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 12
diff changeset
156 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
22
65523c345b40 rathaxes:: add logs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 21
diff changeset
157 +++ b/rathaxes/samples/lkm/pci.blt Sat Jan 07 19:10:21 2012 +0100
65523c345b40 rathaxes:: add logs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 21
diff changeset
158 @@ -0,0 +1,127 @@
10
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
159 +with PCI, LKM, Log
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
160 +{
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
161 + template type PCI::Device()
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
162 + {
10
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
163 + chunk LKM::includes()
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
164 + {
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
165 + #include <linux/pci.h>
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
166 +
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
167 + typedef int include_linux_pci_stamp;
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
168 + }
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
169 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
170 + chunk ::decl()
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
171 + {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
172 + struct rtx_pci_device
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
173 + {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
174 + struct pci_dev *pci_dev;
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
175 + };
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
176 + }
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
177 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
178 + chunk ::init(pci_dev)
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
179 + {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
180 + ${self}.pci_dev = pci_dev;
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
181 + }
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
182 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
183 + map
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
184 + {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
185 + }
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
186 + }
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
187 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
188 + template sequence PCI::probe(PCI::Device dev)
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
189 + {
5
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
190 + chunk LKM::prototypes()
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
191 + {
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
192 + static int /* __devinit */ rtx_pci_probe(struct pci_dev *,
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
193 + const struct pci_device_id *);
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
194 + }
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
195 +
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
196 + chunk LKM::code()
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
197 + {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
198 + static int /* __devinit */ rtx_pci_probe(struct pci_dev *pdev,
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
199 + const struct pci_device_id *pdev_id)
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
200 + {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
201 + /* workaround for CNorm __std__ dialect, shouldn't be here */
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
202 + typedef int ${PCI::Device};
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
203 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
204 + int err;
10
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
205 + ${PCI::Device} *dev = NULL;
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
206 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
207 + err = pci_enable_device(pdev);
21
052f9209ca09 rathaxes:: add the ifs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 12
diff changeset
208 + if (err < 0)
052f9209ca09 rathaxes:: add the ifs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 12
diff changeset
209 + goto fail;
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
210 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
211 + ${pointcut ::IMPLEMENTATION};
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
212 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
213 + pci_set_drvdata(pdev, dev);
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
214 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
215 + return 0;
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
216 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
217 + fail:
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
218 + return err;
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
219 + }
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
220 + }
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
221 + }
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
222 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
223 + template sequence PCI::remove(PCI::Device dev)
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
224 + {
5
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
225 + chunk LKM::prototypes()
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
226 + {
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
227 + static void rtx_pci_remove(struct pci_dev *);
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
228 + }
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
229 +
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
230 + chunk LKM::code()
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
231 + {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
232 + static void rtx_pci_remove(struct pci_dev *pdev)
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
233 + {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
234 + pci_disable_device(pdev);
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
235 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
236 + ${pointcut ::IMPLEMENTATION};
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
237 + }
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
238 + }
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
239 + }
10
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
240 +
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
241 + template sequence PCI::register()
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
242 + {
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
243 + chunk LKM::data()
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
244 + {
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
245 + /*
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
246 + * CNorm doesn't seem to like "dynamic" arrays (i.e: you always
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
247 + * have to specify the exact size).
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
248 + */
22
65523c345b40 rathaxes:: add logs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 21
diff changeset
249 + static struct pci_device_id rtx_pci_device_table[2] = {
10
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
250 + { ${config.vendor_id}, ${config.product_id}, 0, PCI_ANY_ID, PCI_ANY_ID },
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
251 + { 0, }
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
252 + };
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
253 +
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
254 + static struct pci_driver rtx_pci_driver = {
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
255 + .name = ${config.name},
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
256 + .id_table = rtx_pci_device_table,
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
257 + .probe = rtx_pci_probe,
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
258 + .remove = rtx_pci_remove
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
259 + };
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
260 + }
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
261 +
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
262 + chunk ::CALL
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
263 + {
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
264 + /*
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
265 + * So how do we use the return value in the parent context?
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
266 + */
22
65523c345b40 rathaxes:: add logs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 21
diff changeset
267 + int error;
65523c345b40 rathaxes:: add logs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 21
diff changeset
268 + if ((error = pci_register_driver(&rtx_pci_driver)))
21
052f9209ca09 rathaxes:: add the ifs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 12
diff changeset
269 + {
22
65523c345b40 rathaxes:: add logs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 21
diff changeset
270 + ${Log::info("Cannot register pci driver")};
65523c345b40 rathaxes:: add logs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 21
diff changeset
271 + // should we return here.
65523c345b40 rathaxes:: add logs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 21
diff changeset
272 + // error managmement procedure has to be determined ASAP.
65523c345b40 rathaxes:: add logs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 21
diff changeset
273 + return error;
21
052f9209ca09 rathaxes:: add the ifs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 12
diff changeset
274 + }
10
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
275 + }
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
276 + }
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
277 +
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
278 + template sequence PCI::unregister()
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
279 + {
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
280 + chunk ::CALL
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
281 + {
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
282 + pci_unregister_driver(&rtx_pci_driver);
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
283 + }
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
284 + }
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
285 +}
22
65523c345b40 rathaxes:: add logs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 21
diff changeset
286 diff -r 6e00628ccba9 rathaxes/samples/lkm/pci.rti
21
052f9209ca09 rathaxes:: add the ifs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 12
diff changeset
287 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
22
65523c345b40 rathaxes:: add logs
Thomas Sanchez <thomas.sanchz@gmail.com>
parents: 21
diff changeset
288 +++ b/rathaxes/samples/lkm/pci.rti Sat Jan 07 19:10:21 2012 +0100
10
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
289 @@ -0,0 +1,30 @@
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
290 +interface PCI : LKM
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
291 +{
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
292 + provided type PCI::Device;
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
293 +
5
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
294 + required variable ::number PCI::vendor_id;
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
295 + required variable ::number PCI::product_id;
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
296 +
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
297 + provided sequence PCI::register()
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
298 + {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
299 + provided chunk ::CALL;
10
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
300 + provided chunk LKM::data;
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
301 + }
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
302 +
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
303 + provided sequence PCI::unregister()
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
304 + {
44a25ffd5c8c Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
Louis Opter <louis@lse.epitech.net>
parents: 6
diff changeset
305 + provided chunk ::CALL;
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
306 + }
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
307 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
308 + required sequence PCI::probe(PCI::Device)
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
309 + {
5
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
310 + provided chunk LKM::prototypes;
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
311 + provided chunk LKM::code;
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
312 + }
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
313 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
314 + required sequence PCI::remove(PCI::Device)
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
315 + {
5
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
316 + provided chunk LKM::prototypes;
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
317 + provided chunk LKM::code;
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
318 + }
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
319 +}