This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
support return to redboot from go
- From: Mark Salter <msalter at redhat dot com>
- To: ecos-patches at sources dot redhat dot com
- Date: Fri, 31 Jan 2003 11:46:16 -0500 (EST)
- Subject: support return to redboot from go
Index: hal/arm/arch/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/arch/current/ChangeLog,v
retrieving revision 1.80
diff -u -p -5 -r1.80 ChangeLog
--- hal/arm/arch/current/ChangeLog 17 Jan 2003 16:49:11 -0000 1.80
+++ hal/arm/arch/current/ChangeLog 31 Jan 2003 16:38:46 -0000
@@ -1,5 +1,10 @@
+2003-01-31 Mark Salter <msalter@redhat.com>
+
+ * src/hal_syscall.c (hal_syscall_handler): Let generic syscall code
+ handle exit.
+
2003-01-17 Patrick Doyle <wpd@delcomsys.com>
* src/redboot_linux_exec.c (do_exec): Round the length up to a
multiple of 4 so that the copy loop (which decrements the count by
4 each time through) runs a finite length of time.
Index: hal/arm/arch/current/src/hal_syscall.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/arch/current/src/hal_syscall.c,v
retrieving revision 1.3
diff -u -p -5 -r1.3 hal_syscall.c
--- hal/arm/arch/current/src/hal_syscall.c 23 May 2002 23:01:42 -0000 1.3
+++ hal/arm/arch/current/src/hal_syscall.c 31 Jan 2003 16:38:46 -0000
@@ -104,16 +104,10 @@ hal_syscall_handler(void)
if ((get_register(PS) & CPSR_MODE_BITS) == CPSR_SUPERVISOR_MODE)
put_register(PC, get_register(IP));
else
put_register(PC, get_register(LR));
- if (func == SYS_exit) {
- // We want to stop in exit so that the user may poke around
- // to see why his app exited.
- return SIGTRAP;
- }
-
if (func == SYS_interrupt) {
// A console interrupt landed us here.
// Invoke the debug agent so as to cause a SIGINT.
return SIGINT;
}
Index: hal/calmrisc16/arch/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/calmrisc16/arch/current/ChangeLog,v
retrieving revision 1.2
diff -u -p -5 -r1.2 ChangeLog
--- hal/calmrisc16/arch/current/ChangeLog 23 May 2002 23:02:34 -0000 1.2
+++ hal/calmrisc16/arch/current/ChangeLog 31 Jan 2003 16:38:48 -0000
@@ -1,5 +1,10 @@
+2003-01-31 Mark Salter <msalter@redhat.com>
+
+ * src/hal_syscall.c (hal_syscall_handler): Let generic syscall code
+ handle exit.
+
2002-04-15 Jonathan Larmour <jlarmour@redhat.com>
* src/hal_syscall.c (hal_syscall_handler): Add extra sig argument to
__do_syscall.
@@ -23,11 +28,11 @@
//===========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
//
// eCos 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.
//
Index: hal/calmrisc16/arch/current/src/hal_syscall.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/calmrisc16/arch/current/src/hal_syscall.c,v
retrieving revision 1.2
diff -u -p -5 -r1.2 hal_syscall.c
--- hal/calmrisc16/arch/current/src/hal_syscall.c 23 May 2002 23:02:36 -0000 1.2
+++ hal/calmrisc16/arch/current/src/hal_syscall.c 31 Jan 2003 16:38:48 -0000
@@ -6,11 +6,11 @@
//
//=============================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
//
// eCos 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.
//
@@ -115,16 +115,10 @@ hal_syscall_handler(void)
func = get_register(REG_R0) >> 16;
arg1 = get_register(REG_A8);
arg2 = get_register(REG_A9);
arg3 = get_register(REG_A10);
arg4 = get_register(REG_A11);
-
- if (func == SYS_exit) {
- // We want to stop in exit so that the user may poke around
- // to see why his app exited.
- return SIGTRAP;
- }
if (func == SYS_interrupt) {
// A console interrupt landed us here.
// Invoke the debug agent so as to cause a SIGINT.
return SIGINT;
Index: hal/calmrisc32/arch/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/calmrisc32/arch/current/ChangeLog,v
retrieving revision 1.2
diff -u -p -5 -r1.2 ChangeLog
--- hal/calmrisc32/arch/current/ChangeLog 23 May 2002 23:02:40 -0000 1.2
+++ hal/calmrisc32/arch/current/ChangeLog 31 Jan 2003 16:38:48 -0000
@@ -1,5 +1,10 @@
+2003-01-31 Mark Salter <msalter@redhat.com>
+
+ * src/hal_syscall.c (hal_syscall_handler): Let generic syscall code
+ handle exit.
+
2002-04-15 Jonathan Larmour <jlarmour@redhat.com>
* src/hal_syscall.c (hal_syscall_handler): Add extra sig argument to
__do_syscall.
@@ -22,11 +27,11 @@
//===========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
//
// eCos 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.
//
Index: hal/calmrisc32/arch/current/src/hal_syscall.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/calmrisc32/arch/current/src/hal_syscall.c,v
retrieving revision 1.2
diff -u -p -5 -r1.2 hal_syscall.c
--- hal/calmrisc32/arch/current/src/hal_syscall.c 23 May 2002 23:02:41 -0000 1.2
+++ hal/calmrisc32/arch/current/src/hal_syscall.c 31 Jan 2003 16:38:48 -0000
@@ -6,11 +6,11 @@
//
//=============================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
//
// eCos 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.
//
@@ -100,16 +100,10 @@ hal_syscall_handler(void)
arg3 = get_register(REG_B1R3);
retreg = REG_B1R0;
}
set_pc(get_pc()+2);
-
- if (func == SYS_exit) {
- // We want to stop in exit so that the user may poke around
- // to see why his app exited.
- return SIGTRAP;
- }
if (func == SYS_interrupt) {
// A console interrupt landed us here.
// Invoke the debug agent so as to cause a SIGINT.
return SIGINT;
Index: hal/common/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/common/current/ChangeLog,v
retrieving revision 1.83
diff -u -p -5 -r1.83 ChangeLog
--- hal/common/current/ChangeLog 4 Dec 2002 14:29:12 -0000 1.83
+++ hal/common/current/ChangeLog 31 Jan 2003 16:38:50 -0000
@@ -1,5 +1,9 @@
+2003-01-31 Mark Salter <msalter@redhat.com>
+
+ * include/hal_if.h: Add CYGNUM_CALL_IF_MONITOR_RETURN.
+
2002-12-04 Gary Thomas <gthomas@ecoscentric.com>
* cdl/hal.cdl: RAM applications should not claim (reset) version
string by default.
Index: hal/common/current/include/hal_if.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/common/current/include/hal_if.h,v
retrieving revision 1.18
diff -u -p -5 -r1.18 hal_if.h
--- hal/common/current/include/hal_if.h 3 Dec 2002 19:48:22 -0000 1.18
+++ hal/common/current/include/hal_if.h 31 Jan 2003 16:38:50 -0000
@@ -9,11 +9,11 @@
//
//=============================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
// Copyright (C) 2002 Gary Thomas
//
// eCos 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.
@@ -363,12 +363,13 @@ __call_COMM1(IF_GETC_TIMEOUT, cyg_bool,
#define CYGNUM_CALL_IF_RESET 16
#define CYGNUM_CALL_IF_CONSOLE_INTERRUPT_FLAG 17
#define CYGNUM_CALL_IF_DELAY_US 18
#define CYGNUM_CALL_IF_DBG_DATA 19
#define CYGNUM_CALL_IF_FLASH_CFG_OP 20
+#define CYGNUM_CALL_IF_MONITOR_RETURN 21
-#define CYGNUM_CALL_IF_LAST_ENTRY CYGNUM_CALL_IF_FLASH_CFG_OP
+#define CYGNUM_CALL_IF_LAST_ENTRY CYGNUM_CALL_IF_MONITOR_RETURN
#define CYGNUM_CALL_IF_INSTALL_BPT_FN 35
#define CYGNUM_CALL_IF_TABLE_SIZE 64
@@ -422,10 +423,11 @@ typedef int __call_if_console_interrupt_
typedef void (__call_if_delay_us_t)(cyg_int32 usecs);
typedef void (__call_if_install_bpt_fn_t)(void *__epc);
typedef cyg_bool (__call_if_flash_cfg_op_fn_t)(int __oper, char *__key,
void *__val, int __type);
typedef char *__call_if_monitor_version_t;
+typedef void (__call_if_monitor_return_t)(int status);
#ifndef CYGACC_CALL_IF_DEFINED
#define __data_VV(_n_,_tt_) \
static __inline__ _tt_ \
@@ -616,10 +618,16 @@ __call_voidVV1(CYGNUM_CALL_IF_INSTALL_BP
CYGACC_CALL_VV4(__call_if_flash_cfg_op_fn_t*, CYGNUM_CALL_IF_FLASH_CFG_OP, (_o_),(_k_),(_d_),(_t_))
__call_VV4(CYGNUM_CALL_IF_FLASH_CFG_OP, __call_if_flash_cfg_op_fn_t, cyg_bool, int, char *, void *, int)
#define CYGACC_CALL_IF_FLASH_CFG_OP_SET(_x_) \
hal_virtual_vector_table[CYGNUM_CALL_IF_FLASH_CFG_OP]=(CYG_ADDRWORD)(_x_)
#define CYGNUM_CALL_IF_FLASH_CFG_GET (0)
+
+#define CYGACC_CALL_IF_MONITOR_RETURN(_u_) \
+ CYGACC_CALL_VV1(__call_if_monitor_return_t*, CYGNUM_CALL_IF_MONITOR_RETURN, (_u_))
+__call_voidVV1(CYGNUM_CALL_IF_MONITOR_RETURN, __call_if_monitor_return_t, void, int)
+#define CYGACC_CALL_IF_MONITOR_RETURN_SET(_x_) \
+ hal_virtual_vector_table[CYGNUM_CALL_IF_MONITOR_RETURN]=(CYG_ADDRWORD)(_x_)
// These need to be kept uptodate with the (unadorned) masters
// in RedBoot's flash_config.h:
#define CYGNUM_FLASH_CFG_OP_CONFIG_EMPTY 0
#define CYGNUM_FLASH_CFG_OP_CONFIG_BOOL 1
Index: hal/frv/arch/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/frv/arch/current/ChangeLog,v
retrieving revision 1.2
diff -u -p -5 -r1.2 ChangeLog
--- hal/frv/arch/current/ChangeLog 23 May 2002 23:02:50 -0000 1.2
+++ hal/frv/arch/current/ChangeLog 31 Jan 2003 16:38:51 -0000
@@ -1,5 +1,10 @@
+2003-01-31 Mark Salter <msalter@redhat.com>
+
+ * src/hal_syscall.c (hal_syscall_handler): Let generic syscall code
+ handle exit.
+
2002-04-15 Jonathan Larmour <jlarmour@redhat.com>
* src/hal_syscall.c (hal_syscall_handler): Add extra sig argument to
__do_syscall.
Index: hal/frv/arch/current/src/hal_syscall.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/frv/arch/current/src/hal_syscall.c,v
retrieving revision 1.2
diff -u -p -5 -r1.2 hal_syscall.c
--- hal/frv/arch/current/src/hal_syscall.c 23 May 2002 23:02:53 -0000 1.2
+++ hal/frv/arch/current/src/hal_syscall.c 31 Jan 2003 16:38:51 -0000
@@ -6,11 +6,11 @@
//
//=============================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
//
// eCos 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.
//
@@ -86,16 +86,10 @@ hal_syscall_handler(void)
func = get_register(R7);
arg1 = get_register(R8);
arg2 = get_register(R9);
arg3 = get_register(R10);
arg4 = get_register(R11);
-
- if (func == SYS_exit) {
- // We want to stop in exit so that the user may poke around
- // to see why his app exited.
- return SIGTRAP;
- }
if (func == SYS_interrupt) {
// A console interrupt landed us here.
// Invoke the debug agent so as to cause a SIGINT.
return SIGINT;
Index: hal/h8300/arch/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/h8300/arch/current/ChangeLog,v
retrieving revision 1.2
diff -u -p -5 -r1.2 ChangeLog
--- hal/h8300/arch/current/ChangeLog 23 May 2002 23:02:56 -0000 1.2
+++ hal/h8300/arch/current/ChangeLog 31 Jan 2003 16:38:51 -0000
@@ -1,5 +1,10 @@
+2003-01-31 Mark Salter <msalter@redhat.com>
+
+ * src/hal_syscall.c (hal_syscall_handler): Let generic syscall code
+ handle exit.
+
2002-04-29 Jonathan Larmour <jlarmour@redhat.com>
* src/vectors.S:
Don't use .file as it can confuse debugging since the .file
doesn't contain the path and therefore the debugger will never
@@ -11,11 +16,11 @@
//===========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
//
// eCos 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.
//
Index: hal/h8300/arch/current/src/hal_syscall.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/h8300/arch/current/src/hal_syscall.c,v
retrieving revision 1.2
diff -u -p -5 -r1.2 hal_syscall.c
--- hal/h8300/arch/current/src/hal_syscall.c 23 May 2002 23:02:58 -0000 1.2
+++ hal/h8300/arch/current/src/hal_syscall.c 31 Jan 2003 16:38:51 -0000
@@ -6,11 +6,11 @@
//
//=============================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
//
// eCos 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.
//
@@ -86,16 +86,10 @@ hal_syscall_handler(void)
arg1 = get_register(ER1);
arg2 = get_register(ER2);
arg3 = get_register(ER3);
arg4 = 0;
- if (func == SYS_exit) {
- // We want to stop in exit so that the user may poke around
- // to see why his app exited.
- return SIGTRAP;
- }
-
if (func == SYS_interrupt) {
// A console interrupt landed us here.
// Invoke the debug agent so as to cause a SIGINT.
return SIGINT;
}
Index: hal/i386/arch/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/i386/arch/current/ChangeLog,v
retrieving revision 1.36
diff -u -p -5 -r1.36 ChangeLog
--- hal/i386/arch/current/ChangeLog 1 Dec 2002 15:50:14 -0000 1.36
+++ hal/i386/arch/current/ChangeLog 31 Jan 2003 16:38:52 -0000
@@ -1,5 +1,10 @@
+2003-01-31 Mark Salter <msalter@redhat.com>
+
+ * src/hal_syscall.c (hal_syscall_handler): Let generic syscall code
+ handle exit.
+
2002-11-28 Nick Garnett <nickg@ecoscentric.com>
* src/vectors.S: Added GRUB startup option to tests for IDT
initialization. Added call to breakpoint() before cyg_start(),
controlled by CYGDBG_HAL_DEBUG_GDB_INITIAL_BREAK.
Index: hal/i386/arch/current/src/hal_syscall.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/i386/arch/current/src/hal_syscall.c,v
retrieving revision 1.3
diff -u -p -5 -r1.3 hal_syscall.c
--- hal/i386/arch/current/src/hal_syscall.c 23 May 2002 23:03:07 -0000 1.3
+++ hal/i386/arch/current/src/hal_syscall.c 31 Jan 2003 16:38:52 -0000
@@ -143,16 +143,10 @@ hal_syscall_handler(void)
default:
return SIGTRAP;
}
- if (func == SYS_exit) {
- // We want to stop in exit so that the user may poke around
- // to see why his app exited.
- return SIGTRAP;
- }
-
if (__do_syscall(func, arg1, arg2, arg3, arg4, &err, &sig)) {
put_register(EAX, err);
return (int)sig;
}
Index: hal/mips/arch/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mips/arch/current/ChangeLog,v
retrieving revision 1.66
diff -u -p -5 -r1.66 ChangeLog
--- hal/mips/arch/current/ChangeLog 9 Jan 2003 06:34:12 -0000 1.66
+++ hal/mips/arch/current/ChangeLog 31 Jan 2003 16:38:54 -0000
@@ -1,5 +1,10 @@
+2003-01-31 Mark Salter <msalter@redhat.com>
+
+ * src/hal_syscall.c (hal_syscall_handler): Let generic syscall code
+ handle exit.
+
2003-01-09 Tim Michals <t.michals@attbi.com>
* src/hal_misc.c (hal_delay_us): Use HAL_CLOCK_READ instead of inline
asm, to allow for variant/platform HAL packages overriding.
Index: hal/mips/arch/current/src/hal_syscall.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mips/arch/current/src/hal_syscall.c,v
retrieving revision 1.3
diff -u -p -5 -r1.3 hal_syscall.c
--- hal/mips/arch/current/src/hal_syscall.c 23 May 2002 23:03:23 -0000 1.3
+++ hal/mips/arch/current/src/hal_syscall.c 31 Jan 2003 16:38:54 -0000
@@ -6,11 +6,11 @@
//
//=============================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
//
// eCos 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.
//
@@ -88,16 +88,10 @@ hal_syscall_handler(void)
arg2 = get_register(REG_A2);
arg3 = get_register(REG_A3);
arg4 = 0;
put_register(REG_PC, get_register(REG_PC)+4);
-
- if (func == SYS_exit) {
- // We want to stop in exit so that the user may poke around
- // to see why his app exited.
- return SIGTRAP;
- }
if (func == SYS_interrupt) {
// A console interrupt landed us here.
// Invoke the debug agent so as to cause a SIGINT.
return SIGINT;
Index: hal/mn10300/arch/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mn10300/arch/current/ChangeLog,v
retrieving revision 1.26
diff -u -p -5 -r1.26 ChangeLog
--- hal/mn10300/arch/current/ChangeLog 6 Dec 2002 18:25:56 -0000 1.26
+++ hal/mn10300/arch/current/ChangeLog 31 Jan 2003 16:38:56 -0000
@@ -1,5 +1,10 @@
+2003-01-31 Mark Salter <msalter@redhat.com>
+
+ * src/hal_syscall.c (hal_syscall_handler): Let generic syscall code
+ handle exit.
+
2002-12-06 Mark Salter <msalter@redhat.com>
* cdl/hal_mn10300.cdl: Add CYGINT_HAL_MN10300_MEM_REAL_REGION_TOP.
* include/hal_intr.h: Support CYGINT_HAL_MN10300_MEM_REAL_REGION_TOP.
Index: hal/mn10300/arch/current/src/hal_syscall.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/mn10300/arch/current/src/hal_syscall.c,v
retrieving revision 1.3
diff -u -p -5 -r1.3 hal_syscall.c
--- hal/mn10300/arch/current/src/hal_syscall.c 23 May 2002 23:04:02 -0000 1.3
+++ hal/mn10300/arch/current/src/hal_syscall.c 31 Jan 2003 16:38:56 -0000
@@ -6,11 +6,11 @@
//
//=============================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
//
// eCos 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.
//
@@ -87,16 +87,10 @@ hal_syscall_handler(void)
arg1 = get_register(D1);
arg2 = get_register(D2);
arg3 = get_register(D3);
arg4 = 0;
- if (func == SYS_exit) {
- // We want to stop in exit so that the user may poke around
- // to see why his app exited.
- return SIGTRAP;
- }
-
if (func == SYS_interrupt) {
// A console interrupt landed us here.
// Invoke the debug agent so as to cause a SIGINT.
return SIGINT;
}
Index: hal/sh/arch/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/sh/arch/current/ChangeLog,v
retrieving revision 1.40
diff -u -p -5 -r1.40 ChangeLog
--- hal/sh/arch/current/ChangeLog 6 Aug 2002 14:34:07 -0000 1.40
+++ hal/sh/arch/current/ChangeLog 31 Jan 2003 16:39:07 -0000
@@ -1,5 +1,10 @@
+2003-01-31 Mark Salter <msalter@redhat.com>
+
+ * src/hal_syscall.c (hal_syscall_handler): Let generic syscall code
+ handle exit.
+
2002-08-02 Andrew Lunn <Andrew.Lunn@ascom.ch>
* cdl/hal_sh.cdl: The Redboot exec command can now be
disabled by CDL
Index: hal/sh/arch/current/src/hal_syscall.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/sh/arch/current/src/hal_syscall.c,v
retrieving revision 1.2
diff -u -p -5 -r1.2 hal_syscall.c
--- hal/sh/arch/current/src/hal_syscall.c 23 May 2002 23:04:39 -0000 1.2
+++ hal/sh/arch/current/src/hal_syscall.c 31 Jan 2003 16:39:07 -0000
@@ -6,11 +6,11 @@
//
//=============================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
//
// eCos 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.
//
@@ -130,16 +130,10 @@ hal_syscall_handler(void)
func = SYS_lseek;
break;
case _shnewlib_SYS_utime:
func = SYS_utime;
default:
- return SIGTRAP;
- }
-
- if (func == SYS_exit) {
- // We want to stop in exit so that the user may poke around
- // to see why his app exited.
return SIGTRAP;
}
if (func == SYS_interrupt) {
// A console interrupt landed us here.
Index: redboot/current/src/main.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/src/main.c,v
retrieving revision 1.37
diff -u -p -5 -r1.37 main.c
--- redboot/current/src/main.c 3 Dec 2002 19:48:31 -0000 1.37
+++ redboot/current/src/main.c 31 Jan 2003 16:39:10 -0000
@@ -6,11 +6,11 @@
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
// Copyright (C) 2002 Gary Thomas
//
// eCos 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.
@@ -74,10 +74,14 @@ extern void breakpoint(void);
#endif
// Builtin Self Test (BIST)
externC void bist(void);
+// Return path for code run from a go command
+static void return_to_redboot(int status);
+
+
// CLI command processing (defined in this file)
RedBoot_cmd("version",
"Display RedBoot version information",
"",
do_version
@@ -183,10 +187,12 @@ cyg_start(void)
extern char RedBoot_version[];
// Export version information
CYGACC_CALL_IF_MONITOR_VERSION_SET(RedBoot_version);
+ CYGACC_CALL_IF_MONITOR_RETURN_SET(return_to_redboot);
+
// Make sure the channels are properly initialized.
diag_init_putc(_mon_write_char);
hal_if_diag_init();
// Force console to output raw text - but remember the old setting
@@ -376,27 +382,57 @@ do_help(int argc, char *argv[])
cmd = __RedBoot_CMD_TAB__;
show_help(cmd, &__RedBoot_CMD_TAB_END__, which, "");
return;
}
+static void * go_saved_context;
+static int go_return_status;
+
+static void
+go_trampoline(unsigned long entry)
+{
+ typedef void code_fun(void);
+ code_fun *fun = (code_fun *)entry;
+ unsigned long oldints;
+
+ HAL_DISABLE_INTERRUPTS(oldints);
+
+#ifdef HAL_ARCH_PROGRAM_NEW_STACK
+ HAL_ARCH_PROGRAM_NEW_STACK(fun);
+#else
+ (*fun)();
+#endif
+}
+
+static void
+return_to_redboot(int status)
+{
+ CYGARC_HAL_SAVE_GP();
+
+ go_return_status = status;
+ HAL_THREAD_LOAD_CONTEXT(&go_saved_context);
+ // never returns
+}
+
void
do_go(int argc, char *argv[])
{
- typedef void code_fun(void);
unsigned long entry;
unsigned long oldints;
- code_fun *fun;
bool wait_time_set;
int wait_time, res;
- struct option_info opts[1];
+ bool cache_enabled = false;
+ struct option_info opts[2];
char line[8];
hal_virtual_comm_table_t *__chan = CYGACC_CALL_IF_CONSOLE_PROCS();
entry = entry_address; // Default from last 'load' operation
init_opts(&opts[0], 'w', true, OPTION_ARG_TYPE_NUM,
(void **)&wait_time, (bool *)&wait_time_set, "wait timeout");
- if (!scan_opts(argc, argv, 1, opts, 1, (void *)&entry, OPTION_ARG_TYPE_NUM, "starting address"))
+ init_opts(&opts[1], 'c', false, OPTION_ARG_TYPE_FLG,
+ (void **)&cache_enabled, (bool *)0, "go with caches enabled");
+ if (!scan_opts(argc, argv, 1, opts, 2, (void *)&entry, OPTION_ARG_TYPE_NUM, "starting address"))
{
return;
}
if (wait_time_set) {
int script_timeout_ms = wait_time * 1000;
@@ -417,23 +453,39 @@ do_go(int argc, char *argv[])
script_timeout_ms -= CYGNUM_REDBOOT_CLI_IDLE_TIMEOUT;
}
}
CYGACC_COMM_IF_CONTROL(*__chan, __COMMCTL_ENABLE_LINE_FLUSH);
- fun = (code_fun *)entry;
HAL_DISABLE_INTERRUPTS(oldints);
HAL_DCACHE_SYNC();
- HAL_ICACHE_DISABLE();
- HAL_DCACHE_DISABLE();
- HAL_DCACHE_SYNC();
+ if (!cache_enabled) {
+ HAL_ICACHE_DISABLE();
+ HAL_DCACHE_DISABLE();
+ HAL_DCACHE_SYNC();
+ }
HAL_ICACHE_INVALIDATE_ALL();
HAL_DCACHE_INVALIDATE_ALL();
-#ifdef HAL_ARCH_PROGRAM_NEW_STACK
- HAL_ARCH_PROGRAM_NEW_STACK(fun);
-#else
- (*fun)();
-#endif
+
+ // set up a temporary context that will take us to the trampoline
+ HAL_THREAD_INIT_CONTEXT((CYG_ADDRESS)workspace_end, entry, go_trampoline, 0);
+
+ // switch context to trampoline
+ HAL_THREAD_SWITCH_CONTEXT(&go_saved_context, &workspace_end);
+
+ // we get back here by way of return_to_redboot()
+
+ // undo the changes we made before switching context
+ if (!cache_enabled) {
+ HAL_ICACHE_ENABLE();
+ HAL_DCACHE_ENABLE();
+ }
+
+ CYGACC_COMM_IF_CONTROL(*__chan, __COMMCTL_DISABLE_LINE_FLUSH);
+
+ HAL_RESTORE_INTERRUPTS(oldints);
+
+ diag_printf("\nProgram completed with status %d\n", go_return_status);
}
#ifdef HAL_PLATFORM_RESET
void
do_reset(int argc, char *argv[])
Index: redboot/current/src/syscall.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/src/syscall.c,v
retrieving revision 1.8
diff -u -p -5 -r1.8 syscall.c
--- redboot/current/src/syscall.c 27 Aug 2002 01:39:32 -0000 1.8
+++ redboot/current/src/syscall.c 31 Jan 2003 16:39:11 -0000
@@ -6,11 +6,11 @@
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
//
// eCos 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.
//
@@ -50,10 +50,11 @@
//=========================================================================*/
#include <redboot.h>
#include <cyg/hal/hal_intr.h>
#include <cyg/hal/drv_api.h>
+#include <cyg/hal/hal_stub.h>
#ifdef CYGSEM_REDBOOT_BSP_SYSCALLS
#define NEWLIB_EIO 5 /* I/O error */
#define NEWLIB_ENOSYS 88 /* Syscall not supported */
@@ -221,11 +222,11 @@ sys_timer_isr(cyg_vector_t vector, cyg_a
CYGARC_HAL_SAVE_GP();
timer_callback( intrpc, intrsp );
CYGARC_HAL_RESTORE_GP();
}
#endif // CYGSEM_REDBOOT_BSP_SYSCALLS_GPROF
- return 0;
+ return CYG_ISR_HANDLED;
}
static void sys_timer_init(void)
{
@@ -626,10 +627,20 @@ __do_syscall(CYG_ADDRWORD func,
#endif // CYGSEM_REDBOOT_BSP_SYSCALLS_GPROF
case __GET_SHARED:
*(__shared_t **)arg1 = &__shared_data;
break;
+
+ case SYS_exit:
+ if (gdb_active) {
+ *sig = SIGTRAP;
+ err = func;
+ } else {
+ CYGACC_CALL_IF_MONITOR_RETURN(arg1);
+ // never returns
+ }
+ break;
default:
return 0;
}