diff options
Diffstat (limited to 'arch/ppc')
-rw-r--r-- | arch/ppc/amiga/chipram.c | 29 | ||||
-rw-r--r-- | arch/ppc/kernel/syscalls.c | 8 |
2 files changed, 18 insertions, 19 deletions
diff --git a/arch/ppc/amiga/chipram.c b/arch/ppc/amiga/chipram.c index 31f91a794..259522584 100644 --- a/arch/ppc/amiga/chipram.c +++ b/arch/ppc/amiga/chipram.c @@ -1,15 +1,14 @@ /* ** linux/amiga/chipram.c ** -** Modified 03-May-94 by Geert Uytterhoeven -** (Geert.Uytterhoeven@cs.kuleuven.ac.be) +** Modified 03-May-94 by Geert Uytterhoeven <geert@linux-m68k.org> ** - 64-bit aligned allocations for full AGA compatibility */ -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/init.h> +#include <linux/zorro.h> #include <asm/amigahw.h> struct chip_desc { @@ -25,6 +24,8 @@ struct chip_desc { u_long amiga_chip_size; static unsigned long chipavail; +static struct resource chipram = { "Chip RAM", 0 }; + unsigned long amiga_chip_avail( void ) { #ifdef DEBUG @@ -34,8 +35,7 @@ unsigned long amiga_chip_avail( void ) } -__init -void amiga_chip_init (void) +void __init amiga_chip_init (void) { struct chip_desc *dp; @@ -49,6 +49,8 @@ void amiga_chip_init (void) */ amiga_chip_size -= 0x4000; #endif + chipram.end = amiga_chip_size-1; + request_resource(&iomem_resource, &chipram); /* initialize start boundary */ @@ -72,7 +74,7 @@ void amiga_chip_init (void) #endif } -void *amiga_chip_alloc (long size) +void *amiga_chip_alloc(long size, const char *name) { /* last chunk */ struct chip_desc *dp; @@ -82,7 +84,7 @@ void *amiga_chip_alloc (long size) size = (size + 7) & ~7; #ifdef DEBUG - printk("chip_alloc: allocate %ld bytes\n", size); + printk("amiga_chip_alloc: allocate %ld bytes\n", size); #endif /* @@ -108,14 +110,14 @@ void *amiga_chip_alloc (long size) dp = DP((unsigned long)ptr + dp->length); dp->alloced = 1; #ifdef DEBUG - printk ("chip_alloc: no split\n"); + printk ("amiga_chip_alloc: no split\n"); #endif } else { /* split the extent; use the end part */ long newsize = dp->length - (2*sizeof(*dp) + size); #ifdef DEBUG - printk ("chip_alloc: splitting %d to %ld\n", dp->length, + printk ("amiga_chip_alloc: splitting %d to %ld\n", dp->length, newsize); #endif dp->length = newsize; @@ -134,14 +136,18 @@ void *amiga_chip_alloc (long size) } #ifdef DEBUG - printk ("chip_alloc: returning %p\n", ptr); + printk ("amiga_chip_alloc: returning %p\n", ptr); #endif if ((unsigned long)ptr & 7) - panic("chip_alloc: alignment violation\n"); + panic("amiga_chip_alloc: alignment violation\n"); chipavail -= size + (2*sizeof(*dp)); /*MILAN*/ + if (!request_mem_region(ZTWO_PADDR(ptr), size, name)) + printk(KERN_WARNING "amiga_chip_alloc: region of size %ld at 0x%08lx " + "is busy\n", size, ZTWO_PADDR(ptr)); + return ptr; } @@ -156,6 +162,7 @@ void amiga_chip_free (void *ptr) #endif /* deallocate the chunk */ sdp->alloced = edp->alloced = 0; + release_mem_region(ZTWO_PADDR(ptr), sdp->length); /* check if we should merge with the previous chunk */ if (!sdp->first && !sdp[-1].alloced) { diff --git a/arch/ppc/kernel/syscalls.c b/arch/ppc/kernel/syscalls.c index 08d0bc44b..11aa42cad 100644 --- a/arch/ppc/kernel/syscalls.c +++ b/arch/ppc/kernel/syscalls.c @@ -52,25 +52,19 @@ asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on) int sys_iopl(int a1, int a2, int a3, int a4) { - lock_kernel(); printk(KERN_ERR "sys_iopl(%x, %x, %x, %x)!\n", a1, a2, a3, a4); - unlock_kernel(); return (-ENOSYS); } int sys_vm86(int a1, int a2, int a3, int a4) { - lock_kernel(); printk(KERN_ERR "sys_vm86(%x, %x, %x, %x)!\n", a1, a2, a3, a4); - unlock_kernel(); return (-ENOSYS); } int sys_modify_ldt(int a1, int a2, int a3, int a4) { - lock_kernel(); printk(KERN_ERR "sys_modify_ldt(%x, %x, %x, %x)!\n", a1, a2, a3, a4); - unlock_kernel(); return (-ENOSYS); } @@ -84,7 +78,6 @@ sys_ipc (uint call, int first, int second, int third, void *ptr, long fifth) { int version, ret; - lock_kernel(); version = call >> 16; /* hack for backward compatibility */ call &= 0xffff; @@ -171,7 +164,6 @@ sys_ipc (uint call, int first, int second, int third, void *ptr, long fifth) break; } - unlock_kernel(); return ret; } |