#! /bin/sh
|
#! /bin/sh
|
#
|
#
|
# Shell script to ease invocation of the powerpc simulator
|
# Shell script to ease invocation of the powerpc simulator
|
#
|
#
|
# COPYRIGHT (c) 1989-1999.
|
# COPYRIGHT (c) 1989-1999.
|
# On-Line Applications Research Corporation (OAR).
|
# On-Line Applications Research Corporation (OAR).
|
#
|
#
|
# The license and distribution terms for this file may be
|
# The license and distribution terms for this file may be
|
# found in found in the file LICENSE in this distribution or at
|
# found in found in the file LICENSE in this distribution or at
|
# http://www.OARcorp.com/rtems/license.html.
|
# http://www.OARcorp.com/rtems/license.html.
|
#
|
#
|
# $Id: psim,v 1.2 2001-09-27 12:01:02 chris Exp $
|
# $Id: psim,v 1.2 2001-09-27 12:01:02 chris Exp $
|
#
|
#
|
|
|
TREE_FILE=psim_tree.${LOGNAME}
|
TREE_FILE=psim_tree.${LOGNAME}
|
GDB_FILE=gdb_tree.${LOGNAME}
|
GDB_FILE=gdb_tree.${LOGNAME}
|
|
|
# GDB_DEBUG="-t sem-device"
|
# GDB_DEBUG="-t sem-device"
|
# RUN_DEBUG="-t sem_device"
|
# RUN_DEBUG="-t sem_device"
|
|
|
# Build this user's device tree file
|
# Build this user's device tree file
|
echo "/#address-cells 2" > ${TREE_FILE}
|
echo "/#address-cells 2" > ${TREE_FILE}
|
#echo "/openprom/options/oea-memory-size 4194304" >> ${TREE_FILE}
|
#echo "/openprom/options/oea-memory-size 4194304" >> ${TREE_FILE}
|
echo "/openprom/options/oea-memory-size 8388608" >> ${TREE_FILE}
|
echo "/openprom/options/oea-memory-size 8388608" >> ${TREE_FILE}
|
# These require the semaphore and shared memory device models.
|
# These require the semaphore and shared memory device models.
|
# echo "/shm@0xc0000000/reg 0xc0000000 0x10000" >> ${TREE_FILE}
|
# echo "/shm@0xc0000000/reg 0xc0000000 0x10000" >> ${TREE_FILE}
|
# echo "/shm@0xc0000000/key ${RTEMS_SHM_KEY}" >> ${TREE_FILE}
|
# echo "/shm@0xc0000000/key ${RTEMS_SHM_KEY}" >> ${TREE_FILE}
|
# echo "/sem@0xc0010000/reg 0xc0010000 12" >> ${TREE_FILE}
|
# echo "/sem@0xc0010000/reg 0xc0010000 12" >> ${TREE_FILE}
|
# echo "/sem@0xc0010000/key ${RTEMS_SHM_SEMAPHORE_KEY}" >> ${TREE_FILE}
|
# echo "/sem@0xc0010000/key ${RTEMS_SHM_SEMAPHORE_KEY}" >> ${TREE_FILE}
|
# echo "/sem@0xc0010000/value -1" >> ${TREE_FILE}
|
# echo "/sem@0xc0010000/value -1" >> ${TREE_FILE}
|
#
|
#
|
# Build this user's gdb script
|
# Build this user's gdb script
|
echo "tar sim -f ${TREE_FILE} ${GDB_DEBUG}" > ${GDB_FILE}
|
echo "tar sim -f ${TREE_FILE} ${GDB_DEBUG}" > ${GDB_FILE}
|
echo "load" >> ${GDB_FILE}
|
echo "load" >> ${GDB_FILE}
|
echo "b _Internal_error_Occurred" >> ${GDB_FILE}
|
echo "b _Internal_error_Occurred" >> ${GDB_FILE}
|
echo "b rtems_fatal_error_occurred" >> ${GDB_FILE}
|
echo "b rtems_fatal_error_occurred" >> ${GDB_FILE}
|
echo "b __assert" >> ${GDB_FILE}
|
echo "b __assert" >> ${GDB_FILE}
|
|
|
RUN=powerpc-rtems-run
|
RUN=powerpc-rtems-run
|
GDB=powerpc-rtems-gdb
|
GDB=powerpc-rtems-gdb
|
|
|
case $0 in
|
case $0 in
|
*gdb*)
|
*gdb*)
|
${GDB} -x ${GDB_FILE} $*
|
${GDB} -x ${GDB_FILE} $*
|
;;
|
;;
|
*)
|
*)
|
# ${RUN} -f ${TREE_FILE} $*
|
# ${RUN} -f ${TREE_FILE} $*
|
${RUN} -f ${TREE_FILE} ${RUN_DEBUG} $*
|
${RUN} -f ${TREE_FILE} ${RUN_DEBUG} $*
|
;;
|
;;
|
esac
|
esac
|
exit $?
|
exit $?
|
|
|
|
|