Microblaze - latest source

Mike Frysinger vapier at gentoo.org
Mon Jul 20 15:14:32 UTC 2009


On Wednesday 30 July 2008 10:33:42 Michal Simek wrote:
> On Wed, Jul 30, 2008 at 02:46:04PM +0200, Michal Simek wrote:
> > >Microblaze community use 0.9.27 version and I would like to upgrade to
> > >latest version and fix all bugs which are in Microblaze part.
> > >
> > > and next question I have is about supporting *nat syscalls (openat,
> > > mknodat and others). Do you have any plan to add it? I do some changes
> > > on ancient 0.9.27 version and I do some test with it. I think uClibc
> > > should support them.
> > >
> > >And then I look at kernel source and compare it with libc declaration. I
> > >think that parameters should be the same.
> > >For example on mknod call. And others. Please correct me if I am wrong.
> > >
> > >static __inline__ _syscall3(int, __syscall_mknod, const char *, path,
> > >        __kernel_mode_t, mode, __kernel_dev_t, dev);
> > >
> > >static __inline__ _syscall3(int, __syscall_mknod, const char *, path,
> > >        __kernel_mode_t, mode, unsigned, dev);
> >
> > Please look at the current version of sysdeps/linux/common/mknod.c for
> > details.
>
> I hope I am on latest source code:
> uClibc
> static __inline__ _syscall3(int, __syscall_mknod, const char *, path,
>         __kernel_mode_t, mode, __kernel_dev_t, dev);
>
> linux-kernel
> asmlinkage long sys_mknodat(int dfd, const char __user *filename, int mode,
>                 unsigned dev)
>
> I think that this two syscalls don't match.

they dont

> What is necessary to do for adding *nat function?
> For example I wrote this part of code and add them to mknod.c for using
> mknodat syscall instead of simple mknod but this function is not called. Is
> it necessary to write reference to somewhere? (I found something in
> sys/stat.h)

did you actually call mknod() ?  are you sure you used the new libc ?  with a 
description like this, it's pretty hard to guess what's going wrong.

> #ifdef __NR_mknodat
> #define AT_FDCWD        -100    /* Special value used to indicate
>                                            openat should use the current
>                                            working directory. */
> #define __NR___syscall_mknodat __NR_mknodat
> static inline _syscall4(int, __syscall_mknodat, int, dfd, const char *,
> path,
>         __kernel_mode_t, mode, unsigned int, dev);
>
> #ifdef __NR_mknod
> #error Please undef __NR_mknod from unistd.h
> #endif
> #else
> #define __NR___syscall_mknod __NR_mknod
> static inline _syscall3(int, __syscall_mknod, const char *, path,
>         __kernel_mode_t, mode, unsigned int, dev);
> #endif
>
> int mknod(const char *path, mode_t mode, dev_t dev)
> {
>     /* We must convert the dev_t value to a __kernel_dev_t */
>     //__kernel_dev_t k_dev;
>     unsigned int k_dev;
>
>     k_dev = ((major(dev) & 0xff) << 8) | (minor(dev) & 0xff);
> #ifdef __NR_mknodat
>     return __syscall_mknodat(AT_FDCWD, path, mode, k_dev);
> #else
>     return __syscall_mknod(path, mode, k_dev);
> #endif
> }

the *at functions should be dedicated symbols instead of rewriting existing 
functions.  then if you really want to implement things like mknod() on top of 
mknodat(), you can have have it call the C function rather than the syscall.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/uclibc/attachments/20090720/32e3ce06/attachment.pgp>


More information about the uClibc mailing list