Commit 86a7d813 authored by dbrownell's avatar dbrownell
Browse files

Remove annoying end-of-line whitespace from most src/*

files; omitted src/httpd


git-svn-id: svn://svn.berlios.de/openocd/trunk@2742 b42882b7-edfa-0310-969c-e2dbd0fdcd60
parent 0bcf5a6b
......@@ -9,7 +9,7 @@ else
MAINFILE = main.c
endif
openocd_SOURCES = $(MAINFILE)
openocd_SOURCES = $(MAINFILE)
openocd_LDADD = libopenocd.la
libopenocd_la_SOURCES = openocd.c
......@@ -38,7 +38,7 @@ endif
libopenocd_la_CPPFLAGS += $(AM_CPPFLAGS) $(CPPFLAGS)
# the library search path.
libopenocd_la_LDFLAGS = $(all_libraries)
libopenocd_la_LDFLAGS = $(all_libraries)
if IS_MINGW
MINGWLDADD = -lwsock32
......@@ -97,6 +97,6 @@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
# assumption is: You are only rebuilding the EXE.... and everything
# else is/was previously installed.
#
# use at your own risk
# use at your own risk
quick: all install-binPROGRAMS
/****************************************************************************
* Copyright (c) 2006 by Michael Fischer. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the author nor the names of its contributors may
* be used to endorse or promote products derived from this software
* 3. Neither the name of the author nor the names of its contributors may
* be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
****************************************************************************
......@@ -94,11 +94,11 @@ SECTIONS
*(COMMON)
. = ALIGN(4);
PROVIDE (__bss_end = .);
. = ALIGN(256);
PROVIDE (__stack_start = .);
PROVIDE (__stack_fiq_start = .);
. += FIQ_STACK_SIZE;
. = ALIGN(4);
......@@ -124,9 +124,9 @@ SECTIONS
. = ALIGN(4);
PROVIDE (__stack_svc_end = .);
PROVIDE (__stack_end = .);
PROVIDE (__heap_start = .);
PROVIDE (__heap_start = .);
} > ram
}
/*** EOF ***/
/****************************************************************************
* Copyright (c) 2006 by Michael Fischer. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the author nor the names of its contributors may
* be used to endorse or promote products derived from this software
* 3. Neither the name of the author nor the names of its contributors may
* be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
****************************************************************************
......@@ -33,14 +33,14 @@
*
* 18.12.06 mifi First Version
* The hardware initialization is based on the startup file
* crtat91sam7x256_rom.S from NutOS 4.2.1.
* crtat91sam7x256_rom.S from NutOS 4.2.1.
* Therefore partial copyright by egnite Software GmbH.
****************************************************************************/
/*
* Some defines for the program status registers
*/
ARM_MODE_USER = 0x10 /* Normal User Mode */
ARM_MODE_USER = 0x10 /* Normal User Mode */
ARM_MODE_FIQ = 0x11 /* FIQ Fast Interrupts Mode */
ARM_MODE_IRQ = 0x12 /* IRQ Standard Interrupts Mode */
ARM_MODE_SVC = 0x13 /* Supervisor Interrupts Mode */
......@@ -48,10 +48,10 @@
ARM_MODE_UNDEF = 0x1B /* Undefined Instructions Mode */
ARM_MODE_SYS = 0x1F /* System Running in Priviledged Operating Mode */
ARM_MODE_MASK = 0x1F
I_BIT = 0x80 /* disable IRQ when I bit is set */
F_BIT = 0x40 /* disable IRQ when I bit is set */
/*
* Register Base Address
*/
......@@ -70,10 +70,10 @@
MC_BASE = 0xFFFFFF00
MC_FMR_OFF = 0x00000060
MC_FWS_1FWS = 0x00480100
.section .vectors,"ax"
.code 32
/****************************************************************************/
/* Vector table and reset entry */
/****************************************************************************/
......@@ -101,7 +101,7 @@ FIQAddr: .word FIQHandler
.section .init, "ax"
.code 32
.global ResetHandler
.global ExitFunction
.extern main
......@@ -116,7 +116,7 @@ ResetHandler:
ldr r0, =WDT_WDDIS
str r0, [r1, #WDT_MR_OFF]
/*
* Enable user reset: assertion length programmed to 1ms
*/
......@@ -124,7 +124,7 @@ ResetHandler:
ldr r1, =RSTC_MR
str r0, [r1, #0]
/*
* Use 2 cycles for flash access.
*/
......@@ -141,22 +141,22 @@ ResetHandler:
str r0, [r1, #AIC_EOICR_OFF]
str r0, [r1, #AIC_IDCR_OFF]
/*
* Setup a stack for each mode
*/
msr CPSR_c, #ARM_MODE_UNDEF | I_BIT | F_BIT /* Undefined Instruction Mode */
*/
msr CPSR_c, #ARM_MODE_UNDEF | I_BIT | F_BIT /* Undefined Instruction Mode */
ldr sp, =__stack_und_end
msr CPSR_c, #ARM_MODE_ABORT | I_BIT | F_BIT /* Abort Mode */
ldr sp, =__stack_abt_end
msr CPSR_c, #ARM_MODE_FIQ | I_BIT | F_BIT /* FIQ Mode */
msr CPSR_c, #ARM_MODE_FIQ | I_BIT | F_BIT /* FIQ Mode */
ldr sp, =__stack_fiq_end
msr CPSR_c, #ARM_MODE_IRQ | I_BIT | F_BIT /* IRQ Mode */
msr CPSR_c, #ARM_MODE_IRQ | I_BIT | F_BIT /* IRQ Mode */
ldr sp, =__stack_irq_end
msr CPSR_c, #ARM_MODE_SVC | I_BIT | F_BIT /* Supervisor Mode */
ldr sp, =__stack_svc_end
......@@ -171,27 +171,27 @@ bss_clear_loop:
cmp r1, r2
strne r3, [r1], #+4
bne bss_clear_loop
/*
* Jump to main
*/
mrs r0, cpsr
bic r0, r0, #I_BIT | F_BIT /* Enable FIQ and IRQ interrupt */
msr cpsr, r0
mov r0, #0 /* No arguments */
mov r1, #0 /* No arguments */
ldr r2, =main
mov lr, pc
bx r2 /* And jump... */
ExitFunction:
nop
nop
nop
b ExitFunction
b ExitFunction
/****************************************************************************/
/* Default interrupt handler */
......@@ -199,7 +199,7 @@ ExitFunction:
UndefHandler:
b UndefHandler
SWIHandler:
b SWIHandler
......@@ -208,13 +208,13 @@ PAbortHandler:
DAbortHandler:
b DAbortHandler
IRQHandler:
b IRQHandler
FIQHandler:
b FIQHandler
.weak ExitFunction
.weak UndefHandler, PAbortHandler, DAbortHandler
.weak IRQHandler, FIQHandler
......
......@@ -13,19 +13,19 @@ OBJDUMP = $(TRGT)objdump
MCU = arm7tdmi
# List all default C defines here, like -D_DEBUG=1
DDEFS =
DDEFS =
# List all default ASM defines here, like -D_DEBUG=1
DADEFS =
DADEFS =
# List all default directories to look for include files here
DINCDIR =
DINCDIR =
# List the default directory to look for the libraries here
DLIBDIR =
# List all default libraries here
DLIBS =
DLIBS =
#
# End of default section
......@@ -42,10 +42,10 @@ PROJECT = at91sam7x_ocl
LDSCRIPT= at91sam7x_ram.ld
# List all user C define here, like -D_DEBUG=1
UDEFS =
UDEFS =
# Define ASM defines here
UADEFS =
UADEFS =
# List C source files here
SRC = main.c dcc.c samflash.c
......@@ -60,7 +60,7 @@ UINCDIR =
ULIBDIR =
# List all user libraries here
ULIBS =
ULIBS =
# Define optimisation level here
OPT = -O2
......@@ -122,7 +122,7 @@ clean:
-rm -f $(ASRC:.s=.lst)
-rm -fR .dep
#
#
# Include the dependency files, should be the last of the makefile
#
#-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
......
......@@ -7,9 +7,9 @@ METASOURCES = AUTO
noinst_LTLIBRARIES = libhelper.la
if ECOSBOARD
CONFIGFILES =
CONFIGFILES =
else
CONFIGFILES = options.c jim.c jim-eventloop.c
CONFIGFILES = options.c jim.c jim-eventloop.c
endif
......
......@@ -24,16 +24,16 @@ proc get_help_text {} {
# Show flash in human readable form
# This is an example of a human readable form of a low level fn
proc flash_banks {} {
set i 0
proc flash_banks {} {
set i 0
set result ""
foreach {a} [ocd_flash_banks] {
if {$i > 0} {
set result "$result\n"
}
set result [format "$result#%d: %s at 0x%08x, size 0x%08x, buswidth %d, chipwidth %d" $i $a(name) $a(base) $a(size) $a(bus_width) $a(chip_width)]
set i [expr $i+1]
}
set i [expr $i+1]
}
return $result
}
......@@ -56,7 +56,7 @@ proc help {args} {
set n 0
while 1 {
if {$n > [string length $h]} {break}
set next_a [expr $n+$w]
if {[string length $h]>$n+$w} {
set xxxx [string range $h $n [expr $n+$w]]
......@@ -67,8 +67,8 @@ proc help {args} {
set next_a [expr $lastpos+$n+1]
}
}
puts [format "%-25s %s" $cmdname [string range $h $n [expr $next_a-1]] ]
set cmdname ""
set n [expr $next_a]
......@@ -144,11 +144,11 @@ proc ocd_process_reset { MODE } {
set in_process_reset 0
return -code error "'reset' can not be invoked recursively"
}
set in_process_reset 1
set success [expr [catch {ocd_process_reset_inner $MODE} result]==0]
set success [expr [catch {ocd_process_reset_inner $MODE} result]==0]
set in_process_reset 0
if {$success} {
return $result
} else {
......@@ -239,13 +239,13 @@ proc ocd_process_reset_inner { MODE } {
# the JTAG tap reset signal might be hooked to a slow
# resistor/capacitor circuit - and it might take a while
# to charge
# Catch, but ignore any errors.
catch { $t arp_waitstate halted 1000 }
# Did we succeed?
set s [$t curstate]
if { 0 != [string compare $s "halted" ] } {
return -error [format "TARGET: %s - Not halted" $t]
}
......@@ -262,7 +262,7 @@ proc ocd_process_reset_inner { MODE } {
set err [catch "$t arp_waitstate halted 5000"]
# Did it halt?
if { $err == 0 } {
$t invoke-event reset-init
$t invoke-event reset-init
}
}
}
......@@ -294,13 +294,13 @@ add_help_text cpu "<name> - prints out target options and a comment on CPU which
# A list of names of CPU and options required
set ocd_cpu_list {
{
name IXP42x
options {xscale -variant IXP42x}
name IXP42x
options {xscale -variant IXP42x}
comment {IXP42x cpu}
}
{
name arm7
options {arm7tdmi -variant arm7tdmi}
name arm7
options {arm7tdmi -variant arm7tdmi}
comment {vanilla ARM7}
}
}
......@@ -312,7 +312,7 @@ proc ocd_cpu {args} {
global ocd_cpu_list
foreach a [lsort $ocd_cpu_list] {
if {[string length $args]==0||[string first [string toupper $name] [string toupper "$a(name)$a(options)$a(comment)"]]!=-1} {
lappend result $a
lappend result $a
}
}
return $result
......@@ -352,5 +352,5 @@ proc capture_catch {a} {
catch {
capture {uplevel $a}
} result
return $result
return $result
}
......@@ -314,7 +314,7 @@ static int jlink_init(void)
LOG_ERROR("Cannot find jlink Interface! Please check connection and permissions.");
return ERROR_JTAG_INIT_FAILED;
}
/*
* The next three instructions were added after discovering a problem while using an oscilloscope. For the V8
* SAM-ICE dongle (and likely other j-link device variants), the reset line to the target microprocessor was found to
......@@ -324,7 +324,7 @@ static int jlink_init(void)
* following a new USB session. Keeping the processor in reset during the first read collecting version information
* seems to prevent errant "J-Link command EMU_CMD_VERSION failed" issues.
*/
LOG_INFO("J-Link initialization started / target CPU reset initiated");
jlink_simple_command(EMU_CMD_HW_TRST0);
jlink_simple_command(EMU_CMD_HW_RESET0);
......@@ -881,7 +881,7 @@ static jlink_jtag_t* jlink_usb_open()
if (result->usb_handle)
{
/* BE ***VERY CAREFUL*** ABOUT MAKING CHANGES IN THIS AREA!!!!!!!!!!!
* The behavior of libusb is not completely consistent across Windows, Linux, and Mac OS X platforms. The actions taken
* in the following compiler conditionals may not agree with published documentation for libusb, but were found
......
......@@ -67,7 +67,7 @@ m4_define(`m4_delay_setup',
A.L = m4_low_nybble(`('$1`) / 2')
Y = A
)')
m4_define(`m4_delay_loop',
`; delay loop (m4_eval($1) cycles)'
`m4_ifelse(m4_eval(`('$1`) < 6'), 1,
......@@ -79,7 +79,7 @@ m4_define(`m4_delay_loop',
)')
m4_dnl These are utility macros for use with delays. Specifically, there is code below which needs some predictability in code size for relative jumps to reach. The m4_delay macro generates an extra NOP when an even delay is needed, and the m4_delay_loop macro generates an extra NOP when an odd delay is needed. Using this for the argument to the respective macro rounds up the argument so that the extra NOP will not be generated. There is also logic built in to cancel the rounding when the result is small enough that a loop would not be generated.
m4_define(`m4_delay_loop_round_up', `m4_ifelse(m4_eval($1` < 6'), 1, $1, m4_eval(`(('$1`) + 1) / 2 * 2'))')
m4_define(`m4_delay_round_up', `m4_ifelse(m4_eval($1` < 6'), 1, $1, m4_eval(`(('$1`) / 2 * 2) + 1'))')
......@@ -106,7 +106,7 @@ m4_divert(`0')m4_dnl
A.H = 0xc ; lookup table at 0x1550 + 0xc0 = 0x1610
; branch to address in lookup table
Y = A
Y = A
A = <Y>
BRANCH
......@@ -203,7 +203,7 @@ entry_download:
; ; Ack buffer 0 in download mode
; A.L = 0x1
; BUFFER_MNGT = A
;
;
; STATUS STOP
......@@ -213,7 +213,7 @@ entry_download:
A = CMP01 ; bits 3..0 contain the number of bytes to shift - 1
A.H = 0
Y = A ; loop counter
Y = A ; loop counter
A = CMP01
EXCHANGE
......@@ -262,7 +262,7 @@ opcode_shift_tdi_andor_tms_bytes__loop:
A = CMP01 ; bits 3..0 contain the number of bytes to shift - 1
A.H = 0
Y = A ; loop counter
Y = A ; loop counter
opcode_shift_tdo_bytes__loop:
SHIFT MPEG PIN0=>IN
......@@ -303,7 +303,7 @@ opcode_shift_tdio_bytes__loop:
JP sub_shift_tdio_bits
opcode_shift_tdio_bytes__sub_return:
A = CMP10 ; byte loop counter
CP A=>X
CLC
......@@ -323,7 +323,7 @@ opcode_shift_tdio_bytes__sub_return:
A = CMP01 ; bits 2..0 contain the number of bits to shift - 1
A.H = 0
BCLR 3 ; set TMS=1 if bit 3 was set
CMP11 = A ; bit loop counter
CMP11 = A ; bit loop counter
A.H = opcode_shift_tdio_bits__sub_return
A.L = opcode_shift_tdio_bits__sub_return
......@@ -334,7 +334,7 @@ opcode_shift_tdio_bytes__sub_return:
DR_CARD = A
JP sub_shift_tdio_bits
opcode_shift_tdio_bits__sub_return:
A = X
;DR_MPEG = A ; return TCK low, as str912 reset halt seems to require it
BRANCH
......@@ -365,9 +365,9 @@ m4_delay_setup(m4_delay_loop_round_up(SETUP_DELAY_CYCLES - 1))
m4_delay_loop(m4_delay_loop_round_up(SETUP_DELAY_CYCLES - 1))
BSET 2 ; TCK high
DR_MPEG = A
DR_MPEG = A
A = DR_MPEG ; set carry bit to TDO
A = DR_MPEG ; set carry bit to TDO
CLC
BCLR 0
JP +2
......@@ -431,7 +431,7 @@ opcode_shift_tms_tdi_bit_pair__sub_return:
BSET 3 ; bit says whether to return TDO
JP +2
ADR_BUFFER1 -= X ; subroutine returns it, so undo that
A = X
DR_MPEG = A ; return TCK low, as str912 reset halt seems to require it
BRANCH
......@@ -443,7 +443,7 @@ opcode_shift_tms_tdi_bit_pair__sub_return:
A = CMP01 ; bits 3..0 contain the number of bits to shift - 1 (only 1-8 bits is valid... no checking, just improper operation)
A.H = 0
CMP11 = A ; bit loop counter
CMP11 = A ; bit loop counter
A = DATA_BUFFER0 ; get byte from input buffer
ADR_BUFFER0 += X
......@@ -467,7 +467,7 @@ m4_delay_setup(SETUP_DELAY_CYCLES - 1)
m4_delay_loop(SETUP_DELAY_CYCLES - 1)
BSET 2 ; TCK high
DR_MPEG = A
DR_MPEG = A
m4_delay(HOLD_DELAY_CYCLES - 10)
......
......@@ -822,7 +822,7 @@ int gdb_connection_closed(connection_t *connection)
log_remove_callback(gdb_log_callback, connection);
gdb_actual_connections--;
LOG_DEBUG("GDB Close, Target: %s, state: %s, gdb_actual_connections=%d",
LOG_DEBUG("GDB Close, Target: %s, state: %s, gdb_actual_connections=%d",
gdb_service->target->cmd_name,
target_state_name(gdb_service->target),
gdb_actual_connections);
......
......@@ -98,7 +98,7 @@ noinst_HEADERS = \
avrt.h