linux-mips
[Top] [All Lists]

Re: [PATCH] Introduce __fill_user() and kill __bzero()

To: Thiemo Seufer <ths@networkno.de>
Subject: Re: [PATCH] Introduce __fill_user() and kill __bzero()
From: Franck Bui-Huu <vagabon.xyz@gmail.com>
Date: Wed, 14 Nov 2007 09:24:22 +0100
Cc: Ralf Baechle <ralf@linux-mips.org>, linux-mips <linux-mips@linux-mips.org>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; bh=D8tQCcUSeg1/mPL6dfvMfUtk2xFcplY1Vow7KaTLBZQ=; b=aDSglRRJWel5Igc12je8wLumoIOj67U93htaZp6j69GivXseozv50MPL3YAxx44IWxRRd5bvjKQl9usgUhfYs0Rle6L3XtKQstDWMrILEaXcgjo1V16buRjnlww+lVRhu/01aCaDDy96lLjRW+Xwn7VT7KerLgSJeVhsARnkqgI=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=cztoGC4SuySmtC0lRfYRBoh+39VFObhSFXuIxlb6fvzbRGRWJJEwK21l8HvoxCDHyiSvfX74+tJWL3ABiRraSQ6P437AA53NcjQrvEDN/t4vVvhdXYtHe0YvM+YbJh7dx7KytWJqI4lNwx5AkZVUcW61rQACJ9EZgHd09c1c8so=
In-reply-to: <20071111130130.GB8363@networkno.de>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <4736C1EA.2050009@gmail.com> <20071111130130.GB8363@networkno.de>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Thunderbird 2.0.0.5 (X11/20070719)
Thiemo Seufer wrote:
> Franck Bui-Huu wrote:
>>  /*
>> - * memset(void *s, int c, size_t n)
>> + * An outline version of memset, which should be used either by gcc or
>> + * by assembly code.
>> + */
>> +NESTED(memset, 24, ra)
>> +    PTR_ADDU        sp, sp, -24
>> +    LONG_S          a0, 16(sp)
>> +    LONG_S          ra, 20(sp)
>> +    jal             __fill_user
>> +    LONG_L          v0, 16(sp)
>> +    LONG_L          ra, 20(sp)
>> +    PTR_ADDU        sp, sp, 24
>> +    jr              ra
>> +END(memset)
> 
> This will break on 64bit kernels.
> 

Is the following correct ?

NESTED(memset, 16, ra)
        PTR_ADDU        sp, sp, -16
        LONG_S          a0,  8(sp)
        LONG_S          ra, 16(sp)
        jal             __fill_user
        LONG_L          v0,  8(sp)
        LONG_L          ra, 16(sp)
        PTR_ADDU        sp, sp, 16
        jr              ra
END(memset)

I know it doesn't respect any mips ABI but in this case do
we really care ?

thanks.

                Franck

<Prev in Thread] Current Thread [Next in Thread>