From mint-bounce@lists.fishpool.fi Sat Apr 16 20:05:17 2005 X-Original-To: fnaumann@mail.boerde.de Delivered-To: fnaumann@mail.boerde.de Message-ID: <426152EF.7030404@seznam.cz> Date: Sat, 16 Apr 2005 14:01:19 -0400 From: Standa Opichal User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: mint@fishpool.com Subject: Re: [MiNT] .xif module load problem References: <42606A32.8070301@seznam.cz> In-Reply-To: <42606A32.8070301@seznam.cz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-To: mint-bounce@lists.fishpool.fi X-original-sender: opichals@seznam.cz Precedence: bulk List-help: List-unsubscribe: List-Id: X-List-ID: X-Virus-Scanned: by amavisd-new at relay.boerde.de X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on relay.boerde.de X-Spam-Status: No, hits=0.1 tagged_above=-50.5 required=7.0 tests=AWL, BAYES_00 X-Spam-Level: Hi! Also I don't understand why this workaround fixes the problem. Because the actual problem is a stack corruption. After the dummy.xif module successful load the load_modules() dirh.fs contains invalid filesystem pointer... This happens for any .xif module I have tried. STanda Standa Opichal wrote: > Hi! > > In the module.c there is the section you can read at the bottom of this > mail. I tried the same approach for the inet4.xdd XIF loader function > and it solved my problem with loading the .xif drivers in ARAnyM. > > Does anyone have idea why it doesn't work for the module init() function > and all the registers need to be saved? > > regards > > STanda > > > #if 0 > /* > * this don't work?! > * why need the registers to be preserved? > * all the modules are gcc compiled too ... > */ > static void * > module_init(void *initfunc, struct kerinfo *k) > { > void * _cdecl (*init)(struct kerinfo *); > > init = initfunc; > return (*init)(k); > } > #else > static void * > module_init(void *initfunc, struct kerinfo *k) > { > register void *ret __asm__("d0"); > > __asm__ volatile > ( > "moveml d3-d7/a3-a6,sp@-;" > "movl %2,sp@-;" > "movl %1,a0;" > "jsr a0@;" > "addqw #4,sp;" > "moveml sp@+,d3-d7/a3-a6;" > : "=r"(ret) /* outputs */ > : "g"(initfunc), "r"(k) /* inputs */ > : "d0", "d1", "d2", "a0", "a1", "a2", /* clobbered regs */ > "memory" > ); > > return ret; > } > #endif > >