Mercurial > archived > louis > epitech > mq > rathaxes
view e1000_add_register_unset.patch @ 74:ff90ee2fe1c4
Remove the finished patch on e1000 improvements and start a new series on e1000
author | Louis Opter <louis@lse.epitech.net> |
---|---|
date | Sat, 03 Mar 2012 16:00:49 +0100 |
parents | |
children | 501bf9cf65dc |
line wrap: on
line source
# HG changeset patch # Parent cd5050576637389b1ec0086faafc035596de237c 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 @@ -82,4 +82,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; + } }