annotate rathaxes_e1000_move_the_interrupt_init_and_cleanup_into_ethernet.patch @ 107:f42751b8ca99

Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
author Louis Opter <louis@lse.epita.fr>
date Sun, 24 Mar 2013 21:47:39 -0700
parents 976a4b87803f
children 7efe3212db3a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
104
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
1 # HG changeset patch
107
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
2 # Parent a611642de7f291e4749a7f44027f9ebaa0cde75c
105
fb20f01ea997 Wip, note: the interrupt handler refactoring patch is broken, I have to find the fix from the abstract type notation patch
Louis Opter <louis@lse.epita.fr>
parents: 104
diff changeset
3 Move the interrupt handler init/cleanup out of e1000.blt
fb20f01ea997 Wip, note: the interrupt handler refactoring patch is broken, I have to find the fix from the abstract type notation patch
Louis Opter <louis@lse.epita.fr>
parents: 104
diff changeset
4
fb20f01ea997 Wip, note: the interrupt handler refactoring patch is broken, I have to find the fix from the abstract type notation patch
Louis Opter <louis@lse.epita.fr>
parents: 104
diff changeset
5 This is not device dependant and can be done from the Ethernet subsystem
fb20f01ea997 Wip, note: the interrupt handler refactoring patch is broken, I have to find the fix from the abstract type notation patch
Louis Opter <louis@lse.epita.fr>
parents: 104
diff changeset
6 right now, (plus the interrupt handler itself was already in the
fb20f01ea997 Wip, note: the interrupt handler refactoring patch is broken, I have to find the fix from the abstract type notation patch
Louis Opter <louis@lse.epita.fr>
parents: 104
diff changeset
7 Ethernet subsytem).
104
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
8
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
9 diff --git a/rathaxes/samples/e1000/e1000.blt b/rathaxes/samples/e1000/e1000.blt
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
10 --- a/rathaxes/samples/e1000/e1000.blt
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
11 +++ b/rathaxes/samples/e1000/e1000.blt
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
12 @@ -249,7 +249,6 @@
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
13 {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
14 int bars;
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
15 unsigned char /* __iomem */ *ioaddr;
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
16 - int irq;
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
17
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
18 ${e1000::RxRing} rx_ring;
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
19 ${e1000::TxRing} tx_ring;
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
20 @@ -267,14 +266,12 @@
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
21
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
22 chunk Ethernet::adapter_init_context(Ethernet::Device rtx_ether_ctx,
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
23 Builtin::number bars,
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
24 - Builtin::symbol ioaddr,
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
25 - Builtin::number irq)
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
26 + Builtin::symbol ioaddr)
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
27 {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
28 {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
29 ${e1000::Context} *hw_ctx = &${rtx_ether_ctx}->hw_ctx;
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
30 hw_ctx->bars = ${bars};
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
31 hw_ctx->ioaddr = ${ioaddr};
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
32 - hw_ctx->irq = ${irq};
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
33 }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
34 }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
35
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
36 @@ -606,68 +603,6 @@
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
37 }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
38 }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
39
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
40 - template sequence e1000::setup_interrupt_handler(Ethernet::Device rtx_ether_ctx)
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
41 - {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
42 - chunk LKM::includes()
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
43 - {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
44 - #include <linux/interrupt.h>
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
45 - }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
46 -
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
47 - chunk LKM::prototypes()
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
48 - {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
49 - static int e1000_setup_interrupt_handler(${Ethernet::Device} *);
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
50 - }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
51 -
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
52 - chunk LKM::code()
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
53 - {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
54 - static int e1000_setup_interrupt_handler(${Ethernet::Device} *rtx_ether_ctx)
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
55 - {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
56 - int error;
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
57 -
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
58 - error = request_irq(rtx_ether_ctx->hw_ctx.irq,
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
59 - rtx_ethernet_interrupt_handler,
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
60 - IRQF_SHARED,
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
61 - ${config.name},
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
62 - rtx_ether_ctx);
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
63 -
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
64 - if (error)
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
65 - ${Log::info("cannot register the interrupt handler")};
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
66 -
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
67 - return error;
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
68 - }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
69 - }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
70 -
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
71 - chunk ::CALL()
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
72 - {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
73 - int error = e1000_setup_interrupt_handler(${rtx_ether_ctx});
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
74 - if (error)
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
75 - {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
76 - return error;
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
77 - }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
78 - }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
79 - }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
80 -
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
81 - template sequence free_interrupt_handler(Ethernet::Device rtx_ether_ctx)
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
82 - {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
83 - chunk prototypes()
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
84 - {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
85 - static void e1000_free_interrupt_handler(${Ethernet::Device} *rtx_ether_ctx);
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
86 - }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
87 -
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
88 - chunk code()
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
89 - {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
90 - static void e1000_free_interrupt_handler(${Ethernet::Device} *rtx_ether_ctx)
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
91 - {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
92 - free_irq(rtx_ether_ctx->hw_ctx.irq, rtx_ether_ctx);
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
93 - }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
94 - }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
95 -
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
96 - chunk ::CALL()
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
97 - {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
98 - e1000_free_interrupt_handler(${rtx_ether_ctx});
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
99 - }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
100 - }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
101 -
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
102 template sequence activate_device_interruption(Ethernet::Device rtx_ether_ctx)
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
103 {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
104 chunk ::CALL()
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
105 diff --git a/rathaxes/samples/e1000/e1000.rti b/rathaxes/samples/e1000/e1000.rti
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
106 --- a/rathaxes/samples/e1000/e1000.rti
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
107 +++ b/rathaxes/samples/e1000/e1000.rti
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
108 @@ -13,8 +13,7 @@
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
109 /* Callbacks/Hooks which should probably be in the front-end: */
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
110 chunk Ethernet::adapter_init_context(Ethernet::Device,
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
111 Builtin::number,
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
112 - Builtin::symbol,
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
113 - Builtin::number);
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
114 + Builtin::symbol);
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
115 chunk Ethernet::adapter_reset(Ethernet::Device);
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
116 chunk Ethernet::adapter_load_mac_address(Ethernet::Device);
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
117 }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
118 @@ -85,21 +84,6 @@
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
119 provided chunk ::CALL();
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
120 }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
121
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
122 - provided sequence setup_interrupt_handler(Ethernet::Device)
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
123 - {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
124 - provided chunk LKM::includes(); // works without this one
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
125 - provided chunk LKM::prototypes();
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
126 - provided chunk LKM::code();
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
127 - provided chunk ::CALL();
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
128 - }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
129 -
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
130 - provided sequence free_interrupt_handler(Ethernet::Device)
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
131 - {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
132 - provided chunk LKM::prototypes();
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
133 - provided chunk LKM::code();
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
134 - provided chunk ::CALL();
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
135 - }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
136 -
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
137 provided sequence activate_device_interruption(Ethernet::Device)
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
138 {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
139 provided chunk ::CALL();
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
140 diff --git a/rathaxes/samples/e1000/ethernet.blt b/rathaxes/samples/e1000/ethernet.blt
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
141 --- a/rathaxes/samples/e1000/ethernet.blt
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
142 +++ b/rathaxes/samples/e1000/ethernet.blt
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
143 @@ -1,4 +1,4 @@
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
144 -with Ethernet, PCI, LKM, Log
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
145 +with Ethernet, PCI, LKM, Log, Builtin
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
146 {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
147 template type Ethernet::ProtocolId()
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
148 {
107
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
149 @@ -61,7 +61,9 @@
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
150
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
151 map
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
152 {
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
153 - netdev: ${self}->ndev;
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
154 + netdev: ${self}->ndev;
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
155 + /* This could be another init method for Ethernet::Device: */
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
156 + rtx_ether_ctx: netdev_priv(&${self}->ndev);
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
157 }
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
158 }
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
159
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
160 @@ -106,11 +108,17 @@
105
fb20f01ea997 Wip, note: the interrupt handler refactoring patch is broken, I have to find the fix from the abstract type notation patch
Louis Opter <louis@lse.epita.fr>
parents: 104
diff changeset
161 net_device: ${self}->net_dev;
fb20f01ea997 Wip, note: the interrupt handler refactoring patch is broken, I have to find the fix from the abstract type notation patch
Louis Opter <louis@lse.epita.fr>
parents: 104
diff changeset
162 perm_addr: ${self}->net_dev->ndev.perm_addr;
fb20f01ea997 Wip, note: the interrupt handler refactoring patch is broken, I have to find the fix from the abstract type notation patch
Louis Opter <louis@lse.epita.fr>
parents: 104
diff changeset
163 dev_addr: ${self}->net_dev->ndev.dev_addr;
fb20f01ea997 Wip, note: the interrupt handler refactoring patch is broken, I have to find the fix from the abstract type notation patch
Louis Opter <louis@lse.epita.fr>
parents: 104
diff changeset
164 + irq: ${self}->pci_dev->data.irq;
fb20f01ea997 Wip, note: the interrupt handler refactoring patch is broken, I have to find the fix from the abstract type notation patch
Louis Opter <louis@lse.epita.fr>
parents: 104
diff changeset
165 }
fb20f01ea997 Wip, note: the interrupt handler refactoring patch is broken, I have to find the fix from the abstract type notation patch
Louis Opter <louis@lse.epita.fr>
parents: 104
diff changeset
166 }
104
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
167
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
168 template sequence Ethernet::open(Ethernet::Device dev)
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
169 {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
170 + chunk LKM::includes()
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
171 + {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
172 + #include <linux/interrupt.h>
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
173 + }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
174 +
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
175 chunk LKM::prototypes()
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
176 {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
177 static int rtx_ethernet_open(struct net_device *);
107
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
178 @@ -123,9 +131,28 @@
104
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
179 ${Ethernet::Device} *rtx_ether_ctx = netdev_priv(dev);
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
180
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
181 ${cast local.rtx_ether_ctx as Ethernet::Device};
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
182 +
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
183 + int error;
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
184 + {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
185 + ${Log::info("installing the interrupt handler")};
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
186 + }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
187 + error = request_irq(${local.rtx_ether_ctx.irq},
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
188 + rtx_ethernet_interrupt_handler,
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
189 + IRQF_SHARED,
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
190 + ${config.name},
105
fb20f01ea997 Wip, note: the interrupt handler refactoring patch is broken, I have to find the fix from the abstract type notation patch
Louis Opter <louis@lse.epita.fr>
parents: 104
diff changeset
191 + dev);
104
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
192 + if (error)
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
193 + {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
194 + ${Log::info("Cannot register the interrupt handler")};
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
195 + goto error;
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
196 + }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
197 +
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
198 ${pointcut ::IMPLEMENTATION(local.rtx_ether_ctx)};
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
199
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
200 return 0;
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
201 +
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
202 + error:
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
203 + return error;
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
204 }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
205 }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
206 }
107
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
207 @@ -165,7 +192,16 @@
104
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
208 ${Ethernet::Device} *rtx_ether_ctx = netdev_priv(dev);
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
209
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
210 ${cast local.rtx_ether_ctx as Ethernet::Device};
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
211 - ${pointcut ::IMPLEMENTATION(local.rtx_ether_ctx)};
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
212 +
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
213 + /* TODO: change this pointcut into a pointcut/adapter/callback: */
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
214 + {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
215 + ${pointcut ::IMPLEMENTATION(local.rtx_ether_ctx)};
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
216 + }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
217 +
105
fb20f01ea997 Wip, note: the interrupt handler refactoring patch is broken, I have to find the fix from the abstract type notation patch
Louis Opter <louis@lse.epita.fr>
parents: 104
diff changeset
218 + free_irq(${local.rtx_ether_ctx.irq}, dev);
104
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
219 + {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
220 + ${Log::info("interrupt handler free'ed")};
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
221 + }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
222
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
223 return 0;
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
224 }
107
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
225 @@ -187,9 +223,12 @@
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
226 {
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
227 static enum irqreturn rtx_ethernet_interrupt_handler(int irq, void *dev_id)
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
228 {
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
229 - ${Ethernet::Device} *rtx_ether_ctx = dev_id;
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
230 + ${Ethernet::AbstractDevice} *rtx_net_dev = dev_id;
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
231 + ${cast local.rtx_net_dev as Ethernet::AbstractDevice};
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
232 + ${Ethernet::Device} *rtx_ether_ctx;
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
233 + ${cast local.rtx_ether_ctx as Ethernet::Device};
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
234 + rtx_ether_ctx = ${local.rtx_net_dev.rtx_ether_ctx};
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
235
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
236 - ${cast local.rtx_ether_ctx as Ethernet::Device};
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
237 ${pointcut ::IMPLEMENTATION(local.rtx_ether_ctx)};
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
238
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
239 return IRQ_NONE;
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
240 @@ -267,14 +306,11 @@
104
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
241 */
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
242 int bars = ${rtx_pci_dev.bars};
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
243 unsigned char /* __iomem */ *ioaddr = ${rtx_pci_dev.ioaddr};
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
244 - int irq = ${rtx_pci_dev.irq};
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
245 ${cast local.bars as Builtin::number};
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
246 - ${cast local.irq as Builtin::number};
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
247 ${cast local.rtx_ether_ctx as Ethernet::Device};
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
248 ${pointcut Ethernet::adapter_init_context(local.rtx_ether_ctx,
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
249 local.bars,
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
250 - local.ioaddr,
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
251 - local.irq)};
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
252 + local.ioaddr)};
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
253 ${pointcut Ethernet::adapter_reset(local.rtx_ether_ctx)};
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
254 ${pointcut Ethernet::adapter_load_mac_address(local.rtx_ether_ctx)};
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
255 memcpy(${local.rtx_ether_ctx.perm_addr},
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
256 diff --git a/rathaxes/samples/e1000/ethernet.rti b/rathaxes/samples/e1000/ethernet.rti
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
257 --- a/rathaxes/samples/e1000/ethernet.rti
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
258 +++ b/rathaxes/samples/e1000/ethernet.rti
107
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
259 @@ -18,6 +18,11 @@
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
260 chunk LKM::includes();
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
261 decl data_types();
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
262 attribute Builtin::symbol.scalar netdev;
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
263 + /*
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
264 + * XXX: should be a Ethernet::Device, but that causes a circular
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
265 + * dependency:
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
266 + */
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
267 + attribute Builtin::symbol rtx_ether_ctx;
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
268 }
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
269
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
270 provided type Device
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
271 @@ -36,10 +41,12 @@
105
fb20f01ea997 Wip, note: the interrupt handler refactoring patch is broken, I have to find the fix from the abstract type notation patch
Louis Opter <louis@lse.epita.fr>
parents: 104
diff changeset
272 */
106
976a4b87803f Fix the resolution and the e1000 sample with the new scalar ref feature
David Pineau <dav.pineau@gmail.com>
parents: 105
diff changeset
273 attribute Builtin::symbol.scalar perm_addr;
976a4b87803f Fix the resolution and the e1000 sample with the new scalar ref feature
David Pineau <dav.pineau@gmail.com>
parents: 105
diff changeset
274 attribute Builtin::symbol.scalar dev_addr;
976a4b87803f Fix the resolution and the e1000 sample with the new scalar ref feature
David Pineau <dav.pineau@gmail.com>
parents: 105
diff changeset
275 + attribute Builtin::symbol.scalar irq;
105
fb20f01ea997 Wip, note: the interrupt handler refactoring patch is broken, I have to find the fix from the abstract type notation patch
Louis Opter <louis@lse.epita.fr>
parents: 104
diff changeset
276 }
104
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
277
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
278 required sequence open(Ethernet::Device)
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
279 {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
280 + provided chunk LKM::includes();
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
281 provided chunk LKM::prototypes();
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
282 provided chunk LKM::code();
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
283 }
107
f42751b8ca99 Fix the interrupt handler refactoring patch and update the abstract type notation patch accordingly
Louis Opter <louis@lse.epita.fr>
parents: 106
diff changeset
284 @@ -69,8 +76,7 @@
104
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
285
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
286 provided pointcut Ethernet::adapter_init_context(Ethernet::Device,
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
287 Builtin::number,
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
288 - Builtin::symbol,
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
289 - Builtin::number);
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
290 + Builtin::symbol);
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
291 provided pointcut Ethernet::adapter_reset(Ethernet::Device);
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
292 provided pointcut Ethernet::adapter_load_mac_address(Ethernet::Device);
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
293 }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
294 diff --git a/rathaxes/samples/e1000/lkm.rtx b/rathaxes/samples/e1000/lkm.rtx
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
295 --- a/rathaxes/samples/e1000/lkm.rtx
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
296 +++ b/rathaxes/samples/e1000/lkm.rtx
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
297 @@ -4,13 +4,6 @@
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
298 {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
299 Log::info("opening the device");
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
300
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
301 - /*
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
302 - * Maybe e1000::create_device should be called from here, to be
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
303 - * more coherent.
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
304 - */
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
305 -
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
306 - e1000::setup_interrupt_handler(dev);
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
307 - Log::info("interrupt handler installed");
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
308
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
309 e1000::set_up_device(dev);
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
310 Log::info("device activated");
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
311 @@ -32,9 +25,6 @@
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
312 */
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
313 e1000::free_rx_tx(dev);
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
314 Log::info("free'ed up rx/tx resources");
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
315 -
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
316 - e1000::free_interrupt_handler(dev);
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
317 - Log::info("interrupt handler free'ed");
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
318 }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
319
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
320 Ethernet::interrupt_handler(Ethernet::Device dev)