annotate rathaxes_start_to_implement_pci_stuff_in_the_lkm.patch @ 10:44a25ffd5c8c

Reorganize the patch queue a bit: put the cmake patch first then the LKM patch then the PCI part
author Louis Opter <louis@lse.epitech.net>
date Fri, 06 Jan 2012 13:43:06 +0100
parents 5b128dbd2c17
children efee5f0249e2
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
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
2 # Parent 873b66890128280637d97a24221258bb297a1ac8
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
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
5 diff --git a/rathaxes/samples/lkm/CMakeLists.txt b/rathaxes/samples/lkm/CMakeLists.txt
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
6 --- a/rathaxes/samples/lkm/CMakeLists.txt
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
7 +++ b/rathaxes/samples/lkm/CMakeLists.txt
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)
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
18 diff --git a/rathaxes/samples/lkm/lkm.blt b/rathaxes/samples/lkm/lkm.blt
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
19 --- a/rathaxes/samples/lkm/lkm.blt
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
20 +++ b/rathaxes/samples/lkm/lkm.blt
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 }
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
85 diff --git a/rathaxes/samples/lkm/lkm.rti b/rathaxes/samples/lkm/lkm.rti
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
86 --- a/rathaxes/samples/lkm/lkm.rti
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
87 +++ b/rathaxes/samples/lkm/lkm.rti
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 }
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
115 diff --git a/rathaxes/samples/lkm/lkm.rtx b/rathaxes/samples/lkm/lkm.rtx
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
116 --- a/rathaxes/samples/lkm/lkm.rtx
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
117 +++ b/rathaxes/samples/lkm/lkm.rtx
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 }
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
155 diff --git a/rathaxes/samples/lkm/pci.blt b/rathaxes/samples/lkm/pci.blt
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
156 new file mode 100644
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
157 --- /dev/null
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
158 +++ b/rathaxes/samples/lkm/pci.blt
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 @@ -0,0 +1,129 @@
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
160 +with PCI, LKM, Log
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
161 +{
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
162 + template type PCI::Device()
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
163 + {
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
164 + 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
165 + {
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 + #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
167 +
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 + 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
169 + }
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
170 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
171 + chunk ::decl()
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
172 + {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
173 + struct rtx_pci_device
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
174 + {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
175 + struct pci_dev *pci_dev;
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 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
179 + chunk ::init(pci_dev)
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
180 + {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
181 + ${self}.pci_dev = pci_dev;
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 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
184 + map
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 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
189 + template sequence PCI::probe(PCI::Device dev)
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
190 + {
5
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
191 + chunk LKM::prototypes()
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
192 + {
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
193 + 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
194 + const struct pci_device_id *);
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
195 + }
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
196 +
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
197 + chunk LKM::code()
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
198 + {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
199 + 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
200 + const struct pci_device_id *pdev_id)
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
201 + {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
202 + /* workaround for CNorm __std__ dialect, shouldn't be here */
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
203 + typedef int ${PCI::Device};
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
204 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
205 + 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
206 + ${PCI::Device} *dev = NULL;
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
207 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
208 + err = pci_enable_device(pdev);
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
209 +// if (err < 0) /* `if' doesn't work */
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
210 +// goto fail;
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
211 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
212 + ${pointcut ::IMPLEMENTATION};
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
213 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
214 + pci_set_drvdata(pdev, dev);
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
215 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
216 + return 0;
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
217 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
218 + fail:
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
219 + return err;
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 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
224 + template sequence PCI::remove(PCI::Device dev)
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
225 + {
5
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
226 + chunk LKM::prototypes()
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
227 + {
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
228 + static void rtx_pci_remove(struct pci_dev *);
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
229 + }
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
230 +
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
231 + chunk LKM::code()
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
232 + {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
233 + static void rtx_pci_remove(struct pci_dev *pdev)
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
234 + {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
235 + pci_disable_device(pdev);
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
236 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
237 + ${pointcut ::IMPLEMENTATION};
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 + }
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
240 + }
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
241 +
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 + 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
243 + {
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 + 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
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 + /*
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 + * 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
248 + * 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
249 + */
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 + static struct pci_device_id rtx_pci_device_table[2] = {
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 + { ${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
252 + { 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
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 +
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 + 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
256 + .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
257 + .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
258 + .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
259 + .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
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 +
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 + 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
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 + /*
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 + * 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
267 + */
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
268 + pci_register_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
269 + /*
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
270 + * if (pci_register_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
271 + * {
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
272 + * `if' still doesn't work.
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
273 + *
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
274 + * Also, can I call the Log interface from here?
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 + * ${Log::info("Message")}; doesn't seem to work.
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 + }
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 +
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 + 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
282 + {
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 + 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
284 + {
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
285 + 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
286 + }
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
287 + }
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
288 +}
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
289 diff --git a/rathaxes/samples/lkm/pci.rti b/rathaxes/samples/lkm/pci.rti
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
290 new file mode 100644
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
291 --- /dev/null
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
292 +++ b/rathaxes/samples/lkm/pci.rti
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
293 @@ -0,0 +1,30 @@
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
294 +interface PCI : LKM
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
295 +{
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
296 + provided type PCI::Device;
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
297 +
5
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
298 + required variable ::number PCI::vendor_id;
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
299 + required variable ::number PCI::product_id;
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
300 +
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
301 + provided sequence PCI::register()
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
302 + {
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
303 + 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
304 + 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
305 + }
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
306 +
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
307 + 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
308 + {
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
309 + provided chunk ::CALL;
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
310 + }
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
311 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
312 + required sequence PCI::probe(PCI::Device)
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
313 + {
5
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
314 + provided chunk LKM::prototypes;
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
315 + provided chunk LKM::code;
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
316 + }
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
317 +
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
318 + required sequence PCI::remove(PCI::Device)
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
319 + {
5
e94d4a9e6bd5 WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents: 4
diff changeset
320 + provided chunk LKM::prototypes;
4
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
321 + provided chunk LKM::code;
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
322 + }
d102c9be499c WIP on the PCI LKM
Louis Opter <louis@lse.epitech.net>
parents:
diff changeset
323 +}