[prev in list] [next in list] [prev in thread] [next in thread] 

List:       microblaze-uclinux
Subject:    [microblaze-uclinux] Re: [PATCH 58/60] microblaze_v4: sys_microblaze.c
From:       Michal Simek <monstr () seznam ! cz>
Date:       2008-06-26 19:07:30
Message-ID: 4863E8F2.5080608 () seznam ! cz
[Download RAW message or body]


>> +
>> +/*
>> + * sys_ipc() is the de-multiplexer for the SysV IPC calls..
>> + *
>> + * This is really horribly ugly.
>> + */
> 
> If it's so horribly ugly, don't do it this way ;-)

:-) this is not my part of code. I'll remove it with syscall changes.

>> +int
>> +sys_ipc(uint call, int first, int second, int third, void *ptr, long fifth)
>> +{
>> +	int version, ret;
>> +
>> +	version = call >> 16; /* hack for backward compatibility */
>> +	call &= 0xffff;
> 
> Backwards compatibility with what?

I don't know.
John: I suppose this is your comment.

>> +static inline unsigned long
>> +do_mmap2(unsigned long addr, size_t len,
>> +	unsigned long prot, unsigned long flags,
>> +	unsigned long fd, unsigned long pgoff)
>> +{
>> +	struct file *file = NULL;
>> +	int ret = -EBADF;
>> +
>> +	flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
>> +	if (!(flags & MAP_ANONYMOUS))
>> +		if (!(file = fget(fd))) {
>> +			printk(KERN_INFO "no fd in mmap\r\n");
>> +			goto out;
>> +		}
>> +
>> +	down_write(&current->mm->mmap_sem);
>> +	ret = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
>> +	up_write(&current->mm->mmap_sem);
>> +	if (file)
>> +		fput(file);
>> +out:
>> +	return ret;
>> +}
>> +
>> +unsigned long sys_mmap2(unsigned long addr, size_t len,
>> +			unsigned long prot, unsigned long flags,
>> +			unsigned long fd, unsigned long pgoff)
>> +{
>> +	return do_mmap2(addr, len, prot, flags, fd, pgoff);
>> +}
>> +
>> +unsigned long sys_mmap(unsigned long addr, size_t len,
>> +			unsigned long prot, unsigned long flags,
>> +			unsigned long fd, off_t offset)
>> +{
>> +	int err = -EINVAL;
>> +
>> +	if (offset & ~PAGE_MASK) {
>> +		printk(KERN_INFO "no pagemask in mmap\r\n");
>> +		goto out;
>> +	}
>> +
>> +	err = do_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);
>> +out:
>> +	return err;
>> +}
> 
> Which mmap is uClibc really using? I suppose you only need mmap2, even for
> compatibility with any binary ever built for microblaze.

I don't know. Microblaze should be compiled with uClibc and glibc. In case you
need mmap2 for uClibc and mmap for glibc it is ok.

M

> 	Arnd <><

___________________________
microblaze-uclinux mailing list
microblaze-uclinux@itee.uq.edu.au
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic