You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(79) |
Aug
(27) |
Sep
(64) |
Oct
(202) |
Nov
(31) |
Dec
(59) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(125) |
Feb
(173) |
Mar
(13) |
Apr
(140) |
May
(75) |
Jun
(1) |
Jul
(37) |
Aug
(14) |
Sep
|
Oct
(20) |
Nov
(9) |
Dec
(2) |
2003 |
Jan
(51) |
Feb
(12) |
Mar
(18) |
Apr
(24) |
May
(1) |
Jun
|
Jul
|
Aug
(72) |
Sep
(12) |
Oct
(18) |
Nov
(60) |
Dec
(26) |
2004 |
Jan
(1) |
Feb
(40) |
Mar
(3) |
Apr
(3) |
May
|
Jun
(1) |
Jul
(4) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(5) |
2006 |
Jan
(13) |
Feb
(5) |
Mar
(8) |
Apr
(13) |
May
(7) |
Jun
(6) |
Jul
(10) |
Aug
(6) |
Sep
(6) |
Oct
(35) |
Nov
(20) |
Dec
(10) |
2007 |
Jan
(13) |
Feb
(9) |
Mar
(2) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(2) |
Aug
(3) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(1) |
2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
(4) |
May
(1) |
Jun
|
Jul
|
Aug
(2) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(54) |
Jun
(78) |
Jul
(35) |
Aug
(21) |
Sep
(21) |
Oct
(29) |
Nov
(10) |
Dec
(5) |
2010 |
Jan
|
Feb
|
Mar
(26) |
Apr
(55) |
May
(73) |
Jun
(63) |
Jul
(38) |
Aug
(39) |
Sep
(19) |
Oct
(2) |
Nov
(1) |
Dec
(1) |
2011 |
Jan
(2) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Stefan E. <se...@us...> - 2002-01-07 17:04:05
|
Update of /cvsroot/blob/blob/src/diag In directory usw-pr-cvs1:/tmp/cvs-serv17254 Modified Files: Makefile.am Log Message: - add regs-sa11x0.c Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/diag/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile.am 2002/01/03 16:07:18 1.6 +++ Makefile.am 2002/01/07 17:04:02 1.7 @@ -40,6 +40,7 @@ command_hist.c \ commands.c \ initcalls.c \ + regs-sa11x0.c \ main.c EXTRA_diag_elf32_SOURCES = \ |
From: Stefan E. <se...@us...> - 2002-01-07 17:02:13
|
Update of /cvsroot/blob/blob/src/diag In directory usw-pr-cvs1:/tmp/cvs-serv16816 Modified Files: regs-sa11x0.c Log Message: - forgot to print register descriptions as well Index: regs-sa11x0.c =================================================================== RCS file: /cvsroot/blob/blob/src/diag/regs-sa11x0.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- regs-sa11x0.c 2002/01/07 16:46:55 1.1 +++ regs-sa11x0.c 2002/01/07 17:02:10 1.2 @@ -245,6 +245,9 @@ SerialOutputString( registers[i].name ); SerialOutputString( "= 0x" ); SerialOutputHex( MEM( registers[i].adr ) ); + if ( registers[i].desc ) { + SerialOutputString( registers[i].desc ); + } serial_write( '\n' ); i++; } |
From: Stefan E. <se...@us...> - 2002-01-07 16:46:59
|
Update of /cvsroot/blob/blob/src/diag In directory usw-pr-cvs1:/tmp/cvs-serv11861 Added Files: regs-sa11x0.c Log Message: - command to show register contents - TODO: add an argument to select register sets to dump - TODO: add SA1111 companion chip register sets --- NEW FILE: regs-sa11x0.c --- /* * regs-sa11x0.c: command to nicely debug register contents * * Copyright (C) 2001 Stefan Eletzhofer <ste...@ww...> * * $Id: regs-sa11x0.c,v 1.1 2002/01/07 16:46:55 seletz Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: regs-sa11x0.c,v 1.1 2002/01/07 16:46:55 seletz Exp $" /********************************************************************** * includes */ #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/types.h> #include <blob/errno.h> #include <blob/util.h> #include <blob/command.h> #include <blob/init.h> #include <blob/serial.h> #include <blob/time.h> #include <blob/sa1100.h> #include <blob/sa1111.h> /********************************************************************** * defines */ #define MEM(adr) (*((u32*)adr)) #define SET(reg,bit) ((reg) |= (1<<(bit))) #define CLR(reg,bit) ((reg) &= ~(1<<(bit))) /********************************************************************** * types */ /* a type to hold register infos */ typedef struct _reg { char *name; /* reg name */ u32 adr; /* reg address */ char *desc; /* description */ } register_t; /* a set of registers */ typedef struct _reg_set { char *name; /* name of register set */ register_t *set; /* register set */ } reg_set_t; /********************************************************************** * module globals */ /* NOTE: the following register definitions are directly taken from * linux/include/asm-arm/arch-sa1100/SA-1100.h * and should therefore be correct.*/ /* Serial IF */ static register_t regs_uart[] = { { "Ser0UDCCR", (0x80000000), " Ser. port 0 UDC Control Reg. " }, { "Ser0UDCAR", (0x80000004), " Ser. port 0 UDC Address Reg. " }, { "Ser0UDCOMP", (0x80000008), " Ser. port 0 UDC Output Maximum Packet size reg. " }, { "Ser0UDCIMP", (0x8000000C), " Ser. port 0 UDC Input Maximum Packet size reg. " }, { "Ser0UDCCS0", (0x80000010), " Ser. port 0 UDC Control/Status reg. end-point 0 " }, { "Ser0UDCCS1", (0x80000014), " Ser. port 0 UDC Control/Status reg. end-point 1 (output) " }, { "Ser0UDCCS2", (0x80000018), " Ser. port 0 UDC Control/Status reg. end-point 2 (input) " }, { "Ser0UDCD0", (0x8000001C), " Ser. port 0 UDC Data reg. end-point 0 " }, { "Ser0UDCWC", (0x80000020), " Ser. port 0 UDC Write Count reg. end-point 0 " }, { "Ser0UDCDR", (0x80000028), " Ser. port 0 UDC Data Reg. " }, { "Ser0UDCSR", (0x80000030), " Ser. port 0 UDC Status Reg. " }, { "_UTCR01", (0x80010000 + ((1) - 1)*0x00020000), " UART Control Reg. 0 [1..3] " }, { "_UTCR02", (0x80010000 + ((2) - 1)*0x00020000), " UART Control Reg. 0 [1..3] " }, { "_UTCR03", (0x80010000 + ((3) - 1)*0x00020000), " UART Control Reg. 0 [1..3] " }, { "_UTCR11", (0x80010004 + ((1) - 1)*0x00020000), " UART Control Reg. 1 [1..3] " }, { "_UTCR22", (0x80010008 + ((2) - 1)*0x00020000), " UART Control Reg. 2 [1..3] " }, { "_UTCR33", (0x8001000C + ((3) - 1)*0x00020000), " UART Control Reg. 3 [1..3] " }, { "_UTCR42", (0x80010010 + ((2) - 1)*0x00020000), " UART Control Reg. 4 [2] " }, { "_UTDR1", (0x80010014 + ((1) - 1)*0x00020000), " UART Data Reg. [1..3] " }, { "_UTDR2", (0x80010014 + ((2) - 1)*0x00020000), " UART Data Reg. [1..3] " }, { "_UTDR3", (0x80010014 + ((3) - 1)*0x00020000), " UART Data Reg. [1..3] " }, { "_UTSR01", (0x8001001C + ((1) - 1)*0x00020000), " UART Status Reg. 0 [1..3] " }, { "_UTSR02", (0x8001001C + ((2) - 1)*0x00020000), " UART Status Reg. 0 [1..3] " }, { "_UTSR03", (0x8001001C + ((3) - 1)*0x00020000), " UART Status Reg. 0 [1..3] " }, { "_UTSR11", (0x80010020 + ((1) - 1)*0x00020000), " UART Status Reg. 1 [1..3] " }, { "_UTSR12", (0x80010020 + ((2) - 1)*0x00020000), " UART Status Reg. 1 [1..3] " }, { "_UTSR13", (0x80010020 + ((3) - 1)*0x00020000), " UART Status Reg. 1 [1..3] " }, { "Ser1SDCR0", (0x80020060), " Ser. port 1 SDLC Control Reg. 0 " }, { "Ser1SDCR1", (0x80020064), " Ser. port 1 SDLC Control Reg. 1 " }, { "Ser1SDCR2", (0x80020068), " Ser. port 1 SDLC Control Reg. 2 " }, { "Ser1SDCR3", (0x8002006C), " Ser. port 1 SDLC Control Reg. 3 " }, { "Ser1SDCR4", (0x80020070), " Ser. port 1 SDLC Control Reg. 4 " }, { "Ser1SDDR", (0x80020078), " Ser. port 1 SDLC Data Reg. " }, { "Ser1SDSR0", (0x80020080), " Ser. port 1 SDLC Status Reg. 0 " }, { "Ser1SDSR1", (0x80020084), " Ser. port 1 SDLC Status Reg. 1 " }, { "Ser2HSCR0", (0x80040060), " Ser. port 2 HSSP Control Reg. 0 " }, { "Ser2HSCR1", (0x80040064), " Ser. port 2 HSSP Control Reg. 1 " }, { "Ser2HSDR", (0x8004006C), " Ser. port 2 HSSP Data Reg. " }, { "Ser2HSSR0", (0x80040074), " Ser. port 2 HSSP Status Reg. 0 " }, { "Ser2HSSR1", (0x80040078), " Ser. port 2 HSSP Status Reg. 1 " }, { "Ser2HSCR2", (0x90060028), " Ser. port 2 HSSP Control Reg. 2 " }, { "Ser4MCCR0", (0x80060000), " Ser. port 4 MCP Control Reg. 0 " }, { "Ser4MCDR0", (0x80060008), " Ser. port 4 MCP Data Reg. 0 (audio) " }, { "Ser4MCDR1", (0x8006000C), " Ser. port 4 MCP Data Reg. 1 (telecom) " }, { "Ser4MCDR2", (0x80060010), " Ser. port 4 MCP Data Reg. 2 (CODEC reg.) " }, { "Ser4MCSR", (0x80060018), " Ser. port 4 MCP Status Reg. " }, { "Ser4MCCR1", (0x90060030), " Ser. port 4 MCP Control Reg. 1 " }, { "Ser4SSCR0", (0x80070060), " Ser. port 4 SSP Control Reg. 0 " }, { "Ser4SSCR1", (0x80070064), " Ser. port 4 SSP Control Reg. 1 " }, { "Ser4SSDR", (0x8007006C), " Ser. port 4 SSP Data Reg. " }, { "Ser4SSSR", (0x80070074), " Ser. port 4 SSP Status Reg. " }, { NULL, 0 } }; /* Timer */ static register_t regs_timer[] = { { "OSMR0", (0x90000000), " OS timer Match Reg. 0 " }, { "OSMR1", (0x90000004), " OS timer Match Reg. 1 " }, { "OSMR2", (0x90000008), " OS timer Match Reg. 2 " }, { "OSMR3", (0x9000000c), " OS timer Match Reg. 3 " }, { "OSCR", (0x90000010), " OS timer Counter Reg. " }, { "OSSR", (0x90000014), " OS timer Status Reg. " }, { "OWER", (0x90000018), " OS timer Watch-dog Enable Reg. " }, { "OIER", (0x9000001C), " OS timer Interrupt Enable Reg. " }, { NULL, 0 } }; /* RTC and Power Mgmt */ static register_t regs_rtc[] = { { "RTAR", (0x90010000), " RTC Alarm Reg. " }, { "RCNR", (0x90010004), " RTC CouNt Reg. " }, { "RTTR", (0x90010008), " RTC Trim Reg. " }, { "RTSR", (0x90010010), " RTC Status Reg. " }, { "PMCR", (0x90020000), " PM Control Reg. " }, { "PSSR", (0x90020004), " PM Sleep Status Reg. " }, { "PSPR", (0x90020008), " PM Scratch-Pad Reg. " }, { "PWER", (0x9002000C), " PM Wake-up Enable Reg. " }, { "PCFR", (0x90020010), " PM general ConFiguration Reg. " }, { "PPCR", (0x90020014), " PM PLL Configuration Reg. " }, { "PGSR", (0x90020018), " PM GPIO Sleep state Reg. " }, { "POSR", (0x9002001C), " PM Oscillator Status Reg. " }, { "RSRR", (0x90030000), " RC Software Reset Reg. " }, { "RCSR", (0x90030004), " RC Status Reg. " }, { "TUCR", (0x90030008), " Test Unit Control Reg. " }, { NULL, 0 } }; /* GPIO / IRQ */ static register_t regs_gpio[] = { { "GPLR", (0x90040000), " GPIO Pin Level Reg. " }, { "GPDR", (0x90040004), " GPIO Pin Direction Reg. " }, { "GPSR", (0x90040008), " GPIO Pin output Set Reg. " }, { "GPCR", (0x9004000C), " GPIO Pin output Clear Reg. " }, { "GRER", (0x90040010), " GPIO Rising-Edge detect Reg. " }, { "GFER", (0x90040014), " GPIO Falling-Edge detect Reg. " }, { "GEDR", (0x90040018), " GPIO Edge Detect status Reg. " }, { "GAFR", (0x9004001C), " GPIO Alternate Function Reg. " }, { "ICIP", (0x90050000), " IC IRQ Pending reg. " }, { "ICMR", (0x90050004), " IC Mask Reg. " }, { "ICLR", (0x90050008), " IC Level Reg. " }, { "ICCR", (0x9005000C), " IC Control Reg. " }, { "ICFP", (0x90050010), " IC FIQ Pending reg. " }, { "ICPR", (0x90050020), " IC Pending Reg. " }, { "PPDR", (0x90060000), " PPC Pin Direction Reg. " }, { "PPSR", (0x90060004), " PPC Pin State Reg. " }, { "PPAR", (0x90060008), " PPC Pin Assignment Reg. " }, { "PSDR", (0x9006000C), " PPC Sleep-mode pin Direction Reg. " }, { "PPFR", (0x90060010), " PPC Pin Flag Reg. " }, { NULL, 0 } }; /* MEMORY */ static register_t regs_memory[] = { { "MDCNFG", (0xA0000000), " DRAM CoNFiGuration reg. " }, { "MDCAS0", (0xA0000004), " DRAM CAS shift reg. 0 " }, { "MDCAS1", (0xA0000008), " DRAM CAS shift reg. 1 " }, { "MDCAS2", (0xA000000c), " DRAM CAS shift reg. 2 " }, { "MSC0", (0xa0000010), " Static memory Control reg. 0 " }, { "MSC1", (0xa0000014), " Static memory Control reg. 1 " }, { "MSC2", (0xa000002c), " Static memory Control reg. 2, not contiguous " }, { "MECR", (0xA0000018), " Expansion memory bus (PCMCIA) Configuration Reg. " }, { "MDREFR", (0xA000001C), " (SA1110 only) DRAM Refresh Control Register" }, { NULL, 0 } }; /* LCD */ static register_t regs_lcd[] = { { "LCCR0", (0xB0100000), " LCD Control Reg. 0 " }, { "LCSR", (0xB0100004), " LCD Status Reg. " }, { "DBAR1", (0xB0100010), " LCD DMA Base Address Reg. channel 1 " }, { "DCAR1", (0xB0100014), " LCD DMA Current Address Reg. channel 1 " }, { "DBAR2", (0xB0100018), " LCD DMA Base Address Reg. channel 2 " }, { "DCAR2", (0xB010001C), " LCD DMA Current Address Reg. channel 2 " }, { "LCCR1", (0xB0100020), " LCD Control Reg. 1 " }, { "LCCR2", (0xB0100024), " LCD Control Reg. 2 " }, { "LCCR3", (0xB0100028), " LCD Control Reg. 3 " }, { NULL, 0 } }; /* TODO: add SA1111 companion chip registers */ /* finally the available register sets */ static reg_set_t reg_sets[] = { { "uart", regs_uart }, { "timer", regs_timer }, { "rtc", regs_rtc }, { "gpio", regs_gpio }, { "memory", regs_memory }, { "lcd", regs_lcd }, { NULL, NULL } }; /**********************************************************************/ /**********************************************************************/ /**********************************************************************/ static int regs_show( int argc, char *argv[] ) { int i = 0; int set = 0; register_t *registers = NULL; /* TODO: allow user to select a specific register set to * print instead of simply print all sets. */ set = 0; while ( reg_sets[set].name ) { i = 0; registers = reg_sets[set].set; SerialOutputString( reg_sets[set].name ); serial_write( '\n' ); SerialOutputString( "--------------------------------\n" ); while ( registers && registers[i].name ) { SerialOutputString( registers[i].name ); SerialOutputString( "= 0x" ); SerialOutputHex( MEM( registers[i].adr ) ); serial_write( '\n' ); i++; } set++; serial_write( '\n' ); } return 0; } static char regshelp[] = "print register info\n"; __commandlist(regs_show, "regs", regshelp); |
From: Stefan E. <se...@us...> - 2002-01-07 16:31:29
|
Update of /cvsroot/blob/blob/include/blob/arch In directory usw-pr-cvs1:/tmp/cvs-serv8722 Modified Files: system3.h Log Message: - set PCMCIA memory space timing to slowest possible - define SA1111_VBASE == SA1111_BASE to make SA-1111.h happy Index: system3.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/arch/system3.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- system3.h 2002/01/03 16:07:17 1.8 +++ system3.h 2002/01/07 16:31:25 1.9 @@ -79,13 +79,13 @@ #define MSC0_VALUE_66_100 MSC_RT_ROMFLASH | MSC_RBW32 | MSC_RDF( 7) | MSC_RDN(2) | MSC_RRR(1) #define MSC1_VALUE_66 MSC_RT_ROMFLASH | MSC_RBW16 | MSC_RDF(5) | MSC_RDN(1) | MSC_RRR(1) | ((MSC_RT_VARLAT_345 | MSC_RBW16 | MSC_RDF(30) | MSC_RDN(30) | MSC_RRR(7))<<16) #define MSC2_VALUE_66 MSC_RT_VARLAT_345 | MSC_RBW32 | MSC_RDF(7) | MSC_RDN(2) | MSC_RRR(1) -#define MECR_VALUE_66 0 +#define MECR_VALUE_66 0xFFFFFFFF #define MSC0_VALUE_100_150 MSC_RT_ROMFLASH | MSC_RBW32 | MSC_RDF(16) | MSC_RDN(3) | MSC_RRR(2) #define MSC0_VALUE_100_120 MSC_RT_ROMFLASH | MSC_RBW32 | MSC_RDF(13) | MSC_RDN(3) | MSC_RRR(2) #define MSC0_VALUE_100_100 MSC_RT_ROMFLASH | MSC_RBW32 | MSC_RDF(11) | MSC_RDN(3) | MSC_RRR(2) #define MSC1_VALUE_100 MSC_RT_ROMFLASH | MSC_RBW16 | MSC_RDF(5) | MSC_RDN(1) | MSC_RRR(1)| ((MSC_RT_VARLAT_345 | MSC_RBW16 | MSC_RDF(30) | MSC_RDN(30) | MSC_RRR(7))<<16) #define MSC2_VALUE_100 MSC_RT_VARLAT_345 | MSC_RBW32 | MSC_RDF(9) | MSC_RDN(2) | MSC_RRR(1) -#define MECR_VALUE_100 0 +#define MECR_VALUE_100 0xFFFFFFFF #ifndef CPU_SPEED_133 // 206 Mhz @@ -129,6 +129,7 @@ # define _DBGU32( x ) #endif -# define SA1111_BASE (0x40000000) +#define SA1111_BASE (0x40000000) +#define SA1111_VBASE (0x40000000) #endif |
From: Erik M. <er...@us...> - 2002-01-07 15:00:19
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv15829/src/blob Modified Files: Makefile.am rest-ld-script.in Log Message: The preprocessor can be told not to predefine anything at all, so we can safely use the keyword "arm". Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/blob/Makefile.am,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- Makefile.am 2002/01/05 20:21:49 1.14 +++ Makefile.am 2002/01/07 15:00:14 1.15 @@ -45,7 +45,7 @@ rest-ld-script: rest-ld-script.in - $(CC) -x c-header ${INCLUDES} -E $< | sed 's/^#.*//' > $@ + $(CC) -x c-header -undef -nostdinc ${INCLUDES} -E $< | sed 's/^#.*//' > $@ Index: rest-ld-script.in =================================================================== RCS file: /cvsroot/blob/blob/src/blob/rest-ld-script.in,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- rest-ld-script.in 2001/11/04 23:09:17 1.1 +++ rest-ld-script.in 2002/01/07 15:00:15 1.2 @@ -25,7 +25,7 @@ #include <blob/arch.h> OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") -/*OUTPUT_ARCH(arm)*/ +OUTPUT_ARCH(arm) ENTRY(_trampoline) SECTIONS { @@ -102,4 +102,3 @@ __bss_end = .; } } - |
From: Erik M. <er...@us...> - 2002-01-07 14:58:21
|
Update of /cvsroot/blob/blob In directory usw-pr-cvs1:/tmp/cvs-serv15413 Modified Files: configure.in acconfig.h Log Message: Export CPU type in the config file Index: configure.in =================================================================== RCS file: /cvsroot/blob/blob/configure.in,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- configure.in 2002/01/06 18:59:40 1.33 +++ configure.in 2002/01/07 14:58:16 1.34 @@ -238,10 +238,12 @@ MEMSETUP="memsetup-sa1110.o" else AC_MSG_WARN([No CPU defined!]); + use_cpu="(none)" MEMSETUP="" fi AC_SUBST(MEMSETUP) +AC_DEFINE_UNQUOTED(CPU, "${use_cpu}") Index: acconfig.h =================================================================== RCS file: /cvsroot/blob/blob/acconfig.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- acconfig.h 2002/01/06 18:59:40 1.11 +++ acconfig.h 2002/01/07 14:58:16 1.12 @@ -101,6 +101,9 @@ /* Define if MD5 support is wanted */ #undef CONFIG_MD5_SUPPORT +/* Define the CPU type */ +#undef CPU + @BOTTOM@ #endif |
From: Stefan E. <se...@us...> - 2002-01-07 14:48:28
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv12705 Modified Files: main.c Log Message: - set system3 default serial speed to 38400 baud Index: main.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/main.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- main.c 2002/01/06 18:59:40 1.22 +++ main.c 2002/01/07 14:48:25 1.23 @@ -101,6 +101,9 @@ #if defined(H3600) || defined(SHANNON) || defined(IDR) || defined(BADGE4) || defined(JORNADA720) blob_status.terminalSpeed = baud_115200; /* DEBUG */ #endif +#if defined(PT_SYSTEM3) + blob_status.terminalSpeed = baud_38400; +#endif serial_init(blob_status.terminalSpeed); /* parse the core tag, for critical things like terminal speed */ |
From: Erik M. <er...@us...> - 2002-01-07 13:30:50
|
Update of /cvsroot/blob/blob/utils/build In directory usw-pr-cvs1:/tmp/cvs-serv25825/utils/build Modified Files: build_Makefile build_all Log Message: Fix typo and put systems in alphabetical order. Index: build_Makefile =================================================================== RCS file: /cvsroot/blob/blob/utils/build/build_Makefile,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- build_Makefile 2001/12/27 18:28:27 1.7 +++ build_Makefile 2002/01/07 13:30:48 1.8 @@ -14,8 +14,8 @@ archs = \ assabet badge4 brutus creditlart h3600 idr\ - jornada720 lart neponset nesa pleb system3\ - shannon + jornada720 lart neponset nesa pleb shannon\ + system3 debug-archs = $(foreach a, $(archs), $(a)-debug) all-archs = $(archs) $(debug-archs) Index: build_all =================================================================== RCS file: /cvsroot/blob/blob/utils/build/build_all,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- build_all 2001/12/27 18:28:27 1.7 +++ build_all 2002/01/07 13:30:48 1.8 @@ -12,7 +12,7 @@ # published by the Free Software Foundation. # -archs="assabet badge4 brutus creditlart h3600 idr jornada720 lart neponset nesa pleb system3 shannon" +archs="assabet badge4 brutus creditlart h3600 idr jornada720 lart neponset nesa pleb shannon system3" linux_prefix=~/LART/build/linux/elinux blob_src=~/src/sourceforge/blob extra_flags="--enable-all-features" @@ -24,9 +24,9 @@ rm -rf "$i"* mkdir "$i" "$i"-debug cd $i - $blob_src/configure --enable-maintainer-mode --with-board=$i -with-linux-prefix=$linux_prefix $extra_flags arm-unknown-linux-gnu + $blob_src/configure --enable-maintainer-mode --with-board=$i --with-linux-prefix=$linux_prefix $extra_flags arm-unknown-linux-gnu cd ../"$i"-debug - $blob_src/configure --enable-maintainer-mode --with-board=$i -with-linux-prefix=$linux_prefix $extra_flags --enable-blob-debug arm-unknown-linux-gnu + $blob_src/configure --enable-maintainer-mode --with-board=$i --with-linux-prefix=$linux_prefix $extra_flags --enable-blob-debug arm-unknown-linux-gnu cd .. done |
From: Erik M. <J.A...@it...> - 2002-01-06 23:26:43
|
On Sun, Jan 06, 2002 at 03:00:48PM -0700, Russ Dill wrote: > might want to run md5.[ch] through lindent I thought a bit more about it. There was a long discussion about coding style a few weeks ago on the linux-kernel mailing list (it started out of one of the usual devfs flamewars). The bottom line was that the linux coding style should be used for all code, except for code that's used in other projects as well. I myself use the linux coding style for everything I write, and as far as I can see you do the same (at least in blob). What would you think about making the linux coding style mandatory for blob, unless the code has been copied from another project (like the MD5 stuff). The rationale is of course the maintainability. Comments/ideas/flames? Erik -- J.A.K. (Erik) Mouw, Information and Communication Theory Group, Faculty of Information Technology and Systems, Delft University of Technology, PO BOX 5031, 2600 GA Delft, The Netherlands Phone: +31-15-2783635 Fax: +31-15-2781843 Email: J.A...@it... WWW: http://www-ict.its.tudelft.nl/~erik/ |
From: Erik M. <J.A...@it...> - 2002-01-06 22:31:55
|
On Sun, Jan 06, 2002 at 03:00:48PM -0700, Russ Dill wrote: > might want to run md5.[ch] through lindent No, it's a lot easier this way to diff it with the FSF orginal. That might turn out useful when the FSF version changes. Erik -- J.A.K. (Erik) Mouw, Information and Communication Theory Group, Faculty of Information Technology and Systems, Delft University of Technology, PO BOX 5031, 2600 GA Delft, The Netherlands Phone: +31-15-2783635 Fax: +31-15-2781843 Email: J.A...@it... WWW: http://www-ict.its.tudelft.nl/~erik/ |
From: Russ D. <Rus...@as...> - 2002-01-06 21:59:43
|
might want to run md5.[ch] through lindent |
From: Erik M. <er...@us...> - 2002-01-06 19:03:38
|
Update of /cvsroot/blob/blob In directory usw-pr-cvs1:/tmp/cvs-serv27949 Modified Files: ChangeLog Log Message: Update ChangeLog Index: ChangeLog =================================================================== RCS file: /cvsroot/blob/blob/ChangeLog,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- ChangeLog 2001/12/27 18:27:37 1.13 +++ ChangeLog 2002/01/06 19:03:36 1.14 @@ -4,6 +4,11 @@ $Id$ blob-2.0.5-pre2: +- MD5 support Christopher Hoover +- New call command Christopher Hoover +- Xmodem support Christopher Hoover +- Serial port driver modularisation Erik Mouw +- Flash code updates Christopher Hoover - HP Labs Badge4 support Christopher Hoover - HP Jornada 720 support Christopher Hoover - Vercel UD-1 (IDR) support Tim Riker |
From: Erik M. <er...@us...> - 2002-01-06 19:02:31
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv27415/src/blob Modified Files: xmodem.c Log Message: Change blockBuf[] into a static variable because we can't have 1024 bytes on the stack. Index: xmodem.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/xmodem.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- xmodem.c 2002/01/05 20:21:49 1.1 +++ xmodem.c 2002/01/06 19:02:29 1.2 @@ -63,6 +63,10 @@ #define ERROR(...) do { } while (0) + +static char blockBuf[1024]; + + static inline void WriteByte(char cc) { serial_write_raw(cc); } @@ -85,7 +89,6 @@ int XModemReceive(char *bufBase, int bufLen) { - char blockBuf[1024]; unsigned int errors = 0; unsigned int wantBlockNo = 1; unsigned int length = 0; |
From: Erik M. <er...@us...> - 2002-01-06 18:59:44
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv26911/src/blob Modified Files: main.c Log Message: MD5 support by Chris Hoover Index: main.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/main.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- main.c 2002/01/05 20:21:49 1.21 +++ main.c 2002/01/06 18:59:40 1.22 @@ -46,6 +46,8 @@ #include <blob/init.h> #include <blob/led.h> #include <blob/main.h> +#include <blob/md5.h> +#include <blob/md5support.h> #include <blob/memory.h> #include <blob/param_block.h> #include <blob/sa1100.h> @@ -184,13 +186,15 @@ static int set_download_parameters(char *name, u32 *startAddress, - int *bufLen, int **numRead) + int *bufLen, int **numRead, + u32 **digest) { if(strncmp(name, "blob", 5) == 0) { /* download blob */ *startAddress = BLOB_RAM_BASE; *bufLen = BLOB_FLASH_LEN; *numRead = &blob_status.blobSize; + *digest = blob_status.blob_md5_digest; blob_status.blobType = fromDownload; #ifdef PARAM_START } else if(strncmp(name, "param", 6) == 0) { @@ -198,6 +202,7 @@ *startAddress = PARAM_RAM_BASE; *bufLen = PARAM_FLASH_LEN; *numRead = &blob_status.paramSize; + *digest = blob_status.param_md5_digest; blob_status.paramType = fromDownload; #endif } else if(strncmp(name, "kernel", 7) == 0) { @@ -205,12 +210,14 @@ *startAddress = KERNEL_RAM_BASE; *bufLen = KERNEL_FLASH_LEN; *numRead = &blob_status.kernelSize; + *digest = blob_status.kernel_md5_digest; blob_status.kernelType = fromDownload; } else if(strncmp(name, "ramdisk", 8) == 0) { /* download ramdisk */ *startAddress = RAMDISK_RAM_BASE; *bufLen = RAMDISK_FLASH_LEN; *numRead = &blob_status.ramdiskSize; + *digest = blob_status.ramdisk_md5_digest; blob_status.ramdiskType = fromDownload; } else { printerror(-EINVAL, name); @@ -223,18 +230,29 @@ +static void do_md5sum(u32 *addr, size_t len, u32 *digest) +{ +#ifdef CONFIG_MD5_SUPPORT + md5_buffer((const char *)addr, len, digest); +#endif +} + + + + static int Download(int argc, char *argv[]) { - u32 startAddress = 0; + u32 startAddress; int bufLen; - int *numRead = 0; + int *numRead; int retval; + u32 *digest; if(argc < 2) return -ENOPARAMS; retval = set_download_parameters(argv[1], &startAddress, - &bufLen, &numRead); + &bufLen, &numRead, &digest); if (blob_status.terminalSpeed != blob_status.downloadSpeed) { SerialOutputString("Switching to "); @@ -269,6 +287,9 @@ serial_init(blob_status.terminalSpeed); return retval; } + + do_md5sum((u32 *)startAddress, *numRead, digest); + SerialOutputString("Received "); SerialOutputDec(*numRead); SerialOutputString(" (0x"); @@ -277,8 +298,12 @@ #ifdef BLOB_DEBUG SerialOutputString(" at 0x"); SerialOutputHex((u32) startAddress); +#ifdef CONFIG_MD5_SUPPORT + SerialOutputString(", MD5: "); + print_md5_digest(digest); #endif - SerialOutputString(".\n"); +#endif + serial_write('\n'); serial_init(blob_status.terminalSpeed); @@ -296,16 +321,17 @@ static int xdownload(int argc, char *argv[]) { - u32 startAddress = 0; + u32 startAddress; int bufLen; - int *numRead = 0; + int *numRead; int retval; + u32 *digest; if(argc < 2) return -ENOPARAMS; retval = set_download_parameters(argv[1], &startAddress, - &bufLen, &numRead); + &bufLen, &numRead, &digest); if (blob_status.terminalSpeed != blob_status.downloadSpeed) { SerialOutputString("Switching to "); @@ -343,6 +369,9 @@ serial_init(blob_status.terminalSpeed); return retval; } + + do_md5sum((u32 *)startAddress, *numRead, digest); + SerialOutputString("Received "); SerialOutputDec(*numRead); SerialOutputString(" (0x"); @@ -351,8 +380,12 @@ #ifdef BLOB_DEBUG SerialOutputString(" at 0x"); SerialOutputHex((u32) startAddress); +#ifdef CONFIG_MD5_SUPPORT + SerialOutputString(", MD5: "); + print_md5_digest(digest); #endif - SerialOutputString(".\n"); +#endif + serial_write('\n'); serial_init(blob_status.terminalSpeed); @@ -513,68 +546,88 @@ { SerialOutputString(version_str); - SerialOutputString("Download speed : "); + SerialOutputString("Download speed : "); PrintSerialSpeed(blob_status.downloadSpeed); SerialOutputString(" baud\n"); - SerialOutputString("Terminal speed : "); + SerialOutputString("Terminal speed : "); PrintSerialSpeed(blob_status.terminalSpeed); SerialOutputString(" baud\n"); - SerialOutputString("blob "); + SerialOutputString("blob (0x"); SerialOutputHex(BLOB_FLASH_BASE); - SerialOutputString(": "); + SerialOutputString("): "); if(blob_status.blobType == fromFlash) { SerialOutputString("from flash\n"); } else { - SerialOutputString("downloaded at "); + SerialOutputString("downloaded at 0x"); SerialOutputHex(BLOB_RAM_BASE); SerialOutputString(", "); SerialOutputDec(blob_status.blobSize); SerialOutputString(" bytes\n"); +#ifdef CONFIG_MD5_SUPPORT + SerialOutputString(" MD5: "); + print_md5_digest(blob_status.blob_md5_digest); + serial_write('\n'); +#endif } #ifdef PARAM_START - SerialOutputString("param "); + SerialOutputString("param (0x"); SerialOutputHex(PARAM_FLASH_BASE); - SerialOutputString(": "); + SerialOutputString("): "); if(blob_status.paramType == fromFlash) { SerialOutputString("from flash\n"); } else { - SerialOutputString("downloaded at "); + SerialOutputString("downloaded at 0x"); SerialOutputHex(PARAM_RAM_BASE); SerialOutputString(", "); SerialOutputDec(blob_status.paramSize); SerialOutputString(" bytes\n"); +#ifdef CONFIG_MD5_SUPPORT + SerialOutputString(" MD5: "); + print_md5_digest(blob_status.param_md5_digest); + serial_write('\n'); +#endif } #else - SerialOutputString("param : Not available\n"); + SerialOutputString("param : Not available\n"); #endif - SerialOutputString("kernel "); + SerialOutputString("kernel (0x"); SerialOutputHex(KERNEL_FLASH_BASE); - SerialOutputString(": "); + SerialOutputString("): "); if(blob_status.kernelType == fromFlash) { SerialOutputString("from flash\n"); } else { - SerialOutputString("downloaded at "); + SerialOutputString("downloaded at 0x"); SerialOutputHex(KERNEL_RAM_BASE); SerialOutputString(", "); SerialOutputDec(blob_status.kernelSize); SerialOutputString(" bytes\n"); +#ifdef CONFIG_MD5_SUPPORT + SerialOutputString(" MD5: "); + print_md5_digest(blob_status.kernel_md5_digest); + serial_write('\n'); +#endif } - SerialOutputString("ramdisk "); + SerialOutputString("ramdisk (0x"); SerialOutputHex(RAMDISK_FLASH_BASE); - SerialOutputString(": "); + SerialOutputString("): "); if(blob_status.ramdiskType == fromFlash) { SerialOutputString("from flash\n"); } else { - SerialOutputString("downloaded at "); + SerialOutputString("downloaded at 0x"); SerialOutputHex(RAMDISK_RAM_BASE); SerialOutputString(", "); SerialOutputDec(blob_status.ramdiskSize); SerialOutputString(" bytes\n"); +#ifdef CONFIG_MD5_SUPPORT + SerialOutputString(" MD5: "); + print_md5_digest(blob_status.ramdisk_md5_digest); + serial_write('\n'); +#endif } return 0; |
From: Erik M. <er...@us...> - 2002-01-06 18:59:43
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv26911/include/blob Modified Files: Makefile.am main.h Added Files: md5.h md5support.h Log Message: MD5 support by Chris Hoover --- NEW FILE: md5.h --- /* Taken from textutils-2.0 -ch */ /* $Id: md5.h,v 1.1 2002/01/06 18:59:40 erikm Exp $ */ /* md5.h - Declaration of functions and data types used for MD5 sum computing library functions. Copyright (C) 1995, 1996 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug...@pr.... This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef BLOB_MD5_H #define BLOB_MD5_H #include <blob/types.h> typedef u32 md5_uint32; #undef __P #if defined (__STDC__) && __STDC__ #define __P(x) x #else #define __P(x) () #endif /* Structure to save state of computation between the single steps. */ struct md5_ctx { md5_uint32 A; md5_uint32 B; md5_uint32 C; md5_uint32 D; md5_uint32 total[2]; md5_uint32 buflen; char buffer[128]; }; /* * The following three functions are build up the low level used in * the functions `md5_stream' and `md5_buffer'. */ /* Initialize structure containing state of computation. (RFC 1321, 3.3: Step 3) */ extern void md5_init_ctx __P ((struct md5_ctx *ctx)); /* Starting with the result of former calls of this function (or the initialization function update the context for the next LEN bytes starting at BUFFER. It is necessary that LEN is a multiple of 64!!! */ extern void md5_process_block __P ((const void *buffer, size_t len, struct md5_ctx *ctx)); /* Starting with the result of former calls of this function (or the initialization function update the context for the next LEN bytes starting at BUFFER. It is NOT required that LEN is a multiple of 64. */ extern void md5_process_bytes __P ((const void *buffer, size_t len, struct md5_ctx *ctx)); /* Process the remaining bytes in the buffer and put result from CTX in first 16 bytes following RESBUF. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ extern void *md5_finish_ctx __P ((struct md5_ctx *ctx, void *resbuf)); /* Put result from CTX in first 16 bytes following RESBUF. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ extern void *md5_read_ctx __P ((const struct md5_ctx *ctx, void *resbuf)); /* Compute MD5 message digest for LEN bytes beginning at BUFFER. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. */ extern void *md5_buffer __P ((const char *buffer, size_t len, void *resblock)); #endif --- NEW FILE: md5support.h --- /* * md5support.h: MD5 support function * * Copyright (C) 2001 Hewlett-Packard Company * Written by Christopher Hoover <ch...@hp...> * Minor modifications by Erik Mouw * * $Id: md5support.h,v 1.1 2002/01/06 18:59:40 erikm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: md5support.h,v 1.1 2002/01/06 18:59:40 erikm Exp $" #ifndef BLOB_MD5SUPPORT_H #define BLOB_MD5SUPPORT_H #include <blob/types.h> int print_md5_digest(const u32 *digest); #endif Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/include/blob/Makefile.am,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Makefile.am 2002/01/05 20:21:49 1.12 +++ Makefile.am 2002/01/06 18:59:40 1.13 @@ -27,6 +27,8 @@ led.h \ linux.h \ main.h \ + md5.h \ + md5support.h \ memory.h \ memsetup.h \ param_block.h \ Index: main.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/main.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- main.h 2002/01/03 16:07:17 1.5 +++ main.h 2002/01/06 18:59:40 1.6 @@ -48,15 +48,19 @@ typedef struct { int kernelSize; block_source_t kernelType; + u32 kernel_md5_digest[4]; int paramSize; block_source_t paramType; + u32 param_md5_digest[4]; int ramdiskSize; block_source_t ramdiskType; + u32 ramdisk_md5_digest[4]; int blobSize; block_source_t blobType; + u32 blob_md5_digest[4]; serial_baud_t downloadSpeed; serial_baud_t terminalSpeed; |
From: Erik M. <er...@us...> - 2002-01-06 18:59:43
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv26911/src/lib Modified Files: Makefile.am Added Files: md5.c md5support.c Log Message: MD5 support by Chris Hoover --- NEW FILE: md5.c --- /* Taken from textutils-2.0 -ch */ /* $Id: md5.c,v 1.1 2002/01/06 18:59:40 erikm Exp $ */ /* md5.c - Functions to compute MD5 message digest of files or memory blocks according to the definition of MD5 in RFC 1321 from April 1992. Copyright (C) 1995, 1996 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug...@pr.... This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Written by Ulrich Drepper <dr...@gn...>, 1995. */ #ifdef HAVE_CONFIG_H # include <config.h> #endif #include <blob/md5.h> #include <blob/types.h> #include <blob/util.h> #ifdef WORDS_BIGENDIAN # define SWAP(n) \ (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) #else # define SWAP(n) (n) #endif /* This array contains the bytes used to pad the buffer to the next 64-byte boundary. (RFC 1321, 3.1: Step 1) */ static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; /* Initialize structure containing state of computation. (RFC 1321, 3.3: Step 3) */ void md5_init_ctx (ctx) struct md5_ctx *ctx; { ctx->A = 0x67452301; ctx->B = 0xefcdab89; ctx->C = 0x98badcfe; ctx->D = 0x10325476; ctx->total[0] = ctx->total[1] = 0; ctx->buflen = 0; } /* Put result from CTX in first 16 bytes following RESBUF. The result must be in little endian byte order. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ void * md5_read_ctx (ctx, resbuf) const struct md5_ctx *ctx; void *resbuf; { ((md5_uint32 *) resbuf)[0] = SWAP (ctx->A); ((md5_uint32 *) resbuf)[1] = SWAP (ctx->B); ((md5_uint32 *) resbuf)[2] = SWAP (ctx->C); ((md5_uint32 *) resbuf)[3] = SWAP (ctx->D); return resbuf; } /* Process the remaining bytes in the internal buffer and the usual prolog according to the standard and write the result to RESBUF. IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ void * md5_finish_ctx (ctx, resbuf) struct md5_ctx *ctx; void *resbuf; { /* Take yet unprocessed bytes into account. */ md5_uint32 bytes = ctx->buflen; size_t pad; /* Now count remaining bytes. */ ctx->total[0] += bytes; if (ctx->total[0] < bytes) ++ctx->total[1]; pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes; memcpy (&ctx->buffer[bytes], fillbuf, pad); /* Put the 64-bit file length in *bits* at the end of the buffer. */ *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3); *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29)); /* Process last bytes. */ md5_process_block (ctx->buffer, bytes + pad + 8, ctx); return md5_read_ctx (ctx, resbuf); } /* Compute MD5 message digest for LEN bytes beginning at BUFFER. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. */ void * md5_buffer (buffer, len, resblock) const char *buffer; size_t len; void *resblock; { struct md5_ctx ctx; /* Initialize the computation context. */ md5_init_ctx (&ctx); /* Process whole buffer but last len % 64 bytes. */ md5_process_bytes (buffer, len, &ctx); /* Put result in desired memory area. */ return md5_finish_ctx (&ctx, resblock); } void md5_process_bytes (buffer, len, ctx) const void *buffer; size_t len; struct md5_ctx *ctx; { /* When we already have some bits in our internal buffer concatenate both inputs first. */ if (ctx->buflen != 0) { size_t left_over = ctx->buflen; size_t add = 128 - left_over > len ? len : 128 - left_over; memcpy (&ctx->buffer[left_over], buffer, add); ctx->buflen += add; if (left_over + add > 64) { md5_process_block (ctx->buffer, (left_over + add) & ~63, ctx); /* The regions in the following copy operation cannot overlap. */ memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63], (left_over + add) & 63); ctx->buflen = (left_over + add) & 63; } buffer = (const char *) buffer + add; len -= add; } /* Process available complete blocks. */ if (len > 64) { md5_process_block (buffer, len & ~63, ctx); buffer = (const char *) buffer + (len & ~63); len &= 63; } /* Move remaining bytes in internal buffer. */ if (len > 0) { memcpy (ctx->buffer, buffer, len); ctx->buflen = len; } } /* These are the four functions used in the four steps of the MD5 algorithm and defined in the RFC 1321. The first function is a little bit optimized (as found in Colin Plumbs public domain implementation). */ /* #define FF(b, c, d) ((b & c) | (~b & d)) */ #define FF(b, c, d) (d ^ (b & (c ^ d))) #define FG(b, c, d) FF (d, b, c) #define FH(b, c, d) (b ^ c ^ d) #define FI(b, c, d) (c ^ (b | ~d)) /* Process LEN bytes of BUFFER, accumulating context into CTX. It is assumed that LEN % 64 == 0. */ void md5_process_block (buffer, len, ctx) const void *buffer; size_t len; struct md5_ctx *ctx; { md5_uint32 correct_words[16]; const md5_uint32 *words = buffer; size_t nwords = len / sizeof (md5_uint32); const md5_uint32 *endp = words + nwords; md5_uint32 A = ctx->A; md5_uint32 B = ctx->B; md5_uint32 C = ctx->C; md5_uint32 D = ctx->D; /* First increment the byte count. RFC 1321 specifies the possible length of the file up to 2^64 bits. Here we only compute the number of bytes. Do a double word increment. */ ctx->total[0] += len; if (ctx->total[0] < len) ++ctx->total[1]; /* Process all bytes in the buffer with 64 bytes in each round of the loop. */ while (words < endp) { md5_uint32 *cwp = correct_words; md5_uint32 A_save = A; md5_uint32 B_save = B; md5_uint32 C_save = C; md5_uint32 D_save = D; /* First round: using the given function, the context and a constant the next context is computed. Because the algorithms processing unit is a 32-bit word and it is determined to work on words in little endian byte order we perhaps have to change the byte order before the computation. To reduce the work for the next steps we store the swapped words in the array CORRECT_WORDS. */ #define OP(a, b, c, d, s, T) \ do \ { \ a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \ ++words; \ CYCLIC (a, s); \ a += b; \ } \ while (0) /* It is unfortunate that C does not provide an operator for cyclic rotation. Hope the C compiler is smart enough. */ #define CYCLIC(w, s) (w = (w << s) | (w >> (32 - s))) /* Before we start, one word to the strange constants. They are defined in RFC 1321 as T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64 */ /* Round 1. */ OP (A, B, C, D, 7, 0xd76aa478); OP (D, A, B, C, 12, 0xe8c7b756); OP (C, D, A, B, 17, 0x242070db); OP (B, C, D, A, 22, 0xc1bdceee); OP (A, B, C, D, 7, 0xf57c0faf); OP (D, A, B, C, 12, 0x4787c62a); OP (C, D, A, B, 17, 0xa8304613); OP (B, C, D, A, 22, 0xfd469501); OP (A, B, C, D, 7, 0x698098d8); OP (D, A, B, C, 12, 0x8b44f7af); OP (C, D, A, B, 17, 0xffff5bb1); OP (B, C, D, A, 22, 0x895cd7be); OP (A, B, C, D, 7, 0x6b901122); OP (D, A, B, C, 12, 0xfd987193); OP (C, D, A, B, 17, 0xa679438e); OP (B, C, D, A, 22, 0x49b40821); /* For the second to fourth round we have the possibly swapped words in CORRECT_WORDS. Redefine the macro to take an additional first argument specifying the function to use. */ #undef OP #define OP(f, a, b, c, d, k, s, T) \ do \ { \ a += f (b, c, d) + correct_words[k] + T; \ CYCLIC (a, s); \ a += b; \ } \ while (0) /* Round 2. */ OP (FG, A, B, C, D, 1, 5, 0xf61e2562); OP (FG, D, A, B, C, 6, 9, 0xc040b340); OP (FG, C, D, A, B, 11, 14, 0x265e5a51); OP (FG, B, C, D, A, 0, 20, 0xe9b6c7aa); OP (FG, A, B, C, D, 5, 5, 0xd62f105d); OP (FG, D, A, B, C, 10, 9, 0x02441453); OP (FG, C, D, A, B, 15, 14, 0xd8a1e681); OP (FG, B, C, D, A, 4, 20, 0xe7d3fbc8); OP (FG, A, B, C, D, 9, 5, 0x21e1cde6); OP (FG, D, A, B, C, 14, 9, 0xc33707d6); OP (FG, C, D, A, B, 3, 14, 0xf4d50d87); OP (FG, B, C, D, A, 8, 20, 0x455a14ed); OP (FG, A, B, C, D, 13, 5, 0xa9e3e905); OP (FG, D, A, B, C, 2, 9, 0xfcefa3f8); OP (FG, C, D, A, B, 7, 14, 0x676f02d9); OP (FG, B, C, D, A, 12, 20, 0x8d2a4c8a); /* Round 3. */ OP (FH, A, B, C, D, 5, 4, 0xfffa3942); OP (FH, D, A, B, C, 8, 11, 0x8771f681); OP (FH, C, D, A, B, 11, 16, 0x6d9d6122); OP (FH, B, C, D, A, 14, 23, 0xfde5380c); OP (FH, A, B, C, D, 1, 4, 0xa4beea44); OP (FH, D, A, B, C, 4, 11, 0x4bdecfa9); OP (FH, C, D, A, B, 7, 16, 0xf6bb4b60); OP (FH, B, C, D, A, 10, 23, 0xbebfbc70); OP (FH, A, B, C, D, 13, 4, 0x289b7ec6); OP (FH, D, A, B, C, 0, 11, 0xeaa127fa); OP (FH, C, D, A, B, 3, 16, 0xd4ef3085); OP (FH, B, C, D, A, 6, 23, 0x04881d05); OP (FH, A, B, C, D, 9, 4, 0xd9d4d039); OP (FH, D, A, B, C, 12, 11, 0xe6db99e5); OP (FH, C, D, A, B, 15, 16, 0x1fa27cf8); OP (FH, B, C, D, A, 2, 23, 0xc4ac5665); /* Round 4. */ OP (FI, A, B, C, D, 0, 6, 0xf4292244); OP (FI, D, A, B, C, 7, 10, 0x432aff97); OP (FI, C, D, A, B, 14, 15, 0xab9423a7); OP (FI, B, C, D, A, 5, 21, 0xfc93a039); OP (FI, A, B, C, D, 12, 6, 0x655b59c3); OP (FI, D, A, B, C, 3, 10, 0x8f0ccc92); OP (FI, C, D, A, B, 10, 15, 0xffeff47d); OP (FI, B, C, D, A, 1, 21, 0x85845dd1); OP (FI, A, B, C, D, 8, 6, 0x6fa87e4f); OP (FI, D, A, B, C, 15, 10, 0xfe2ce6e0); OP (FI, C, D, A, B, 6, 15, 0xa3014314); OP (FI, B, C, D, A, 13, 21, 0x4e0811a1); OP (FI, A, B, C, D, 4, 6, 0xf7537e82); OP (FI, D, A, B, C, 11, 10, 0xbd3af235); OP (FI, C, D, A, B, 2, 15, 0x2ad7d2bb); OP (FI, B, C, D, A, 9, 21, 0xeb86d391); /* Add the starting values of the context. */ A += A_save; B += B_save; C += C_save; D += D_save; } /* Put checksum in context given as argument. */ ctx->A = A; ctx->B = B; ctx->C = C; ctx->D = D; } --- NEW FILE: md5support.c --- /* * md5support.c: MD5 support function * * Copyright (C) 2001 Hewlett-Packard Company * Written by Christopher Hoover <ch...@hp...> * Minor modifications by Erik Mouw * * $Id: md5support.c,v 1.1 2002/01/06 18:59:40 erikm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: md5support.c,v 1.1 2002/01/06 18:59:40 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/md5support.h> #include <blob/serial.h> #include <blob/types.h> /* takes an u32 digest[4] and prints the ASCII MD5 digest. returns * number of printed characters on success, or negative error number * on failure */ int print_md5_digest(const u32 *digest) { int i, c; const unsigned char *d = (unsigned char *) digest; /* digest is always in little endian order */ for(i = 0; i < 16; i++) { c = (d[i] >> 4) & 0x0f; if(c > 9) c += ('a' - 10); else c += '0'; serial_write(c); c = d[i] & 0x0f; if(c > 9) c += ('a' - 10); else c += '0'; serial_write(c); } return i; } Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/lib/Makefile.am,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Makefile.am 2002/01/06 17:04:36 1.8 +++ Makefile.am 2002/01/06 18:59:40 1.9 @@ -31,6 +31,8 @@ icache.c \ init.c \ led.c \ + md5.c \ + md5support.c \ memcpy.c \ reboot.c \ serial.c \ |
From: Erik M. <er...@us...> - 2002-01-06 18:59:43
|
Update of /cvsroot/blob/blob In directory usw-pr-cvs1:/tmp/cvs-serv26911 Modified Files: acconfig.h configure.in Log Message: MD5 support by Chris Hoover Index: acconfig.h =================================================================== RCS file: /cvsroot/blob/blob/acconfig.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- acconfig.h 2001/12/27 18:27:37 1.10 +++ acconfig.h 2002/01/06 18:59:40 1.11 @@ -98,6 +98,9 @@ /* Define if LCD support is wanted */ #undef CONFIG_LCD_SUPPORT +/* Define if MD5 support is wanted */ +#undef CONFIG_MD5_SUPPORT + @BOTTOM@ #endif Index: configure.in =================================================================== RCS file: /cvsroot/blob/blob/configure.in,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- configure.in 2002/01/03 16:07:17 1.32 +++ configure.in 2002/01/06 18:59:40 1.33 @@ -292,6 +292,11 @@ [lcd_flag=$enable_lcd], [lcd_flag=no]) +AC_ARG_ENABLE(md5, +[ --enable-md5 Enable md5 support ], +[md5_flag=$enable_md5], +[md5_flag=no]) + dnl Check if the user wants *all* features AC_ARG_ENABLE(all-features, @@ -304,6 +309,7 @@ chkmem_flag=yes debug_flag=yes lcd_flag=yes + md5_flag=yes fi @@ -352,6 +358,11 @@ AC_SUBST(LCD) +dnl Check wether or not MD5 support is wanted +if test "x$md5_flag" = "xyes" ; then + AC_DEFINE(CONFIG_MD5_SUPPORT) +fi + dnl Check wether or not additional platform source code dnl for is needed @@ -444,5 +455,6 @@ echo "Memory test support ${chkmem_flag}" echo "Debugging commands support ${debug_flag}" echo "LCD support ${lcd_flag}" +echo "MD5 support ${md5_flag}" echo "Run-time debug information ${blob_debug_flag}" echo "" |
From: Erik M. <er...@us...> - 2002-01-06 18:57:36
|
Update of /cvsroot/blob/blob/utils/mkparamblock In directory usw-pr-cvs1:/tmp/cvs-serv26034/utils/mkparamblock Modified Files: mkparamblock.c Log Message: Fix mkparamblock.c: blob size_t clashes with libc size_t Index: mkparamblock.c =================================================================== RCS file: /cvsroot/blob/blob/utils/mkparamblock/mkparamblock.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- mkparamblock.c 2002/01/03 16:07:18 1.7 +++ mkparamblock.c 2002/01/06 18:57:31 1.8 @@ -4,6 +4,7 @@ #include <string.h> #include <stdlib.h> #include <sys/stat.h> +#define USE_BLOB_TOGETHER_WITH_LIBC #include <blob/param_block.h> #include <blob/serial.h> |
From: Erik M. <er...@us...> - 2002-01-06 18:57:36
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv26034/include/blob Modified Files: types.h Log Message: Fix mkparamblock.c: blob size_t clashes with libc size_t Index: types.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/types.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- types.h 2002/01/06 17:04:36 1.2 +++ types.h 2002/01/06 18:57:32 1.3 @@ -42,7 +42,9 @@ typedef unsigned short u16; typedef unsigned char u8; +#ifndef USE_BLOB_TOGETHER_WITH_LIBC typedef u32 size_t; +#endif /* number of nibbles in a word */ #define NIBBLES_PER_WORD (8) |
From: Erik M. <er...@us...> - 2002-01-06 17:04:39
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv2492/src/lib Modified Files: Makefile.am strncmp.c strncpy.c Added Files: memcpy.c Log Message: - Add s8, s16, and s32 types for signed integers - Add size_t type - Change strncpy(), strlcpy(), and strncmp() to use size_t instead of int - Add memcpy() function --- NEW FILE: memcpy.c --- /* * memcpy.c: copy memory regions * * Copyright (C) 2002 Erik Mouw (J.A...@it...) * * Implementation taken from the GNU textutils 2.0, which are * Copyright (C) 1995, 1997 Free Software Foundation, Inc. * * $Id: memcpy.c,v 1.1 2002/01/06 17:04:36 erikm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: memcpy.c,v 1.1 2002/01/06 17:04:36 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/util.h> void *memcpy(void *dest, const void *src, size_t n) { const u8 *s = (const u8*)src; u8 *d = (u8 *)dest; while(n-- > 0) *d++ = *s++; return dest; } Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/lib/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Makefile.am 2002/01/02 01:21:41 1.7 +++ Makefile.am 2002/01/06 17:04:36 1.8 @@ -31,6 +31,7 @@ icache.c \ init.c \ led.c \ + memcpy.c \ reboot.c \ serial.c \ serial-sa11x0.c \ Index: strncmp.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/strncmp.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- strncmp.c 2001/10/07 22:58:56 1.1 +++ strncmp.c 2002/01/06 17:04:36 1.2 @@ -32,7 +32,7 @@ -int strncmp(const char *s1, const char *s2, int maxlen) +int strncmp(const char *s1, const char *s2, size_t maxlen) { int i; Index: strncpy.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/strncpy.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- strncpy.c 2001/12/19 20:00:14 1.1 +++ strncpy.c 2002/01/06 17:04:36 1.2 @@ -32,7 +32,7 @@ -char *strncpy(char *dest, const char *src, int n) +char *strncpy(char *dest, const char *src, size_t n) { while(n > 0) { n--; @@ -50,7 +50,7 @@ /* small variation on strncpy(): null-terminate the destination * string */ -char *strlcpy(char *dest, const char *src, int n) +char *strlcpy(char *dest, const char *src, size_t n) { strncpy(dest, src, n); |
From: Erik M. <er...@us...> - 2002-01-06 17:04:39
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv2492/include/blob Modified Files: util.h types.h Log Message: - Add s8, s16, and s32 types for signed integers - Add size_t type - Change strncpy(), strlcpy(), and strncmp() to use size_t instead of int - Add memcpy() function Index: util.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/util.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- util.h 2001/12/19 20:00:15 1.6 +++ util.h 2002/01/06 17:04:36 1.7 @@ -41,14 +41,16 @@ void MyMemCpyChar(char *dest, const char *src, int numBytes); void MyMemSet(u32 *dest, const u32 wordToWrite, int numWords); -int strncmp(const char *s1, const char *s2, int maxlen); +void *memcpy(void *dest, const void *src, size_t n); + +int strncmp(const char *s1, const char *s2, size_t maxlen); int strlen(const char *s); -char *strncpy(char *dest, const char *src, int n); +char *strncpy(char *dest, const char *src, size_t n); /* same as strncpy(), but also null terminates the string */ -char *strlcpy(char *dest, const char *src, int n); +char *strlcpy(char *dest, const char *src, size_t n); /* convert a string to an u32 value */ int strtou32(const char *str, u32 *value); Index: types.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/types.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- types.h 2001/10/07 15:17:49 1.1 +++ types.h 2002/01/06 17:04:36 1.2 @@ -34,9 +34,15 @@ #ifndef BLOB_TYPES_H #define BLOB_TYPES_H +typedef signed long s32; +typedef signed short s16; +typedef signed char s8; + typedef unsigned long u32; typedef unsigned short u16; typedef unsigned char u8; + +typedef u32 size_t; /* number of nibbles in a word */ #define NIBBLES_PER_WORD (8) |
From: Erik M. <er...@us...> - 2002-01-06 15:46:20
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv19559/src/lib Modified Files: reboot.c Log Message: Flush the serial output queue before we either reboot, reblob, or start the kernel. Index: reboot.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/reboot.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- reboot.c 2001/10/07 22:36:11 1.1 +++ reboot.c 2002/01/06 15:46:17 1.2 @@ -29,7 +29,6 @@ #include <blob/serial.h> #include <blob/sa1100.h> -#include <blob/time.h> @@ -43,8 +42,7 @@ int reboot(int argc, char *argv[]) { SerialOutputString("Rebooting...\n\n"); - - msleep(500); + serial_flush_output(); RCSR = 0; RSRR = 1; |
From: Erik M. <er...@us...> - 2002-01-06 15:46:20
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv19559/src/blob Modified Files: linux.c reboot.c Log Message: Flush the serial output queue before we either reboot, reblob, or start the kernel. Index: linux.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/linux.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- linux.c 2001/12/19 20:00:15 1.7 +++ linux.c 2002/01/06 15:46:17 1.8 @@ -32,6 +32,7 @@ #include <blob/main.h> #include <blob/memory.h> #include <blob/util.h> +#include <blob/serial.h> #include <asm-arm/setup.h> @@ -60,6 +61,7 @@ /* we assume that the kernel is in place */ SerialOutputString("\nStarting kernel ...\n\n"); + serial_flush_output(); /* disable subsystems that want to be disabled before kernel boot */ exit_subsystems(); Index: reboot.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/reboot.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- reboot.c 2001/10/28 22:15:00 1.6 +++ reboot.c 2002/01/06 15:46:17 1.7 @@ -34,7 +34,6 @@ #include <blob/init.h> #include <blob/main.h> #include <blob/serial.h> -#include <blob/time.h> @@ -52,7 +51,7 @@ SerialOutputString("Restarting blob from RAM...\n\n"); - msleep(500); + serial_flush_output(); /* disable subsystems that want to be disabled */ exit_subsystems(); |
From: Erik M. <er...@us...> - 2002-01-06 15:44:26
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv19353/src/blob Modified Files: debug.c Log Message: New "call" command by Christopher Hoover. Index: debug.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/debug.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- debug.c 2002/01/03 16:07:17 1.8 +++ debug.c 2002/01/06 15:44:23 1.9 @@ -440,6 +440,71 @@ static char bitchghelp[] = "bitchg address value {and|or|xor|set|clear}\n"; __commandlist(BitChange, "bitchg", bitchghelp ); +/********************************************************************* + * Call + * + * AUTHOR: Christopher Hoover <ch...@hp...> + * REVISED: + * + * Jumps to an arbitrary address. + * + */ +static int Call( int argc, char *argv[] ) +{ + int ret = 0; + u32 adr, a = 0, b = 0, c = 0, d = 0; + int (*called_fn)(u32, u32, u32, u32); + + if ( argc < 2 || argc > 6 ) ERR( -EINVAL ); + + ret = strtou32( argv[1], &adr ); + if ( ret < 0 ) ERR( -EINVAL ); + + if ( argc >= 3 ) { + ret = strtou32( argv[2], &a ); + if ( ret < 0 ) ERR( -EINVAL ); + } + if ( argc >= 4 ) { + ret = strtou32( argv[2], &b ); + if ( ret < 0 ) ERR( -EINVAL ); + } + if ( argc >= 5 ) { + ret = strtou32( argv[2], &c ); + if ( ret < 0 ) ERR( -EINVAL ); + } + if ( argc >= 6) { + ret = strtou32( argv[2], &d ); + if ( ret < 0 ) ERR( -EINVAL ); + } + + SerialOutputString("Calling function at 0x"); + SerialOutputHex(adr); + SerialOutputString(" ...\n"); + serial_flush_output(); + + called_fn = (int (*)(u32, u32, u32, u32))adr; + + ret = called_fn(a, b, c, d); + + SerialOutputString("\nReturn value: 0x"); + SerialOutputHex((u32)ret); + serial_write('\n'); + + ret = 0; + +DONE: + if ( ret != 0 ) { + perror( ret, __FUNCTION__ ); + } + return ret; +} + +static char callhelp[] = "call address [arg0 [arg1 [arg2 [arg3]]]]\n" +"Call function at <address> with optional arguments\n"; + +__commandlist(Call, "call", callhelp); + + /********************************************************************** * static functions */ |
From: Erik M. <er...@us...> - 2002-01-05 20:24:10
|
Update of /cvsroot/blob/blob/doc In directory usw-pr-cvs1:/tmp/cvs-serv7993/doc Modified Files: commandlist.txt Log Message: Fix typo Index: commandlist.txt =================================================================== RCS file: /cvsroot/blob/blob/doc/commandlist.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- commandlist.txt 2001/12/17 00:07:37 1.1 +++ commandlist.txt 2002/01/05 20:24:07 1.2 @@ -157,7 +157,7 @@ That's all there is. -It's good practice to both the help text and the __commandlist() +It's good practice to put both the help text and the __commandlist() definition just below the function that implements the command, so there is less chance for them to get discrepancies. |