view e1000_add_register_unset.patch @ 78:501bf9cf65dc

wip on e1000 add some fixes for the generation and check that it works on tip
author Louis Opter <louis@lse.epitech.net>
date Sun, 04 Mar 2012 18:55:20 +0100
parents ff90ee2fe1c4
children
line wrap: on
line source

# HG changeset patch
# Parent eb6bb1687169662741a6bd57191b750b3bcbb6b7
rathaxes: add the e1000::register_unset32() function

diff --git a/rathaxes/samples/e1000/e1000.blt b/rathaxes/samples/e1000/e1000.blt
--- a/rathaxes/samples/e1000/e1000.blt
+++ b/rathaxes/samples/e1000/e1000.blt
@@ -339,6 +339,27 @@
         }
     }
 
+    template sequence   e1000::register_unset32(e1000::Context ctx, e1000::Register reg_offset, ::number value)
+    {
+        chunk   LKM::prototypes()
+        {
+            static void rtx_e1000_register_unset32(struct rtx_e1000_ctx *, unsigned int, unsigned int);
+        }
+
+        chunk   LKM::code()
+        {
+            static void rtx_e1000_register_unset32(struct rtx_e1000_ctx *ctx, unsigned int reg_offset, unsigned int value)
+            {
+                iowrite32(rtx_e1000_register_read32(ctx, reg_offset) & ~value, ctx->ioaddr + reg_offset);
+            }
+        }
+
+        chunk   ::CALL()
+        {
+            rtx_e1000_register_unset32(${ctx}, ${reg_offset}, ${value});
+        }
+    }
+
     template sequence   e1000::setup_interrupt_handler(Ethernet::Device ctx)
     {
         chunk   LKM::includes()
diff --git a/rathaxes/samples/e1000/e1000.rti b/rathaxes/samples/e1000/e1000.rti
--- a/rathaxes/samples/e1000/e1000.rti
+++ b/rathaxes/samples/e1000/e1000.rti
@@ -80,4 +80,11 @@
         provided chunk  LKM::code();
         provided chunk  ::CALL();
     }
+
+    provided sequence   e1000::register_unset32(e1000::Context, e1000::Register, ::number)
+    {
+        provided chunk  LKM::prototypes();
+        provided chunk  LKM::code();
+        provided chunk  ::CALL();
+    }
 }