Index: branches/xZenu/src/include/secure/_stdio.h =================================================================== --- branches/xZenu/src/include/secure/_stdio.h (revision 1293) +++ branches/xZenu/src/include/secure/_stdio.h (revision 1294) @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2007 Apple Inc. All rights reserved. - * - * @APPLE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this - * file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_LICENSE_HEADER_END@ - */ - -#ifndef _STDIO_H_ - #error error "Never use directly; include instead." -#endif - -#ifndef _SECURE__STDIO_H_ -#define _SECURE__STDIO_H_ - -#include - -#if _USE_FORTIFY_LEVEL > 0 - -#undef sprintf -#undef vsprintf -#undef snprintf -#undef vsnprintf - -/* sprintf, vsprintf, snprintf, vsnprintf */ - -extern int __sprintf_chk (char * __restrict, int, size_t, - const char * __restrict, ...) - __DARWIN_LDBL_COMPAT (__sprintf_chk); - -#define sprintf(str, ...) \ - __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__) - -extern int __snprintf_chk (char * __restrict, size_t, int, size_t, - const char * __restrict, ...) - __DARWIN_LDBL_COMPAT (__snprintf_chk); - -#define snprintf(str, len, ...) \ - __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__) - -extern int __vsprintf_chk (char * __restrict, int, size_t, - const char * __restrict, va_list) - __DARWIN_LDBL_COMPAT (__vsprintf_chk); - -#define vsprintf(str, format, ap) \ - __builtin___vsprintf_chk (str, 0, __darwin_obsz(str), format, ap) - -extern int __vsnprintf_chk (char * __restrict, size_t, int, size_t, - const char * __restrict, va_list) - __DARWIN_LDBL_COMPAT (__vsnprintf_chk); - -#define vsnprintf(str, len, format, ap) \ - __builtin___vsnprintf_chk (str, len, 0, __darwin_obsz(str), format, ap) - - -#endif - -#endif Index: branches/xZenu/src/modules/klibc/Makefile =================================================================== --- branches/xZenu/src/modules/klibc/Makefile (revision 1293) +++ branches/xZenu/src/modules/klibc/Makefile (revision 1294) @@ -20,10 +20,10 @@ strtoul strtoull strtoumax strxspn strpbrk \ bsearch calloc \ jrand48 lrand48 mrand48 srand48 nrand48 seed48 \ - memccpy memcpy memset bzero memchr memmem memmove memrchr memswap memcmp \ + memccpy memcpy memset bzero bcopy memchr memmem memmove memrchr memswap memcmp \ strcmp strncmp strcpy strncpy strlcpy strstr strncat strcat strdup strncasecmp strchr strlen strtoul strtol \ qsort sha1hash onexit atexit exit \ - snprintf vsnprintf sscanf vsscanf\ + snprintf vsnprintf sscanf vsscanf sprintf \ fwrite fprintf vfprintf printf include ../MakeInc.dir Index: branches/xZenu/src/arch/i386/libsa/printf.c =================================================================== --- branches/xZenu/src/arch/i386/libsa/printf.c (revision 1293) +++ branches/xZenu/src/arch/i386/libsa/printf.c (revision 1294) @@ -1,74 +0,0 @@ -/* - * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. - * - * @APPLE_LICENSE_HEADER_START@ - * - * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights - * Reserved. This file contains Original Code and/or Modifications of - * Original Code as defined in and that are subject to the Apple Public - * Source License Version 2.0 (the "License"). You may not use this file - * except in compliance with the License. Please obtain a copy of the - * License at http://www.apple.com/publicsource and read it before using - * this file. - * - * The Original Code and all software distributed under the License are - * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the - * License for the specific language governing rights and limitations - * under the License. - * - * @APPLE_LICENSE_HEADER_END@ - */ -/* - * Copyright 1993 NeXT, Inc. - * All rights reserved. - */ - -#include "libsa.h" - -struct putc_info //Azi: exists on console.c & gui.c -{ - char * str; - char * last_str; -}; - -static int -sputc(int c, struct putc_info * pi) //Azi: same as above -{ - if (pi->last_str) - if (pi->str == pi->last_str) { - *(pi->str) = '\0'; - return 0; - } - *(pi->str)++ = c; - return c; -} - -/*VARARGS1*/ -/* now slprintf() return the length of the string as in man sprintf()*/ -int sprintf(char * str, const char * fmt, ...) -{ - va_list ap; - struct putc_info pi; - - va_start(ap, fmt); - pi.str = str; - pi.last_str = 0; - prf(fmt, ap, sputc, &pi); - *pi.str = '\0'; - va_end(ap); - return (pi.str - str); -} - -/*VARARGS1*/ -int slvprintf(char * str, int len, const char * fmt, va_list ap) -{ - struct putc_info pi; - pi.str = str; - pi.last_str = str + len - 1; - prf(fmt, ap, sputc, &pi); - *pi.str = '\0'; - return (pi.str - str); -} Index: branches/xZenu/src/arch/i386/libsa/string.c =================================================================== --- branches/xZenu/src/arch/i386/libsa/string.c (revision 1293) +++ branches/xZenu/src/arch/i386/libsa/string.c (revision 1294) @@ -1,42 +0,0 @@ -/* - * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. - * - * @APPLE_LICENSE_HEADER_START@ - * - * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights - * Reserved. This file contains Original Code and/or Modifications of - * Original Code as defined in and that are subject to the Apple Public - * Source License Version 2.0 (the "License"). You may not use this file - * except in compliance with the License. Please obtain a copy of the - * License at http://www.apple.com/publicsource and read it before using - * this file. - * - * The Original Code and all software distributed under the License are - * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the - * License for the specific language governing rights and limitations - * under the License. - * - * @APPLE_LICENSE_HEADER_END@ - */ -/* string operations */ - -#include "libsa.h" - -void bcopy(const void * src, void * dst, size_t len) -{ - asm volatile ( "cld \n\t" - "movl %%ecx, %%edx \n\t" - "shrl $2, %%ecx \n\t" - "rep; movsl \n\t" - "movl %%edx, %%ecx \n\t" - "andl $3, %%ecx \n\t" - "rep; movsb \n\t" - : - : "c" (len), "D" (dst), "S" (src) - : "memory", "%edx" ); -} - -/*#endif*/ Index: branches/xZenu/src/arch/i386/libsa/Makefile =================================================================== --- branches/xZenu/src/arch/i386/libsa/Makefile (revision 1293) +++ branches/xZenu/src/arch/i386/libsa/Makefile (revision 1294) @@ -21,8 +21,8 @@ INC = -I. -I$(SYMROOT) -I$(LIBSAIODIR) -I${SRCROOT}/include -OBJECTS = prf printf \ - string error \ +OBJECTS = prf \ + error \ setjmp efi_tables LIBS = libsa.a