Messages in this thread | | | Date | Tue, 24 Jan 2012 10:47:19 +0400 | From | Cyrill Gorcunov <> | Subject | Re: [patch 2/4] [RFC] syscalls, x86: Add __NR_kcmp syscall v4 |
| |
On Tue, Jan 24, 2012 at 11:16:55AM +0900, KAMEZAWA Hiroyuki wrote: ... > > > > Index: linux-2.6.git/arch/x86/include/asm/kcmp.h > > =================================================================== > > --- /dev/null > > +++ linux-2.6.git/arch/x86/include/asm/kcmp.h > > @@ -0,0 +1,17 @@ > > +#ifndef _LINUX_KCMP_H > > +#define _LINUX_KCMP_H > > + > > +/* Comparision type */ > > +enum { > > + KCMP_FILE, > > + KCMP_VM, > > + KCMP_FILES, > > + KCMP_FS, > > + KCMP_SIGHAND, > > + KCMP_IO, > > + KCMP_SYSVSEM, > > + > > + KCMP_TYPES, > > +}; > > + > > +#endif /* _LINUX_KCMP_H */ > > Why under /arch ? >
Hi Kame,
because I've tested it under x86 only. Once someone confirm it's needed on some else arch and does work as expected -- it wont be a problem to make it system wide. Until then -- I think better to stick with at least tested case. ... > > + > > +static long kptr_obfuscate(long v, int type) > > +{ > > + return (v + cookies[type][0]) ^ cookies[type][1]; > > +} > > + > > I'm sorry could you add comments to swho what this does ?
The idea is disorder the in-memory order but remain order suitable for sorting. Anywa, as Peter pointed this helper must be redone. I'll post updated version.
> > It seems this function itself doesn't depend on arch. >
Yes, it doesn't. But as I said if someone confirm it's needed on non-x86 and get tested, that will not be a problem to make it system-side.
Cyrill
| |