From owner-p4-projects@FreeBSD.ORG Thu Sep 14 22:55:17 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 792B016A415; Thu, 14 Sep 2006 22:55:17 +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 233C116A40F for ; Thu, 14 Sep 2006 22:55:17 +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 CDAA343D45 for ; Thu, 14 Sep 2006 22:55:16 +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 k8EMtGQd090296 for ; Thu, 14 Sep 2006 22:55:16 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8EMtGwO090293 for perforce@freebsd.org; Thu, 14 Sep 2006 22:55:16 GMT (envelope-from imp@freebsd.org) Date: Thu, 14 Sep 2006 22:55:16 GMT Message-Id: <200609142255.k8EMtGwO090293@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 106123 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: Thu, 14 Sep 2006 22:55:17 -0000 http://perforce.freebsd.org/chv.cgi?CH=106123 Change 106123 by imp@imp_lighthouse on 2006/09/14 22:54:47 separate out the hard-core str* and mem* from the text parsing good. The latter moves to strcvt.c. This saves aboue 250 bytes in boot2, boot0spi and bootsd. Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/Makefile#19 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/p_string.c#8 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/strcvt.c#1 add Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/Makefile#19 (text+ko) ==== @@ -6,7 +6,7 @@ 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 + sd-card.c mci_device.c strcvt.c NO_MAN= .if ${MK_TAG_LIST} != "no" ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/p_string.c#8 (text+ko) ==== @@ -27,41 +27,6 @@ /* * .KB_C_FN_DEFINITION_START - * int p_IsWhiteSpace(char) - * This global function returns true if the character is not considered - * a non-space character. - * .KB_C_FN_DEFINITION_END - */ -int -p_IsWhiteSpace(char cValue) -{ - return ((cValue == ' ') || - (cValue == '\t') || - (cValue == 0) || - (cValue == '\r') || - (cValue == '\n')); -} - - -/* - * .KB_C_FN_DEFINITION_START - * unsigned p_HexCharValue(char) - * This global function returns the decimal value of the validated hex char. - * .KB_C_FN_DEFINITION_END - */ -unsigned -p_HexCharValue(char cValue) -{ - if (cValue < ('9' + 1)) - return (cValue - '0'); - if (cValue < ('F' + 1)) - return (cValue - 'A' + 10); - return (cValue - 'a' + 10); -} - - -/* - * .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. @@ -109,54 +74,6 @@ return (to); } - -/* - * .KB_C_FN_DEFINITION_START - * unsigned p_ASCIIToHex(char *) - * This global function set the unsigned value equal to the converted - * hex number passed as a string. No error checking is performed; the - * string must be valid hex value, point at the start of string, and be - * NULL-terminated. - * .KB_C_FN_DEFINITION_END - */ -unsigned -p_ASCIIToHex(const char *buf) -{ - unsigned lValue = 0; - - if ((*buf == '0') && ((buf[1] == 'x') || (buf[1] == 'X'))) - buf += 2; - - while (*buf) { - lValue <<= 4; - lValue += p_HexCharValue(*buf++); - } - return (lValue); -} - - -/* - * .KB_C_FN_DEFINITION_START - * unsigned p_ASCIIToDec(char *) - * This global function set the unsigned value equal to the converted - * decimal number passed as a string. No error checking is performed; the - * string must be valid decimal value, point at the start of string, and be - * NULL-terminated. - * .KB_C_FN_DEFINITION_END - */ -unsigned -p_ASCIIToDec(const char *buf) -{ - unsigned v = 0; - - while (*buf) { - v *= 10; - v += (*buf++) - '0'; - } - return (v); -} - - /* * .KB_C_FN_DEFINITION_START * void p_memcpy(char *, char *, unsigned)