annotate rathaxes_e1000_move_the_interrupt_init_and_cleanup_into_ethernet.patch @ 108:7efe3212db3a

Put the patches on e1000 above the patches on the compiler
author Louis Opter <louis@lse.epita.fr>
date Sun, 31 Mar 2013 20:00:09 -0700
parents f42751b8ca99
children
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
108
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
2 # Parent 7be52c02870a053b3a12e75423226c252e256c6b
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
108
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
12 @@ -247,7 +247,6 @@
104
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;
108
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
20 @@ -265,14 +264,12 @@
104
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 {
108
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
29 ${e1000::Context.ref} hw_ctx = &${rtx_ether_ctx}->hw_ctx;
104
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
108
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
36 @@ -605,68 +602,6 @@
104
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 *);
108
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
178 @@ -122,6 +130,20 @@
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
179 {
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
180 ${Ethernet::Device.ref} rtx_ether_ctx = netdev_priv(dev);
104
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
181
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
182 + int error;
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
183 + {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
184 + ${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
185 + }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
186 + 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
187 + rtx_ethernet_interrupt_handler,
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
188 + IRQF_SHARED,
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
189 + ${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
190 + dev);
104
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
191 + if (error)
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
192 + {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
193 + ${Log::info("Cannot register the interrupt handler")};
108
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
194 + return error;
104
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
195 + }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
196 ${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
197
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
198 return 0;
108
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
199 @@ -161,7 +183,15 @@
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
200 {
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
201 ${Ethernet::Device.ref} rtx_ether_ctx = netdev_priv(dev);
104
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
202
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
203 - ${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
204 + /* 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
205 + {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
206 + ${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
207 + }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
208 +
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
209 + 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
210 + {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
211 + ${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
212 + }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
213
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
214 return 0;
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
215 }
108
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
216 @@ -183,7 +213,9 @@
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
217 {
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
218 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
219 {
108
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
220 - ${Ethernet::Device.ref} rtx_ether_ctx = dev_id;
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
221 + ${Ethernet::AbstractDevice.ref} rtx_net_dev = dev_id;
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
222 + ${Ethernet::Device.ref} rtx_ether_ctx;
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
223 + 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
224
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 ${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
226
108
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
227 @@ -260,13 +292,10 @@
104
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
228 */
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
229 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
230 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
231 - 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
232 ${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
233 - ${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
234 ${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
235 local.bars,
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
236 - local.ioaddr,
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
237 - local.irq)};
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
238 + local.ioaddr)};
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
239 ${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
240 ${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
241 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
242 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
243 --- 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
244 +++ 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
245 @@ -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
246 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
247 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
248 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
249 + /*
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
250 + * 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
251 + * 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
252 + */
108
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
253 + attribute Builtin::symbol.scalar rtx_ether_ctx;
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
254 }
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
255
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
256 provided type Device
108
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
257 @@ -34,12 +39,14 @@
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
258 * I'd like to use better names here, but I'd like to understand the
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
259 * difference between the two first:
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
260 */
108
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
261 - attribute Builtin::symbol.ref perm_addr;
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
262 - attribute Builtin::symbol.ref dev_addr;
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
263 + attribute Builtin::symbol.ref perm_addr;
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
264 + attribute Builtin::symbol.ref dev_addr;
7efe3212db3a Put the patches on e1000 above the patches on the compiler
Louis Opter <louis@lse.epita.fr>
parents: 107
diff changeset
265 + 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
266 }
104
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
267
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
268 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
269 {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
270 + provided chunk LKM::includes();
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
271 provided chunk LKM::prototypes();
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
272 provided chunk LKM::code();
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
273 }
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
274 @@ -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
275
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
276 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
277 Builtin::number,
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
278 - Builtin::symbol,
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
279 - Builtin::number);
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
280 + Builtin::symbol);
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
281 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
282 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
283 }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
284 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
285 --- 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
286 +++ 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
287 @@ -4,13 +4,6 @@
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
288 {
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
289 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
290
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
291 - /*
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
292 - * 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
293 - * more coherent.
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
294 - */
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
295 -
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
296 - 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
297 - 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
298
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
299 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
300 Log::info("device activated");
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
301 @@ -32,9 +25,6 @@
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
302 */
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
303 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
304 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
305 -
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
306 - 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
307 - 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
308 }
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
309
c4c33ac02b93 First try at splitting the type nightmare and the refactoring
Louis Opter <louis@lse.epita.fr>
parents:
diff changeset
310 Ethernet::interrupt_handler(Ethernet::Device dev)