From 338237994ac93ca58f6024ef0f7932ab770735d1 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 16 Jan 2004 13:43:30 +0000 Subject: s/UCLIBC_HAS_MMU/ARCH_HAS_MMU/g --- libc/inet/rpc/rcmd.c | 22 +++++++++++----------- libc/stdlib/malloc-simple/alloc.c | 8 ++++---- libc/stdlib/malloc/malloc.h | 2 +- libc/sysdeps/linux/arm/crt0.S | 2 +- libc/sysdeps/linux/common/bits/posix_opt.h | 6 +++--- libc/sysdeps/linux/common/syscalls.c | 14 +++++++------- libc/sysdeps/linux/m68k/Makefile | 2 +- libc/unistd/Makefile | 2 +- libc/unistd/daemon.c | 2 +- libc/unistd/exec.c | 4 ++-- 10 files changed, 32 insertions(+), 32 deletions(-) (limited to 'libc') diff --git a/libc/inet/rpc/rcmd.c b/libc/inet/rpc/rcmd.c index f1c732d41..cf839f4c6 100644 --- a/libc/inet/rpc/rcmd.c +++ b/libc/inet/rpc/rcmd.c @@ -94,7 +94,7 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p) #ifdef __UCLIBC_HAS_THREADS__ hstbuflen = 1024; -#ifdef __UCLIBC_HAS_MMU__ +#ifdef __ARCH_HAS_MMU__ tmphstbuf = alloca (hstbuflen); #else tmphstbuf = malloc (hstbuflen); @@ -106,7 +106,7 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p) if (herr != NETDB_INTERNAL || errno != ERANGE) { __set_h_errno (herr); -#ifndef __UCLIBC_HAS_MMU__ +#ifndef __ARCH_HAS_MMU__ free(tmphstbuf); #endif herror(*ahost); @@ -116,7 +116,7 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p) { /* Enlarge the buffer. */ hstbuflen *= 2; -#ifdef __UCLIBC_HAS_MMU__ +#ifdef __ARCH_HAS_MMU__ tmphstbuf = alloca (hstbuflen); #else if (tmphstbuf) { @@ -126,7 +126,7 @@ int rcmd(ahost, rport, locuser, remuser, cmd, fd2p) #endif } } -#ifndef __UCLIBC_HAS_MMU__ +#ifndef __ARCH_HAS_MMU__ free(tmphstbuf); #endif #else /* call the non-reentrant version */ @@ -308,7 +308,7 @@ int ruserok(rhost, superuser, ruser, luser) #ifdef __UCLIBC_HAS_THREADS__ buflen = 1024; -#ifdef __UCLIBC_HAS_MMU__ +#ifdef __ARCH_HAS_MMU__ buffer = alloca (buflen); #else buffer = malloc (buflen); @@ -318,7 +318,7 @@ int ruserok(rhost, superuser, ruser, luser) buflen, &hp, &herr) != 0 || hp == NULL) { if (herr != NETDB_INTERNAL || errno != ERANGE) { -#ifndef __UCLIBC_HAS_MMU__ +#ifndef __ARCH_HAS_MMU__ free(buffer); #endif return -1; @@ -326,7 +326,7 @@ int ruserok(rhost, superuser, ruser, luser) { /* Enlarge the buffer. */ buflen *= 2; -#ifdef __UCLIBC_HAS_MMU__ +#ifdef __ARCH_HAS_MMU__ buffer = alloca (buflen); #else if (buffer) { @@ -336,7 +336,7 @@ int ruserok(rhost, superuser, ruser, luser) #endif } } -#ifndef __UCLIBC_HAS_MMU__ +#ifndef __ARCH_HAS_MMU__ free(buffer); #endif #else @@ -435,7 +435,7 @@ iruserok2 (raddr, superuser, ruser, luser, rhost) #ifdef __UCLIBC_HAS_THREADS__ size_t buflen = sysconf (_SC_GETPW_R_SIZE_MAX); struct passwd pwdbuf; -#ifdef __UCLIBC_HAS_MMU__ +#ifdef __ARCH_HAS_MMU__ char *buffer = alloca (buflen); #else char *buffer = malloc (buflen); @@ -444,12 +444,12 @@ iruserok2 (raddr, superuser, ruser, luser, rhost) if (getpwnam_r (luser, &pwdbuf, buffer, buflen, &pwd) != 0 || pwd == NULL) { -#ifndef __UCLIBC_HAS_MMU__ +#ifndef __ARCH_HAS_MMU__ free(buffer); #endif return -1; } -#ifndef __UCLIBC_HAS_MMU__ +#ifndef __ARCH_HAS_MMU__ free(buffer); #endif #else diff --git a/libc/stdlib/malloc-simple/alloc.c b/libc/stdlib/malloc-simple/alloc.c index 4c6edd1f9..c0f702676 100644 --- a/libc/stdlib/malloc-simple/alloc.c +++ b/libc/stdlib/malloc-simple/alloc.c @@ -31,7 +31,7 @@ void *malloc(size_t size) #endif } -#ifdef __UCLIBC_HAS_MMU__ +#ifdef __ARCH_HAS_MMU__ result = mmap((void *) 0, size + sizeof(size_t), PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if (result == MAP_FAILED) @@ -88,7 +88,7 @@ void *realloc(void *ptr, size_t size) newptr = malloc(size); if (newptr) { memcpy(newptr, ptr, -#ifdef __UCLIBC_HAS_MMU__ +#ifdef __ARCH_HAS_MMU__ *((size_t *) (ptr - sizeof(size_t))) #else size @@ -111,7 +111,7 @@ void free(void *ptr) return; } } -#ifdef __UCLIBC_HAS_MMU__ +#ifdef __ARCH_HAS_MMU__ ptr -= sizeof(size_t); munmap(ptr, * (size_t *) ptr + sizeof(size_t)); #else @@ -154,7 +154,7 @@ int __libc_free_aligned(void *ptr) /* Mark the block as free */ l->aligned = NULL; ptr = l->exact; -#ifdef __UCLIBC_HAS_MMU__ +#ifdef __ARCH_HAS_MMU__ ptr -= sizeof(size_t); munmap(ptr, * (size_t *) ptr + sizeof(size_t)); #else diff --git a/libc/stdlib/malloc/malloc.h b/libc/stdlib/malloc/malloc.h index e5010d49b..37afe7299 100644 --- a/libc/stdlib/malloc/malloc.h +++ b/libc/stdlib/malloc/malloc.h @@ -43,7 +43,7 @@ heap, instead of mmap/munmap. This is a tradeoff -- sbrk is faster than mmap/munmap, and guarantees contiguous allocation, but is also less flexible, and causes the heap to only be shrinkable from the end. */ -#ifdef __UCLIBC_HAS_MMU__ +#ifdef __ARCH_HAS_MMU__ # define MALLOC_USE_SBRK #endif diff --git a/libc/sysdeps/linux/arm/crt0.S b/libc/sysdeps/linux/arm/crt0.S index cbf81504b..84bc8cd74 100644 --- a/libc/sysdeps/linux/arm/crt0.S +++ b/libc/sysdeps/linux/arm/crt0.S @@ -69,7 +69,7 @@ _start: /* clear the frame pointer */ mov fp, #0 -#ifdef __UCLIBC_HAS_MMU__ +#ifdef __ARCH_HAS_MMU__ /* Load register r0 (argc) from the stack to its final resting place */ ldr r0, [sp], #4 diff --git a/libc/sysdeps/linux/common/bits/posix_opt.h b/libc/sysdeps/linux/common/bits/posix_opt.h index 73fa007d2..9329dfc15 100644 --- a/libc/sysdeps/linux/common/bits/posix_opt.h +++ b/libc/sysdeps/linux/common/bits/posix_opt.h @@ -39,21 +39,21 @@ #define _POSIX_MAPPED_FILES 1 /* Locking of all memory is supported. */ -#ifdef __UCLIBC_HAS_MMU__ +#ifdef __ARCH_HAS_MMU__ # define _POSIX_MEMLOCK 1 #else # undef _POSIX_MEMLOCK #endif /* Locking of ranges of memory is supported. */ -#ifdef __UCLIBC_HAS_MMU__ +#ifdef __ARCH_HAS_MMU__ # define _POSIX_MEMLOCK_RANGE 1 #else # define _POSIX_MEMLOCK_RANGE #endif /* Setting of memory protections is supported. */ -#ifdef __UCLIBC_HAS_MMU__ +#ifdef __ARCH_HAS_MMU__ # define _POSIX_MEMORY_PROTECTION 1 #else # undef _POSIX_MEMORY_PROTECTION diff --git a/libc/sysdeps/linux/common/syscalls.c b/libc/sysdeps/linux/common/syscalls.c index 327b30c56..882de8106 100644 --- a/libc/sysdeps/linux/common/syscalls.c +++ b/libc/sysdeps/linux/common/syscalls.c @@ -43,7 +43,7 @@ //#define __NR_fork 2 #ifdef L___libc_fork #include -# ifdef __UCLIBC_HAS_MMU__ +# ifdef __ARCH_HAS_MMU__ #define __NR___libc_fork __NR_fork _syscall0(pid_t, __libc_fork); # else @@ -1131,7 +1131,7 @@ _syscall2(int, fstatfs, int, fd, struct statfs *, buf); //#define __NR_ioperm 101 #ifdef L_ioperm -# if defined __UCLIBC_HAS_MMU__ && defined __NR_ioperm +# if defined __ARCH_HAS_MMU__ && defined __NR_ioperm _syscall3(int, ioperm, unsigned long, from, unsigned long, num, int, turn_on); # else int ioperm(unsigned long from, unsigned long num, int turn_on) @@ -1256,7 +1256,7 @@ weak_alias(fstat, fstat64); /* For arm there is a totally different implementation */ #if !defined(__arm__) /* Tuns out the m68k unistd.h kernel header is broken */ -# if defined __UCLIBC_HAS_MMU__ && defined __NR_iopl && ( !defined(__mc68000__)) +# if defined __ARCH_HAS_MMU__ && defined __NR_iopl && ( !defined(__mc68000__)) _syscall1(int, iopl, int, level); # else int iopl(int level) @@ -1610,7 +1610,7 @@ int sysctl(int *name, int nlen, void *oldval, size_t *oldlenp, //#define __NR_mlock 150 #ifdef L_mlock #include -# if defined __UCLIBC_HAS_MMU__ && defined __NR_mlock +# if defined __ARCH_HAS_MMU__ && defined __NR_mlock _syscall2(int, mlock, const void *, addr, size_t, len); # endif #endif @@ -1618,7 +1618,7 @@ int sysctl(int *name, int nlen, void *oldval, size_t *oldlenp, //#define __NR_munlock 151 #ifdef L_munlock #include -# if defined __UCLIBC_HAS_MMU__ && defined __NR_munlock +# if defined __ARCH_HAS_MMU__ && defined __NR_munlock _syscall2(int, munlock, const void *, addr, size_t, len); # endif #endif @@ -1626,7 +1626,7 @@ int sysctl(int *name, int nlen, void *oldval, size_t *oldlenp, //#define __NR_mlockall 152 #ifdef L_mlockall #include -# if defined __UCLIBC_HAS_MMU__ && defined __NR_mlockall +# if defined __ARCH_HAS_MMU__ && defined __NR_mlockall _syscall1(int, mlockall, int, flags); # endif #endif @@ -1634,7 +1634,7 @@ int sysctl(int *name, int nlen, void *oldval, size_t *oldlenp, //#define __NR_munlockall 153 #ifdef L_munlockall #include -# if defined __UCLIBC_HAS_MMU__ && defined L_munlockall +# if defined __ARCH_HAS_MMU__ && defined L_munlockall _syscall0(int, munlockall); # endif #endif diff --git a/libc/sysdeps/linux/m68k/Makefile b/libc/sysdeps/linux/m68k/Makefile index f4d6d1527..b769954e0 100644 --- a/libc/sysdeps/linux/m68k/Makefile +++ b/libc/sysdeps/linux/m68k/Makefile @@ -23,7 +23,7 @@ ASFLAGS=$(CFLAGS) # If you're looking for vfork(), it is defined in include/unistd.h -ifeq ($(UCLIBC_HAS_MMU),y) +ifeq ($(ARCH_HAS_MMU),y) CRT0_SRC = crt0.c else CRT0_SRC = crt0.S diff --git a/libc/unistd/Makefile b/libc/unistd/Makefile index 53ffb6a9c..290d71a52 100644 --- a/libc/unistd/Makefile +++ b/libc/unistd/Makefile @@ -27,7 +27,7 @@ CSRC= sleep.c usleep.c getpass.c sysconf.c getlogin.c \ fpathconf.c confstr.c pathconf.c swab.c usershell.c \ getsubopt.c -ifeq ($(strip $(UCLIBC_HAS_MMU)),y) +ifeq ($(strip $(ARCH_HAS_MMU)),y) CSRC += daemon.c else MOBJ1 += __exec_alloc.o diff --git a/libc/unistd/daemon.c b/libc/unistd/daemon.c index d4c2e0448..91ae4056f 100644 --- a/libc/unistd/daemon.c +++ b/libc/unistd/daemon.c @@ -30,7 +30,7 @@ #include /* Note that this file should not be compiled in - * unless __UCLIBC_HAS_MMU__ is defined */ + * unless __ARCH_HAS_MMU__ is defined */ int daemon( int nochdir, int noclose ) { diff --git a/libc/unistd/exec.c b/libc/unistd/exec.c index fa1eda2b9..666a8192b 100644 --- a/libc/unistd/exec.c +++ b/libc/unistd/exec.c @@ -41,7 +41,7 @@ extern char *__strchrnul(const char *s, int c); /**********************************************************************/ -#ifdef __UCLIBC_HAS_MMU__ +#ifdef __ARCH_HAS_MMU__ /* We have an MMU, so use alloca() to grab space for buffers and * arg lists. */ @@ -69,7 +69,7 @@ extern void __exec_free(void *ptr, size_t size); /**********************************************************************/ #ifdef L___exec_alloc -#ifndef __UCLIBC_HAS_MMU__ +#ifndef __ARCH_HAS_MMU__ void *__exec_alloc(size_t size) { -- cgit v1.2.3