From owner-p4-projects@FreeBSD.ORG Fri Sep 15 17:34:48 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5BC0916A417; Fri, 15 Sep 2006 17:34:48 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 375AA16A40F for ; Fri, 15 Sep 2006 17:34:48 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 05FFB43D69 for ; Fri, 15 Sep 2006 17:34:40 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8FHYd3t021775 for ; Fri, 15 Sep 2006 17:34:39 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8FHYdlQ021772 for perforce@freebsd.org; Fri, 15 Sep 2006 17:34:39 GMT (envelope-from imp@freebsd.org) Date: Fri, 15 Sep 2006 17:34:39 GMT Message-Id: <200609151734.k8FHYdlQ021772@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 106158 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2006 17:34:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=106158 Change 106158 by imp@imp_lighthouse on 2006/09/15 17:33:51 Migrate more functions into their own file. This helps get another 48 bytes from boot2 Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#21 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/Makefile#22 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#30 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/lib.h#19 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/memcmp.c#1 add .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/memcpy.c#2 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/memset.c#1 add .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/p_string.c#13 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/strcmp.c#2 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/strcpy.c#1 add Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#21 (text+ko) ==== @@ -243,7 +243,7 @@ /* Present the user with the boot2 prompt. */ - p_strcpy(kname, PATH_KERNEL); + strcpy(kname, PATH_KERNEL); for (;;) { printf("\nDefault: %s\nboot: ", kname); if (!autoboot || (c = getc(2)) != -1) ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/Makefile#22 (text+ko) ==== @@ -5,8 +5,9 @@ LIB= at91 INTERNALLIB= SRCS=at91rm9200_lowlevel.c delay.c eeprom.c emac.c emac_init.c fpga.c getc.c \ - p_string.c putchar.c printf.c reset.c spi_flash.c xmodem.c \ - sd-card.c mci_device.c strcvt.c strlen.c + putchar.c printf.c reset.c spi_flash.c xmodem.c \ + sd-card.c mci_device.c strcvt.c strlen.c strcmp.c memcpy.c strcpy.c \ + memset.c memcmp.c SRCS+=ashldi3.c divsi3.S NO_MAN= ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#30 (text+ko) ==== @@ -176,8 +176,8 @@ cPtr = (char*)&(tftpHeader.block_num); - ePtr = p_strcpy(cPtr, filename); - mPtr = p_strcpy(ePtr, "octet"); + ePtr = strcpy(cPtr, filename); + mPtr = strcpy(ePtr, "octet"); length = mPtr - cPtr; length += 2; ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/lib.h#19 (text) ==== @@ -57,7 +57,7 @@ void p_memset(char *buffer, char value, int size); int p_strlen(const char *buffer); -char *p_strcpy(char *to, const char *from); +char *strcpy(char *to, const char *from); void memcpy(void *to, const void *from, unsigned size); int p_memcmp(const char *to, const char *from, unsigned size); int strcmp(const char *to, const char *from); ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/memcpy.c#2 (text+ko) ==== @@ -1,61 +1,6 @@ -/****************************************************************************** - * - * Filename: p_string.c - * - * Instantiation of basic string operations to prevent inclusion of full - * string library. These are simple implementations not necessarily optimized - * for speed, but rather to show intent. - * - * Revision information: - * - * 20AUG2004 kb_admin initial creation - * 12JAN2005 kb_admin minor updates - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - * - * $FreeBSD: src/sys/boot/arm/at91/libat91/p_string.c,v 1.2 2006/08/10 18:07:49 imp Exp $ - *****************************************************************************/ - #include "lib.h" -/* - * .KB_C_FN_DEFINITION_START - * void p_memset(char *buffer, char value, int size) - * This global function sets memory at the pointer for the specified - * number of bytes to value. - * .KB_C_FN_DEFINITION_END - */ void -p_memset(char *buffer, char value, int size) -{ - while (size--) - *buffer++ = value; -} - -/* - * .KB_C_FN_DEFINITION_START - * char *p_strcpy(char *to, char *from) - * This global function returns a pointer to the end of the destination string - * after the copy operation (after the '/0'). - * .KB_C_FN_DEFINITION_END - */ -char * -p_strcpy(char *to, const char *from) -{ - while (*from) - *to++ = *from++; - *to++ = '\0'; - return (to); -} - -void memcpy(void *dst, const void *src, unsigned len) { const char *s = src; @@ -64,35 +9,3 @@ while (len--) *d++ = *s++; } - -/* - * .KB_C_FN_DEFINITION_START - * int p_memcmp(char *to, char *from, unsigned size) - * This global function compares data at to against data at from for - * size bytes. Returns 0 if the locations are equal. size must be - * greater than 0. - * .KB_C_FN_DEFINITION_END - */ -int -p_memcmp(const char *to, const char *from, unsigned size) -{ - while ((--size) && (*to++ == *from++)) - continue; - - return (*to != *from); -} - - -/* - * .KB_C_FN_DEFINITION_START - * int strcmp(char *to, char *from) - * This global function compares string at to against string at from. - * Returns 0 if the locations are equal. - * .KB_C_FN_DEFINITION_END - */ -int -strcmp(const char *s1, const char *s2) -{ - for (; *s1 == *s2 && *s1; s1++, s2++); - return (unsigned char)*s1 - (unsigned char)*s2; -} ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/p_string.c#13 (text+ko) ==== @@ -41,32 +41,6 @@ /* * .KB_C_FN_DEFINITION_START - * char *p_strcpy(char *to, char *from) - * This global function returns a pointer to the end of the destination string - * after the copy operation (after the '/0'). - * .KB_C_FN_DEFINITION_END - */ -char * -p_strcpy(char *to, const char *from) -{ - while (*from) - *to++ = *from++; - *to++ = '\0'; - return (to); -} - -void -memcpy(void *dst, const void *src, unsigned len) -{ - const char *s = src; - char *d = dst; - - while (len--) - *d++ = *s++; -} - -/* - * .KB_C_FN_DEFINITION_START * int p_memcmp(char *to, char *from, unsigned size) * This global function compares data at to against data at from for * size bytes. Returns 0 if the locations are equal. size must be @@ -81,18 +55,3 @@ return (*to != *from); } - - -/* - * .KB_C_FN_DEFINITION_START - * int strcmp(char *to, char *from) - * This global function compares string at to against string at from. - * Returns 0 if the locations are equal. - * .KB_C_FN_DEFINITION_END - */ -int -strcmp(const char *s1, const char *s2) -{ - for (; *s1 == *s2 && *s1; s1++, s2++); - return (unsigned char)*s1 - (unsigned char)*s2; -} ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/strcmp.c#2 (text+ko) ==== @@ -1,95 +1,5 @@ -/****************************************************************************** - * - * Filename: p_string.c - * - * Instantiation of basic string operations to prevent inclusion of full - * string library. These are simple implementations not necessarily optimized - * for speed, but rather to show intent. - * - * Revision information: - * - * 20AUG2004 kb_admin initial creation - * 12JAN2005 kb_admin minor updates - * - * BEGIN_KBDD_BLOCK - * No warranty, expressed or implied, is included with this software. It is - * provided "AS IS" and no warranty of any kind including statutory or aspects - * relating to merchantability or fitness for any purpose is provided. All - * intellectual property rights of others is maintained with the respective - * owners. This software is not copyrighted and is intended for reference - * only. - * END_BLOCK - * - * $FreeBSD: src/sys/boot/arm/at91/libat91/p_string.c,v 1.2 2006/08/10 18:07:49 imp Exp $ - *****************************************************************************/ - #include "lib.h" -/* - * .KB_C_FN_DEFINITION_START - * void p_memset(char *buffer, char value, int size) - * This global function sets memory at the pointer for the specified - * number of bytes to value. - * .KB_C_FN_DEFINITION_END - */ -void -p_memset(char *buffer, char value, int size) -{ - while (size--) - *buffer++ = value; -} - -/* - * .KB_C_FN_DEFINITION_START - * char *p_strcpy(char *to, char *from) - * This global function returns a pointer to the end of the destination string - * after the copy operation (after the '/0'). - * .KB_C_FN_DEFINITION_END - */ -char * -p_strcpy(char *to, const char *from) -{ - while (*from) - *to++ = *from++; - *to++ = '\0'; - return (to); -} - -void -memcpy(void *dst, const void *src, unsigned len) -{ - const char *s = src; - char *d = dst; - - while (len--) - *d++ = *s++; -} - -/* - * .KB_C_FN_DEFINITION_START - * int p_memcmp(char *to, char *from, unsigned size) - * This global function compares data at to against data at from for - * size bytes. Returns 0 if the locations are equal. size must be - * greater than 0. - * .KB_C_FN_DEFINITION_END - */ -int -p_memcmp(const char *to, const char *from, unsigned size) -{ - while ((--size) && (*to++ == *from++)) - continue; - - return (*to != *from); -} - - -/* - * .KB_C_FN_DEFINITION_START - * int strcmp(char *to, char *from) - * This global function compares string at to against string at from. - * Returns 0 if the locations are equal. - * .KB_C_FN_DEFINITION_END - */ int strcmp(const char *s1, const char *s2) {