lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Sat, 30 Dec 2006 01:00:50 +0100 From: Bodo Eggert <7eggert@....de> To: Jan Engelhardt <jengelh@...ux01.gwdg.de>, Daniel Marjamäki <daniel.marjamaki@...il.com>, Arjan van de Ven <arjan@...radead.org>, linux-kernel@...r.kernel.org Subject: Re: Want comments regarding patch Jan Engelhardt <jengelh@...ux01.gwdg.de> wrote: > On Dec 29 2006 07:57, Daniel Marjamäki wrote: >> It was my goal to improve the readability. I failed. >> >> I personally prefer to use standard functions instead of writing code. >> In my opinion using standard functions means less code that is easier to >> read. > > Hm in that case, what about having something like > > void *memset_int(void *a, int x, int n) { > asm("mov %0, %%esi; > mov %1, %%eax; > mov %2, %%ecx; > repz movsd;", > a,x,n); > } This would copy the to-be-initialized buffer somewhere, if it compiles. 1) You want stosd, "store string", not "move string" 2) You'll want to set %%di (destination index) instead of %%si. 3) repz should be illegal for movs, it might be interpreted as rep by defective assemblers, since it generates the same prefix. "rep" is correct here, since you don't want to break on (non-)zero-words. 4) Mind the direction flag. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists