Skip to content
Snippets Groups Projects
Commit 5dcb50f9 authored by jlarmour's avatar jlarmour
Browse files

Merge from eCos master repository on 1999-10-25-21:18:27-BST

parent 10e38efa
No related branches found
Tags ecos-sw-1999-10-25
No related merge requests found
Showing
with 249 additions and 29 deletions
......@@ -83,6 +83,7 @@
#endif
/* -------------------------------------------------------------------- */
#endif /* CYGONCE_PKGCONF_WATCHDOG_H */
/* EOF watchdog.h */
1999-10-22 Hugo Tyson <hmt@cygnus.co.uk>
* src/arm_stub.c (cyg_hal_gdb_running_step):
(cyg_hal_gdb_break_is_set): Provide dummies for these two for now.
See changelog for hal/common/ hal_stub and generic_stub for info.
1999-10-21 Jonathan Larmour <jlarmour@cygnus.co.uk>
* include/hal_arch.h: Tidy a bit so the breakpoint instruction is only
defined in one place
1999-10-14 Jesper Skov <jskov@cygnus.co.uk>
From James Ingham <jingham@cygnus.com>:
* src/PKGconf.mak: Make sed invocation Solaris safe.
......
......@@ -171,15 +171,21 @@ externC void hal_thread_load_context( CYG_ADDRESS to )
// HAL_BREAKINST is the value of the breakpoint instruction and
// HAL_BREAKINST_SIZE is its size in bytes.
#define HAL_BREAKPOINT(_label_) \
asm volatile (" .globl " #_label_ ";" \
#_label_":" \
" .word 0xE7FFDEFE" \
#define _stringify1(__arg) #__arg
#define _stringify(__arg) _stringify1(__arg)
#define HAL_BREAKINST_ARM 0xE7FFDEFE
#define HAL_BREAKINST_ARM_SIZE 4
#define HAL_BREAKPOINT(_label_) \
asm volatile (" .globl " #_label_ ";" \
#_label_":" \
" .word " _stringify(HAL_BREAKINST_ARM) \
);
//#define HAL_BREAKINST {0xFE, 0xDE, 0xFF, 0xE7}
#define HAL_BREAKINST 0xE7FFDEFE
#define HAL_BREAKINST_SIZE 4
#define HAL_BREAKINST HAL_BREAKINST_ARM
#define HAL_BREAKINST_SIZE HAL_BREAKINST_ARM_SIZE
//--------------------------------------------------------------------------
// Thread register state manipulation for GDB support.
......
1999-10-19 Jonathan Larmour <jlarmour@cygnus.co.uk>
* include/hal_cma230.h: Fix ifdefs and comments to be for
the cma230, not any other board
* misc/gdb_module.c: Likewise
* src/PKGconf.mak: Likewise
1999-10-14 Jesper Skov <jskov@cygnus.co.uk>
* misc/STUBS_config: Updated.
......
#ifndef CYGONCE_HAL_CL7211_H
#define CYGONCE_HAL_CL7211_H
#ifndef CYGONCE_HAL_CMA230_H
#define CYGONCE_HAL_CMA230_H
/*=============================================================================
//
// hal_cl7211.h
// hal_cma230.h
//
// HAL Support for Kernel Diagnostic Routines
//
......
......@@ -2,7 +2,7 @@
//
// gdb_module.c
//
// Cirrus CL7211 eval board GDB stubs (module wrapper)
// Cogent CMA230 board GDB stubs (module wrapper)
//
//==========================================================================
//####COPYRIGHTBEGIN####
......@@ -32,7 +32,7 @@
// Author(s): gthomas
// Contributors: gthomas
// Date: 1999-05-11
// Description: Cirrus CL7211 FLASH module for eCos GDB stubs
// Description: Cirrus CMA230 module for eCos GDB stubs
//####DESCRIPTIONEND####
//
......
......@@ -2,7 +2,7 @@
#
# makefile
#
# hal/arm/cl7211/src
# hal/arm/cma230/src
#
#==============================================================================
#####COPYRIGHTBEGIN####
......
1999-10-25 Jesper Skov <jskov@cygnus.co.uk>
* misc/STUBS_config: Updated.
* src/hal_diag.c (hal_diag_led): Added LED diag.
* misc/prog_flash.c: Fixed compiler warning.
1999-10-19 Jesper Skov <jskov@cygnus.co.uk>
* include/pkgconf/hal_arm_pid.h: Added ARM9 options.
......
......@@ -51,5 +51,3 @@ gdb_module.img: gdb_module.stamp
$(RM) -f gdb_module.img.XX
endif
......@@ -12,9 +12,18 @@ tcl $1/pkgconf.tcl \
--disable CYGPKG_DEVICES_WATCHDOG
patch <<END_OF_PATCH -p0
--- pkgconf/hal.h~ Thu Jul 8 08:26:44 1999
+++ pkgconf/hal.h Wed Jul 28 10:51:07 1999
@@ -369,10 +369,10 @@
--- pkgconf/hal.h.orig Fri Oct 22 09:32:14 1999
+++ pkgconf/hal.h Mon Oct 25 09:15:33 1999
@@ -110,7 +110,7 @@
}
}}CFG_DATA */
-#define CYGFUN_HAL_COMMON_KERNEL_SUPPORT
+#undef CYGFUN_HAL_COMMON_KERNEL_SUPPORT
/* {{CFG_DATA
@@ -382,10 +382,10 @@
}}CFG_DATA */
......
......@@ -62,6 +62,8 @@ void write_sector(int, char *);
char *flash_buffer = (char *)0x60000;
char *flash_buffer_end = (char *)0x64000;
#define BUF(x) buf[x]
// FUNCTIONS
externC void
......@@ -89,6 +91,7 @@ main( int argc, char *argv[] )
cyg_thread_delay(5*100);
diag_printf("\n");
diag_printf("...Programming FLASH\n");
i = 0;
while (flash_buffer < flash_buffer_end) {
write_sector(i++, flash_buffer);
......@@ -171,7 +174,7 @@ void
write_sector(int num, char *buf)
{
int i, cnt;
volatile char *wrt = (volatile int *)&FLASH[num*sector_size];
volatile char *wrt = (volatile char *)&FLASH[num*sector_size];
// diag_printf("Writing to %08x\n", wrt);
// Enter Program Mode
......@@ -181,26 +184,25 @@ write_sector(int num, char *buf)
// Note: write bytes as longs regardless of bus width
for (i = 0; i < sector_size; i++) {
wrt[i] = buf[i];
wrt[i] = BUF(i);
}
// Wait for sector to program
cnt = 0;
i = sector_size - 1;
while (wrt[i] != buf[i]) {
while (wrt[i] != BUF(i)) {
if (cnt++ > 0x01000000) break;
}
// diag_printf("Out - i: %d, wrt[i] = %08X.%08X, buf[i] = %08X, count = %x\n", i, &wrt[i], wrt[i], buf[i], cnt);
// diag_printf("Out - i: %d, wrt[i] = %08X.%08X, BUF(i) = %08X, count = %x\n", i, &wrt[i], wrt[i], BUF(i), cnt);
// Verify
for (i = 0; i < sector_size; i++) {
for (cnt = 0; cnt < 10; cnt++) {
if (*wrt == *buf) break;
if (wrt[i] == BUF(i)) break;
cyg_thread_delay(1);
}
if (cnt == 10) {
diag_printf("Can't program at 0x%08X: %02X not %02X\n", wrt, *wrt, *buf);
diag_printf("Can't program at 0x%08X: %02X not %02X\n", wrt, *wrt, BUF(0));
}
wrt++; buf++;
}
}
......@@ -345,5 +345,18 @@ hal_diag_write_char(char c)
}
#endif
/*---------------------------------------------------------------------------*/
// Control the LEDs PP0-PP3. this requires the jumpers on pins 1-8 to
// be set on LK11, thus preventing the use of the parallel port.
#define CYG_DEVICE_PARALLEL_DATA 0x0d800040
void
hal_diag_led(int n)
{
HAL_WRITE_UINT8(CYG_DEVICE_PARALLEL_DATA, (n & 0xf) << 4);
}
/*---------------------------------------------------------------------------*/
/* End of hal_diag.c */
1999-10-22 Hugo Tyson <hmt@cygnus.co.uk>
* include/hal_stub.h (CYG_HAL_GDB_ENTER_CRITICAL_IO_REGION):
(CYG_HAL_GDB_LEAVE_CRITICAL_IO_REGION): new macros to be invoked
in hal_diag routines to make atomic the code that outputs a
complete GDB $O packet. This is required so that watching
variables (which is implemented by stepping) and stepping itself
does not try to ss through that $O output code. CASE 102327.
* src/hal_stub.c (cyg_hal_gdb_break_is_set): new routine to query
whether a break is set: used by step in the stubs to decide to
continue instead, because we are in a critical region.
(cyg_hal_gdb_running_step): communication between generic stub and
here: if set, a step has been converted into a continue, so we do
NOT obey cyg_hal_gdb_remove_break until it is cleared, in
handle_exception_cleanup().
* src/generic-stub.c (__process_packet): If there is a break set
by the hal_stub.c, convert a step to continue, and set
cyg_hal_gdb_running_step to say we did so.
1999-10-22 Jesper Skov <jskov@cygnus.co.uk>
Case 102379
* src/generic-stub.c (__handle_exception): Flush and clear caches
after cleaning up after single-stepping.
(memcpy, memset): Added to prevent stub hanging if user puts
breakpoints in either function.
1999-10-10 Gary Thomas <gthomas@cygnus.co.uk>
* src/thread-packets.c (stub_pkt_currthread): Fix typo in comment.
......
......@@ -60,6 +60,9 @@ typedef cyg_uint32 uint32;
#ifdef __cplusplus
extern "C" {
#endif
#if 0
} // to make below format correctly.
#endif
//-----------------------------------------------------------------------------
// Definitions for generic-stub.c
......@@ -150,6 +153,40 @@ extern unsigned long __break_opcode (void);
#ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
extern void cyg_hal_gdb_interrupt (target_register_t pc);
extern int cyg_hal_gdb_remove_break (target_register_t pc);
extern int cyg_hal_gdb_break_is_set (void);
/* This is used so that the generic stub can tell
* cyg_hal_gdb_remove_break() not to bother when we are avoiding stepping
* through a critical region ie. hal_diag_write_char() usually - that
* shares the GDB IO device.
*/
extern volatile int cyg_hal_gdb_running_step;
// Use these in hal_diag.c when about to write a whole $O packet to GDB.
// NB they require __builtin_return_address() to work: if your platform
// does not support this, use HAL_DISABLE_INTERRUPTS &c instead.
#define CYG_HAL_GDB_ENTER_CRITICAL_IO_REGION( _old_ ) \
do { \
HAL_DISABLE_INTERRUPTS(_old_); \
cyg_hal_gdb_interrupt((target_register_t)__builtin_return_address(0)); \
} while ( 0 )
#define CYG_HAL_GDB_LEAVE_CRITICAL_IO_REGION( _old_ ) \
do { \
cyg_hal_gdb_remove_break((target_register_t)__builtin_return_address(0)); \
HAL_RESTORE_INTERRUPTS(_old_); \
} while ( 0 )
#else // NO debug_gdb_break_support
// so define these just to do interrupts:
#define CYG_HAL_GDB_ENTER_CRITICAL_IO_REGION( _old_ ) \
HAL_DISABLE_INTERRUPTS(_old_)
#define CYG_HAL_GDB_LEAVE_CRITICAL_IO_REGION( _old_ ) \
HAL_RESTORE_INTERRUPTS(_old_)
#endif
//----------------------------------------------------------------------------
......
......@@ -103,7 +103,35 @@ static uint32 crc32 (unsigned char *ptr, int len, uint32 crc);
*
****************************************************************************/
#ifndef __ECOS__
#ifdef __ECOS__
// We cannot share memcpy and memset with the rest of the system since
// the user may want to step through it.
static inline void*
memcpy(void* dest, void* src, int size)
{
unsigned char* __d = (unsigned char*) dest;
unsigned char* __s = (unsigned char*) src;
while(size--)
*__d++ = *__s++;
return dest;
}
static inline void*
memset(void* s, int c, int size)
{
unsigned char* __s = (unsigned char*) s;
unsigned char __c = (unsigned char) c;
while(size--)
*__s++ = __c;
return s;
}
#else
#include <string.h>
#include <signal.h>
#endif // __ECOS__
......@@ -776,6 +804,15 @@ __handle_exception (void)
unlock_thread_scheduler ();
__clear_single_step ();
#ifdef __ECOS__
/* Need to flush the data and instruction cache here, as we may have
removed a breakpoint in __single_step - and we may be sharing
some code with the application! */
__data_cache (CACHE_FLUSH) ;
__instruction_cache (CACHE_FLUSH) ;
#endif
#ifdef SIGSYSCALL
if (sigval == SIGSYSCALL)
{
......@@ -1131,6 +1168,17 @@ __process_packet (char *packet)
return 0;
}
#ifdef __ECOS__
// CASE 102327 - watchpoints fight with output, so do not step
// through $O packet output routines.
#ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
if ( cyg_hal_gdb_break_is_set() ) {
packet[0] = 'c'; // Force it to be a "continue" instead of step.
cyg_hal_gdb_running_step = 1; // And tell the hal_stub...
}
#endif
#endif
/* Set machine state to force a single step. */
if (packet[0] == 's' || packet[0] == 'S')
{
......
......@@ -136,9 +136,14 @@ typedef struct
static instrBuffer break_buffer;
volatile int cyg_hal_gdb_running_step = 0;
void
cyg_hal_gdb_interrupt (target_register_t pc)
{
// Clear this regardless
cyg_hal_gdb_running_step = 0;
// so that a call to set a BP because of a ^C will take effect
if (NULL == break_buffer.targetAddr) {
break_buffer.targetAddr = (t_inst*) pc;
break_buffer.savedInstr = *(t_inst*)pc;
......@@ -152,6 +157,9 @@ cyg_hal_gdb_interrupt (target_register_t pc)
int
cyg_hal_gdb_remove_break (target_register_t pc)
{
if ( cyg_hal_gdb_running_step )
return 0;
if ((t_inst*)pc == break_buffer.targetAddr) {
*(t_inst*)pc = break_buffer.savedInstr;
break_buffer.targetAddr = NULL;
......@@ -163,6 +171,15 @@ cyg_hal_gdb_remove_break (target_register_t pc)
return 0;
}
int
cyg_hal_gdb_break_is_set (void)
{
if (NULL != break_buffer.targetAddr) {
return 1;
}
return 0;
}
#endif // CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
......@@ -222,6 +239,14 @@ handle_exception_cleanup( void )
#endif
#ifdef CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT
// If we continued instead of stepping, when there was a break set
// ie. we were stepping within a critical region, clear the break, and
// that flag. If we stopped for some other reason, this has no effect.
if ( cyg_hal_gdb_running_step ) {
cyg_hal_gdb_running_step = 0;
cyg_hal_gdb_remove_break(get_register (PC));
}
// FIXME: (there may be a better way to do this)
// If we hit a breakpoint set by the gdb interrupt stub, make it
// seem like an interrupt rather than having hit a breakpoint.
......
1999-10-25 Jonathan Larmour <jlarmour@cygnus.co.uk>
* src/i386.ld: Add asterisks to input section names to make them more
tolerant of subtle differences
1999-10-05 Jesper Skov <jskov@cygnus.co.uk>
From Andrew Lunn (lunn@ma.tech.ascom.ch)
* include/hal_arch.h (HAL_IDLE_THREAD_ACTION): Defined.
......
......@@ -115,7 +115,7 @@ GROUP(libtarget.a libgcc.a)
/* We want the small data sections together, so single-instruction */ \
/* offsets can access them all, and initialized data all before */ \
/* uninitialized, so we can shorten the on-disk segment size. */ \
_SDATA_START_ = ABSOLUTE(.); *(.sdata) } \
_SDATA_START_ = ABSOLUTE(.); *(.sdata*) } \
> _region_ \
__rom_data_start = LOADADDR(.data); \
__ram_data_end = .; PROVIDE(__ram_data_end = .); \
......@@ -124,13 +124,13 @@ GROUP(libtarget.a libgcc.a)
#define SECTION_sbss(_region_, _vma_, _lma_) \
.sbss _vma_ : _lma_ \
{ __bss_start = ABSOLUTE (.); \
_SBSS_START_ = ABSOLUTE(.); *(.sbss) _SBSS_END_ = ABSOLUTE(.); \
*(.scommon) } \
_SBSS_START_ = ABSOLUTE(.); *(.sbss*) _SBSS_END_ = ABSOLUTE(.); \
*(.scommon*) } \
> _region_
#define SECTION_bss(_region_, _vma_, _lma_) \
.bss _vma_ : _lma_ \
{ FORCE_OUTPUT; *(.dynbss) *(.bss) *(COMMON) } \
{ FORCE_OUTPUT; *(.dynbss*) *(.bss*) *(COMMON) } \
> _region_
#define SECTIONS_END . = ALIGN(4); _end = .; PROVIDE (end = .);
......
1999-10-22 Nick Garnett <nickg@cygnus.co.uk>
* src/vectors.S: Replaced ifdef with call to hal_intc_translate
macro so the behaviour here may be customized by variant or
platform HALs.
* include/arch.inc: Added default implementations of
hal_intc_translate macro.
1999-10-05 Nick Garnett <nickg@cygnus.co.uk>
* include/basetype.h: Made definition of CYG_BYTEORDER dependent
......
......@@ -295,6 +295,18 @@
lb \vnum,0(v0) # pick up vector number
.endm
#ifndef CYGPKG_HAL_MIPS_INTC_TRANSLATE_DEFINED
#ifdef CYGIMP_HAL_COMMON_INTERRUPTS_CHAIN
.macro hal_intc_translate inum,vnum
move \vnum,zero # Just vector zero is supported
.endm
#else
.macro hal_intc_translate inum,vnum
move \vnum,\inum # Vector == interrupt number
.endm
#endif
#endif
.macro hal_intc_decode_data
hal_intc_translation_table:
.byte 0, 0, 1, 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment