2002-12-12 Ralf Corsepius <corsepius@faw.uni-ulm.de>

* .cvsignore: Moved to rtems/cpukit/libmisc.
	* ChangeLog: Moved to rtems/cpukit/libmisc.
	* Makefile.am: Moved to rtems/cpukit/libmisc.
	* README: Moved to rtems/cpukit/libmisc.
	* configure.ac: Moved to rtems/cpukit/libmisc.
	* capture/Makefile.am: Moved to rtems/cpukit/libmisc.
	* capture/README: Moved to rtems/cpukit/libmisc.
	* capture/capture-cli.c: Moved to rtems/cpukit/libmisc.
	* capture/capture-cli.h: Moved to rtems/cpukit/libmisc.
	* capture/capture.c: Moved to rtems/cpukit/libmisc.
	* capture/capture.h: Moved to rtems/cpukit/libmisc.
	* cpuuse/Makefile.am: Moved to rtems/cpukit/libmisc.
	* cpuuse/README: Moved to rtems/cpukit/libmisc.
	* cpuuse/cpuuse.c: Moved to rtems/cpukit/libmisc.
	* cpuuse/cpuuse.h: Moved to rtems/cpukit/libmisc.
	* devnull/.cvsignore: Moved to rtems/cpukit/libmisc.
	* devnull/Makefile.am: Moved to rtems/cpukit/libmisc.
	* devnull/devnull.c: Moved to rtems/cpukit/libmisc.
	* devnull/devnull.h: Moved to rtems/cpukit/libmisc.
	* dummy/.cvsignore: Moved to rtems/cpukit/libmisc.
	* dummy/Makefile.am: Moved to rtems/cpukit/libmisc.
	* dummy/README: Moved to rtems/cpukit/libmisc.
	* dummy/dummy.c: Moved to rtems/cpukit/libmisc.
	* dumpbuf/.cvsignore: Moved to rtems/cpukit/libmisc.
	* dumpbuf/Makefile.am: Moved to rtems/cpukit/libmisc.
	* dumpbuf/dumpbuf.c: Moved to rtems/cpukit/libmisc.
	* dumpbuf/dumpbuf.h: Moved to rtems/cpukit/libmisc.
	* monitor/.cvsignore: Moved to rtems/cpukit/libmisc.
	* monitor/Makefile.am: Moved to rtems/cpukit/libmisc.
	* monitor/README: Moved to rtems/cpukit/libmisc.
	* monitor/mon-command.c: Moved to rtems/cpukit/libmisc.
	* monitor/mon-config.c: Moved to rtems/cpukit/libmisc.
	* monitor/mon-dname.c: Moved to rtems/cpukit/libmisc.
	* monitor/mon-driver.c: Moved to rtems/cpukit/libmisc.
	* monitor/mon-extension.c: Moved to rtems/cpukit/libmisc.
	* monitor/mon-itask.c: Moved to rtems/cpukit/libmisc.
	* monitor/mon-manager.c: Moved to rtems/cpukit/libmisc.
	* monitor/mon-monitor.c: Moved to rtems/cpukit/libmisc.
	* monitor/mon-mpci.c: Moved to rtems/cpukit/libmisc.
	* monitor/mon-object.c: Moved to rtems/cpukit/libmisc.
	* monitor/mon-prmisc.c: Moved to rtems/cpukit/libmisc.
	* monitor/mon-queue.c: Moved to rtems/cpukit/libmisc.
	* monitor/mon-server.c: Moved to rtems/cpukit/libmisc.
	* monitor/mon-symbols.c: Moved to rtems/cpukit/libmisc.
	* monitor/mon-task.c: Moved to rtems/cpukit/libmisc.
	* monitor/monitor.h: Moved to rtems/cpukit/libmisc.
	* monitor/symbols.h: Moved to rtems/cpukit/libmisc.
	* mw-fb/.cvsignore: Moved to rtems/cpukit/libmisc.
	* mw-fb/Makefile.am: Moved to rtems/cpukit/libmisc.
	* mw-fb/mw_fb.c: Moved to rtems/cpukit/libmisc.
	* mw-fb/mw_fb.h: Moved to rtems/cpukit/libmisc.
	* mw-fb/mw_uid.c: Moved to rtems/cpukit/libmisc.
	* mw-fb/mw_uid.h: Moved to rtems/cpukit/libmisc.
	* rtmonuse/.cvsignore: Moved to rtems/cpukit/libmisc.
	* rtmonuse/Makefile.am: Moved to rtems/cpukit/libmisc.
	* rtmonuse/rtmonuse.c: Moved to rtems/cpukit/libmisc.
	* rtmonuse/rtmonuse.h: Moved to rtems/cpukit/libmisc.
	* serdbg/.cvsignore: Moved to rtems/cpukit/libmisc.
	* serdbg/Makefile.am: Moved to rtems/cpukit/libmisc.
	* serdbg/README: Moved to rtems/cpukit/libmisc.
	* serdbg/serdbg.c: Moved to rtems/cpukit/libmisc.
	* serdbg/serdbg.h: Moved to rtems/cpukit/libmisc.
	* serdbg/serdbgcnf.h: Moved to rtems/cpukit/libmisc.
	* serdbg/serdbgio.c: Moved to rtems/cpukit/libmisc.
	* serdbg/termios_printk.c: Moved to rtems/cpukit/libmisc.
	* serdbg/termios_printk.h: Moved to rtems/cpukit/libmisc.
	* serdbg/termios_printk_cnf.h: Moved to rtems/cpukit/libmisc.
	* shell/.cvsignore: Moved to rtems/cpukit/libmisc.
	* shell/Makefile.am: Moved to rtems/cpukit/libmisc.
	* shell/README: Moved to rtems/cpukit/libmisc.
	* shell/cmds.c: Moved to rtems/cpukit/libmisc.
	* shell/shell.c: Moved to rtems/cpukit/libmisc.
	* shell/shell.h: Moved to rtems/cpukit/libmisc.
	* stackchk/.cvsignore: Moved to rtems/cpukit/libmisc.
	* stackchk/Makefile.am: Moved to rtems/cpukit/libmisc.
	* stackchk/README: Moved to rtems/cpukit/libmisc.
	* stackchk/check.c: Moved to rtems/cpukit/libmisc.
	* stackchk/internal.h: Moved to rtems/cpukit/libmisc.
	* stackchk/stackchk.h: Moved to rtems/cpukit/libmisc.
	* untar/.cvsignore: Moved to rtems/cpukit/libmisc.
	* untar/Makefile.am: Moved to rtems/cpukit/libmisc.
	* untar/README: Moved to rtems/cpukit/libmisc.
	* untar/untar.c: Moved to rtems/cpukit/libmisc.
	* untar/untar.h: Moved to rtems/cpukit/libmisc.
	* wrapup/.cvsignore: Moved to rtems/cpukit/libmisc.
	* wrapup/Makefile.am: Moved to rtems/cpukit/libmisc.
This commit is contained in:
Ralf Corsepius committed 2002-12-12 03:59:25 +00:00
1 parent 9005f8f4ee
commit 7fe03217c8
87 files changed
-14830

No files matched your search

File diff suppressed because it is too large. Load diff
-13
View File
@@ -1,13 +0,0 @@
##
## $Id$
##
ACLOCAL_AMFLAGS = -I ../../../aclocal
SUBDIRS = capture cpuuse devnull dummy dumpbuf monitor mw-fb shell \
rtmonuse serdbg stackchk untar wrapup
EXTRA_DIST = README
include $(top_srcdir)/../../../automake/subdirs.am
include $(top_srcdir)/../../../automake/local.am
-23
View File
@@ -1,23 +0,0 @@
#
# $Id$
#
This directory contains for the "miscellaneous" library. Currently
this library contains a number of useful support libraries:
+ Task Stack Overflow Checker
+ Workspace Consistency Checker
+ Task Execution Time Monitor
+ Period Statistics Monitor
+ Debug Monitor
The following ideas have been mentioned for items which could go
in this library, but this list is not all inclusive:
+ there are no outstanding suggestions.
The intent of this library is to provide a home for useful utility routines
which are dependent upon RTEMS.
--joel
16 Sept 97
-2
View File
@@ -1,2 +0,0 @@
Makefile
Makefile.in
-41
View File
@@ -1,41 +0,0 @@
##
## $Id$
##
include_rtemsdir = $(includedir)/rtems
LIBNAME = libcapture-tmp
LIB = $(ARCH)/$(LIBNAME).a
C_FILES = capture.c capture-cli.c
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
include_rtems_HEADERS = capture.h capture-cli.h
OBJS = $(C_O_FILES)
include $(top_srcdir)/../../../automake/compile.am
include $(top_srcdir)/../../../automake/lib.am
$(PROJECT_INCLUDE)/rtems:
@$(mkinstalldirs) $@
$(PROJECT_INCLUDE)/rtems/%.h: %.h
$(INSTALL_DATA) $< $@
#
# (OPTIONAL) Add local stuff here using +=
#
$(LIB): $(OBJS)
$(make-library)
PREINSTALL_FILES = $(PROJECT_INCLUDE)/rtems \
$(include_rtems_HEADERS:%=$(PROJECT_INCLUDE)/rtems/%)
all-local: $(ARCH) $(PREINSTALL_FILES) $(OBJS) $(LIB)
.PRECIOUS: $(LIB)
EXTRA_DIST = README capture.c capture-cli.c
include $(top_srcdir)/../../../automake/local.am
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-52
View File
@@ -1,52 +0,0 @@
/*
------------------------------------------------------------------------
$Id$
------------------------------------------------------------------------
Copyright Objective Design Systems Pty Ltd, 2002
All rights reserved Objective Design Systems Pty Ltd, 2002
Chris Johns (ccj@acm.org)
COPYRIGHT (c) 1989-1998.
On-Line Applications Research Corporation (OAR).
The license and distribution terms for this file may be
found in the file LICENSE in this distribution.
This software with is provided ``as is'' and with NO WARRANTY.
------------------------------------------------------------------------
RTEMS Performance Monitoring and Measurement Framework.
This is the Target Interface Command Line Interface. You need
start the RTEMS monitor.
*/
#ifndef __CAPTURE_CLI_H_
#define __CAPTURE_CLI_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems/capture.h>
/*
* rtems_capture_cli_init
*
* DESCRIPTION:
*
* This function initialises the command line interface to the capture
* engine.
*
*/
rtems_status_code
rtems_capture_cli_init (rtems_capture_timestamp timestamp);
#ifdef __cplusplus
}
#endif
#endif
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-59
View File
@@ -1,59 +0,0 @@
## Process this file with autoconf to produce a configure script.
##
## $Id$
AC_PREREQ(2.52)
AC_INIT([rtems-c-src-libmisc],[_RTEMS_VERSION],[rtems-bugs@OARcorp.com])
AC_CONFIG_SRCDIR([dumpbuf])
RTEMS_TOP(../../..)
AC_CONFIG_AUX_DIR(../../..)
RTEMS_CANONICAL_TARGET_CPU
AM_INIT_AUTOMAKE([no-define foreign 1.6])
AM_MAINTAINER_MODE
RTEMS_ENABLE_BARE
RTEMS_ENV_RTEMSBSP
RTEMS_CHECK_CPU
RTEMS_CANONICAL_HOST
RTEMS_PROJECT_ROOT
RTEMS_PROG_CC_FOR_TARGET
RTEMS_CANONICALIZE_TOOLS
RTEMS_CHECK_MULTIPROCESSING(RTEMS_BSP)
AM_CONDITIONAL(HAS_MP,test "$HAS_MP" = "yes")
# shell/* wants to assign file descriptors to stdio file descriptors.
AC_MSG_CHECKING([for assignable stdio])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[#include <stdio.h>],
[stdin = fopen("/tmp", "r")])],
[HAVE_ASSIGNABLE_STDIO=yes],
[HAVE_ASSIGNABLE_STDIO=no])
AC_MSG_RESULT([$HAVE_ASSIGNABLE_STDIO])
AM_CONDITIONAL([RTEMS_LIBSHELL],[test x"$HAVE_ASSIGNABLE_STDIO" = x"yes"])
# Explicitly list all Makefiles here
AC_CONFIG_FILES([Makefile
cpuuse/Makefile
shell/Makefile
devnull/Makefile
dummy/Makefile
dumpbuf/Makefile
monitor/Makefile
rtmonuse/Makefile
serdbg/Makefile
stackchk/Makefile
capture/Makefile
untar/Makefile
mw-fb/Makefile
wrapup/Makefile
])
AC_OUTPUT
-2
View File
@@ -1,2 +0,0 @@
Makefile
Makefile.in
-42
View File
@@ -1,42 +0,0 @@
##
## $Id$
##
include_rtemsdir = $(includedir)/rtems
LIBNAME = libcpuuse-tmp
LIB = $(ARCH)/$(LIBNAME).a
C_FILES = cpuuse.c
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
include_rtems_HEADERS = cpuuse.h
OBJS = $(C_O_FILES)
include $(top_srcdir)/../../../automake/compile.am
include $(top_srcdir)/../../../automake/lib.am
$(PROJECT_INCLUDE)/rtems:
@$(mkinstalldirs) $@
$(PROJECT_INCLUDE)/rtems/%.h: %.h
$(INSTALL_DATA) $< $@
#
# (OPTIONAL) Add local stuff here using +=
#
$(LIB): $(OBJS)
$(make-library)
PREINSTALL_FILES = $(PROJECT_INCLUDE)/rtems \
$(include_rtems_HEADERS:%=$(PROJECT_INCLUDE)/rtems/%)
all-local: $(ARCH) $(PREINSTALL_FILES) $(OBJS) $(LIB)
.PRECIOUS: $(LIB)
EXTRA_DIST = README cpuuse.c
include $(top_srcdir)/../../../automake/local.am
-41
View File
@@ -1,41 +0,0 @@
#
# $Id$
#
This directory contains a stack bounds checker. It provides two
primary features:
+ check for stack overflow at each context switch
+ provides an educated guess at each task's stack usage
The stack overflow check at context switch works by looking for
a 16 byte pattern at the logical end of the stack to be corrupted.
The "guesser" assumes that the entire stack was prefilled with a known
pattern and assumes that the pattern is still in place if the memory
has not been used as a stack.
Both of these can be fooled by pushing large holes onto the stack
and not writing to them... or (much more unlikely) writing the
magic patterns into memory.
This code has not been extensively tested. It is provided as a tool
for RTEMS users to catch the most common mistake in multitasking
systems ... too little stack space. Suggestions and comments are appreciated.
NOTES:
1. Stack usage information is questionable on CPUs which push
large holes on stack.
2. The stack checker has a tendency to generate a fault when
trying to print the helpful diagnostic message. If it comes
out, congratulations. If not, then the variable Stack_check_Blown_task
contains a pointer to the TCB of the offending task. This
is usually enough to go on.
FUTURE:
1. Determine how/if gcc will generate stack probe calls and support that.
2. Get accurate stack usage numbers on i960.. it pushes very large
holes on the stack.
-154
View File
@@ -1,154 +0,0 @@
/*
* CPU Usage Reporter
*
* COPYRIGHT (c) 1989-1999. 1996.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.OARcorp.com/rtems/license.html.
*
* $Id$
*
*/
#include <rtems.h>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <rtems/cpuuse.h>
unsigned32 CPU_usage_Ticks_at_last_reset;
/*PAGE
*
* CPU_usage_Dump
*/
void CPU_usage_Dump( void )
{
unsigned32 i;
unsigned32 api_index;
Thread_Control *the_thread;
Objects_Information *information;
unsigned32 u32_name;
char name[5];
unsigned32 total_units = 0;
for ( api_index = 1 ;
api_index <= OBJECTS_APIS_LAST ;
api_index++ ) {
if ( !_Objects_Information_table[ api_index ] )
continue;
information = _Objects_Information_table[ api_index ][ 1 ];
if ( information ) {
for ( i=1 ; i <= information->maximum ; i++ ) {
the_thread = (Thread_Control *)information->local_table[ i ];
if ( the_thread )
total_units += the_thread->ticks_executed;
}
}
}
printf("CPU Usage by thread\n");
#if defined(unix) || ( CPU_HARDWARE_FP == TRUE )
printf( " ID NAME TICKS PERCENT\n" );
#else
printf( " ID NAME TICKS\n" );
#endif
for ( api_index = 1 ;
api_index <= OBJECTS_APIS_LAST ;
api_index++ ) {
if ( !_Objects_Information_table[ api_index ] )
continue;
information = _Objects_Information_table[ api_index ][ 1 ];
if ( information ) {
for ( i=1 ; i <= information->maximum ; i++ ) {
the_thread = (Thread_Control *)information->local_table[ i ];
if ( !the_thread )
continue;
if ( information->is_string )
u32_name = *(unsigned32 *)the_thread->Object.name;
else
u32_name = (unsigned32)the_thread->Object.name;
name[ 0 ] = (u32_name >> 24) & 0xff;
name[ 1 ] = (u32_name >> 16) & 0xff;
name[ 2 ] = (u32_name >> 8) & 0xff;
name[ 3 ] = (u32_name >> 0) & 0xff;
name[ 4 ] = '\0';
if ( !isprint(name[0]) ) name[0] = '*';
if ( !isprint(name[1]) ) name[1] = '*';
if ( !isprint(name[2]) ) name[2] = '*';
if ( !isprint(name[3]) ) name[3] = '*';
#if defined(unix) || ( CPU_HARDWARE_FP == TRUE )
printf( "0x%08x %4s %8d %5.3f\n",
the_thread->Object.id,
name,
the_thread->ticks_executed,
(total_units) ?
(double)the_thread->ticks_executed / (double)total_units :
(double)total_units
);
#else
printf( "0x%08x %4s %8d\n",
the_thread->Object.id,
name,
the_thread->ticks_executed
);
#endif
}
}
}
printf(
"\nTicks since last reset = %d\n",
_Watchdog_Ticks_since_boot - CPU_usage_Ticks_at_last_reset
);
printf( "\nTotal Units = %d\n", total_units );
}
/*PAGE
*
* CPU_usage_Reset
*/
void CPU_usage_Reset( void )
{
unsigned32 i;
unsigned32 api_index;
Thread_Control *the_thread;
Objects_Information *information;
CPU_usage_Ticks_at_last_reset = _Watchdog_Ticks_since_boot;
for ( api_index = 1 ;
api_index <= OBJECTS_APIS_LAST ;
api_index++ ) {
if ( !_Objects_Information_table[ api_index ] )
continue;
information = _Objects_Information_table[ api_index ][ 1 ];
if ( information ) {
for ( i=1 ; i <= information->maximum ; i++ ) {
the_thread = (Thread_Control *)information->local_table[ i ];
if ( !the_thread )
continue;
the_thread->ticks_executed = 0;
}
}
}
}
-40
View File
@@ -1,40 +0,0 @@
/* cpuuse.h
*
* This include file contains information necessary to utilize
* and install the cpu usage reporting mechanism.
*
* COPYRIGHT (c) 1989-1999. 1996.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.OARcorp.com/rtems/license.html.
*
* $Id$
*/
#ifndef __CPU_USE_h
#define __CPU_USE_h
#ifdef __cplusplus
extern "C" {
#endif
/*
* CPU_usage_Dump
*/
void CPU_usage_Dump( void );
/*
* CPU_usage_Reset
*/
void CPU_usage_Reset( void );
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */
-2
View File
@@ -1,2 +0,0 @@
Makefile
Makefile.in
-42
View File
@@ -1,42 +0,0 @@
##
## $Id$
##
include_rtemsdir = $(includedir)/rtems
LIBNAME = libdevnull-tmp
LIB = $(ARCH)/$(LIBNAME).a
C_FILES = devnull.c
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
include_rtems_HEADERS = devnull.h
OBJS = $(C_O_FILES)
include $(top_srcdir)/../../../automake/compile.am
include $(top_srcdir)/../../../automake/lib.am
$(PROJECT_INCLUDE)/rtems:
@$(mkinstalldirs) $@
$(PROJECT_INCLUDE)/rtems/%.h: %.h
$(INSTALL_DATA) $< $@
#
# (OPTIONAL) Add local stuff here using +=
#
$(LIB): $(OBJS)
$(make-library)
PREINSTALL_FILES = $(PROJECT_INCLUDE)/rtems \
$(include_rtems_HEADERS:%=$(PROJECT_INCLUDE)/rtems/%)
all-local: $(ARCH) $(PREINSTALL_FILES) $(OBJS) $(LIB)
.PRECIOUS: $(LIB)
EXTRA_DIST = devnull.c
include $(top_srcdir)/../../../automake/local.am
-180
View File
@@ -1,180 +0,0 @@
/* /dev/null
*
* Derived from rtems' stub driver.
*
* Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
*
* COPYRIGHT (c) 1989-2000.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.OARcorp.com/rtems/license.html.
*
* $Id$
*/
#include <rtems.h>
#include <rtems/devnull.h>
#include <rtems/libio.h>
/* null_initialize
*
* This routine is the null device driver init routine.
*
* Input parameters:
* major - device major number
* minor - device minor number
* pargp - pointer to parameter block
*
* Output parameters:
* rval - NULL_SUCCESSFUL
*/
rtems_unsigned32 NULL_major;
static char initialized;
rtems_device_driver null_initialize(
rtems_device_major_number major,
rtems_device_minor_number minor,
void *pargp
)
{
rtems_device_driver status;
if ( !initialized ) {
initialized = 1;
status = rtems_io_register_name(
"/dev/null",
major,
(rtems_device_minor_number) 0
);
if (status != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred(status);
NULL_major = major;
}
return RTEMS_SUCCESSFUL;
}
/* null_open
*
* This routine is the null device driver open routine.
*
* Input parameters:
* major - device major number
* minor - device minor number
* pargb - pointer to open parameter block
*
* Output parameters:
* rval - NULL_SUCCESSFUL
*/
rtems_device_driver null_open(
rtems_device_major_number major,
rtems_device_minor_number minor,
void *pargp
)
{
return NULL_SUCCESSFUL;
}
/* null_close
*
* This routine is the null device driver close routine.
*
* Input parameters:
* major - device major number
* minor - device minor number
* pargb - pointer to close parameter block
*
* Output parameters:
* rval - NULL_SUCCESSFUL
*/
rtems_device_driver null_close(
rtems_device_major_number major,
rtems_device_minor_number minor,
void *pargp
)
{
return NULL_SUCCESSFUL;
}
/* null_read
*
* This routine is the null device driver read routine.
*
* Input parameters:
* major - device major number
* minor - device minor number
* pargp - pointer to read parameter block
*
* Output parameters:
* rval - NULL_SUCCESSFUL
*/
rtems_device_driver null_read(
rtems_device_major_number major,
rtems_device_minor_number minor,
void *pargp
)
{
return NULL_SUCCESSFUL;
}
/* null_write
*
* This routine is the null device driver write routine.
*
* Input parameters:
* major - device major number
* minor - device minor number
* pargp - pointer to write parameter block
*
* Output parameters:
* rval - NULL_SUCCESSFUL
*/
rtems_device_driver null_write(
rtems_device_major_number major,
rtems_device_minor_number minor,
void *pargp
)
{
rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *) pargp;
if ( rw_args )
rw_args->bytes_moved = rw_args->count;
return NULL_SUCCESSFUL;
}
/* null_control
*
* This routine is the null device driver control routine.
*
* Input parameters:
* major - device major number
* minor - device minor number
* pargp - pointer to cntrl parameter block
*
* Output parameters:
* rval - NULL_SUCCESSFUL
*/
rtems_device_driver null_control(
rtems_device_major_number major,
rtems_device_minor_number minor,
void *pargp
)
{
return NULL_SUCCESSFUL;
}
-71
View File
@@ -1,71 +0,0 @@
/* devnull.h
*
* Null device driver, derived from rtems' stub driver.
*
* Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
*
* COPYRIGHT (c) 1989-2000.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.OARcorp.com/rtems/license.html.
*
* $Id$
*/
#ifndef __NULL_DRIVER_h
#define __NULL_DRIVER_h
#ifdef __cplusplus
extern "C" {
#endif
#define DEVNULL_DRIVER_TABLE_ENTRY \
{ null_initialize, null_open, null_close, null_read, \
null_write, null_control }
#define NULL_SUCCESSFUL RTEMS_SUCCESSFUL
rtems_device_driver null_initialize(
rtems_device_major_number,
rtems_device_minor_number,
void *
);
rtems_device_driver null_open(
rtems_device_major_number,
rtems_device_minor_number,
void *
);
rtems_device_driver null_close(
rtems_device_major_number,
rtems_device_minor_number,
void *
);
rtems_device_driver null_read(
rtems_device_major_number,
rtems_device_minor_number,
void *
);
rtems_device_driver null_write(
rtems_device_major_number,
rtems_device_minor_number,
void *
);
rtems_device_driver null_control(
rtems_device_major_number,
rtems_device_minor_number,
void *
);
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */
-2
View File
@@ -1,2 +0,0 @@
Makefile
Makefile.in
-32
View File
@@ -1,32 +0,0 @@
##
## $Id$
##
LIBNAME = libdummy-tmp
LIB = $(ARCH)/$(LIBNAME).a
C_FILES = dummy.c
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
OBJS = $(C_O_FILES)
include $(top_srcdir)/../../../automake/compile.am
include $(top_srcdir)/../../../automake/lib.am
#
# (OPTIONAL) Add local stuff here using +=
#
$(LIB): $(OBJS)
$(make-library)
TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/$(PGMNAME)$(LIB_VARIANT).rel
all-local: $(ARCH) $(PREINSTALL_FILES) $(OBJS) $(LIB)
.PRECIOUS: $(LIB)
EXTRA_DIST = README dummy.c
include $(top_srcdir)/../../../automake/local.am
-23
View File
@@ -1,23 +0,0 @@
dummy.rel
=========
A relocatible objects which contains a dummy configuration for RTEMS.
Helps linking standard c-program code with RTEMS, which shall *not* be run
on a target, such as configure script code fragments generated by autoconf's
AC_TRY_LINK.
Example:
tar xzvf somepkg.tar.gz
cd somepkg
LDFLAGS=/usr/local/rtems/<cpu>-rtems/<bsp>/lib/dummy.rel \
CC="<cpu>-rtems-gcc \
-B/usr/local/rtems/<cpu>-rtems/<bsp>/lib/ -specs bsp_specs -qrtems" \
CC_FOR_BUILD="gcc" \
configure --host=<cpu>-rtems --build=i686-pc-linux-gnu
make
History:
Starting dummy.c with a copy of rtems-19990528/c/src/tests/samples/minimum/init.c
-42
View File
@@ -1,42 +0,0 @@
/* Init
*
*
* Input parameters: NONE
*
* Output parameters: NONE
*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.OARcorp.com/rtems/license.html.
*
* $Id$
*/
#include <rtems.h>
rtems_task Init(
rtems_task_argument ignored
)
{
}
int main( int, char **, char **);
/* configuration information */
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_MAXIMUM_TASKS 10
#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20
#define CONFIGURE_INIT_TASK_ENTRY_POINT (void *)main
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_INIT
#include <confdefs.h>
/* global variables */
-2
View File
@@ -1,2 +0,0 @@
Makefile
Makefile.in
-42
View File
@@ -1,42 +0,0 @@
##
## $Id$
##
include_rtemsdir = $(includedir)/rtems
LIBNAME = libdumpbuf-tmp
LIB = $(ARCH)/$(LIBNAME).a
C_FILES = dumpbuf.c
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
include_rtems_HEADERS = dumpbuf.h
OBJS = $(C_O_FILES)
include $(top_srcdir)/../../../automake/compile.am
include $(top_srcdir)/../../../automake/lib.am
$(PROJECT_INCLUDE)/rtems:
@$(mkinstalldirs) $@
$(PROJECT_INCLUDE)/rtems/%.h: %.h
$(INSTALL_DATA) $< $@
#
# (OPTIONAL) Add local stuff here using +=
#
$(LIB): $(OBJS)
$(make-library)
PREINSTALL_FILES = $(PROJECT_INCLUDE)/rtems \
$(include_rtems_HEADERS:%=$(PROJECT_INCLUDE)/rtems/%)
all-local: $(ARCH) $(PREINSTALL_FILES) $(OBJS) $(LIB)
.PRECIOUS: $(LIB)
EXTRA_DIST = dumpbuf.c
include $(top_srcdir)/../../../automake/local.am
-75
View File
@@ -1,75 +0,0 @@
/*
* COPYRIGHT (c) 1997.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may in
* the file LICENSE in this distribution or at
* http://www.OARcorp.com/rtems/license.html.
*
* $Id$
*/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <rtems/dumpbuf.h>
/*
* Put the body below Dump_Buffer so it won't get inlined.
*/
static inline void Dump_Line(
unsigned char *buffer,
int length
);
void Dump_Buffer(
unsigned char *buffer,
int length
)
{
int i, mod, max;
if ( !length ) return;
mod = length % 16;
max = length - mod;
for ( i=0 ; i<max ; i+=16 )
Dump_Line( &buffer[ i ], 16 );
if ( mod )
Dump_Line( &buffer[ max ], mod );
}
static inline void Dump_Line(
unsigned char *buffer,
int length
)
{
int i;
char line_buffer[120];
line_buffer[0] = '\0';
for( i=0 ; i<length ; i++ )
sprintf( line_buffer, "%s%02x ", line_buffer, buffer[ i ] );
for( ; i<16 ; i++ )
strcat( line_buffer, " " );
strcat( line_buffer, "|" );
for( i=0 ; i<length ; i++ )
sprintf( line_buffer, "%s%c", line_buffer,
isprint( buffer[ i ] ) ? buffer[ i ] : '.' );
for( ; i<16 ; i++ )
strcat( line_buffer, " " );
strcat( line_buffer, "|\n" );
printf( line_buffer );
}
-21
View File
@@ -1,21 +0,0 @@
/*
* COPYRIGHT (c) 1997.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may in
* the file LICENSE in this distribution or at
* http://www.OARcorp.com/rtems/license.html.
*
* $Id$
*/
#ifndef __DUMP_BUFFER_h
#define __DUMP_BUFFER_h
void Dump_Buffer(
unsigned char *buffer,
int length
);
#endif
/* end of include file */
-2
View File
@@ -1,2 +0,0 @@
Makefile
Makefile.in
-55
View File
@@ -1,55 +0,0 @@
##
## $Id$
##
include_rtemsdir = $(includedir)/rtems
LIBNAME = libmonitor-tmp
LIB = $(ARCH)/$(LIBNAME).a
# We only build multiprocessing related files if HAS_MP was defined
MP_C_FILES = mon-mpci.c
C_FILES = mon-command.c mon-symbols.c mon-prmisc.c mon-monitor.c \
mon-object.c mon-server.c mon-task.c mon-queue.c mon-driver.c \
mon-dname.c mon-itask.c mon-extension.c mon-manager.c mon-config.c
if HAS_MP
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT)) $(MP_C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
else
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
endif
include_rtems_HEADERS = monitor.h symbols.h
OBJS = $(C_O_FILES)
include $(top_srcdir)/../../../automake/compile.am
include $(top_srcdir)/../../../automake/lib.am
$(PROJECT_INCLUDE)/rtems:
$(mkinstalldirs) $@
$(PROJECT_INCLUDE)/rtems/%.h: %.h
$(INSTALL_DATA) $< $@
#
# (OPTIONAL) Add local stuff here using +=
#
$(LIB): $(OBJS)
$(make-library)
PREINSTALL_FILES = $(PROJECT_INCLUDE)/rtems \
$(include_rtems_HEADERS:%=$(PROJECT_INCLUDE)/rtems/%)
all-local: $(ARCH) $(PREINSTALL_FILES) $(OBJS) $(LIB)
.PRECIOUS: $(LIB)
EXTRA_DIST = README mon-command.c mon-config.c mon-dname.c mon-driver.c \
mon-extension.c mon-itask.c mon-manager.c mon-monitor.c mon-mpci.c \
mon-object.c mon-prmisc.c mon-queue.c mon-server.c mon-symbols.c \
mon-task.c
include $(top_srcdir)/../../../automake/local.am
-97
View File
@@ -1,97 +0,0 @@
#
# $Id$
#
monitor task
The monitor task is an optional task that knows about RTEMS
data structures and can print out information about them.
It is a work-in-progress and needs many more commands, but
is useful now.
The monitor works best when it is the highest priority task,
so all your other tasks should ideally be at some priority
greater than 1.
To use the monitor:
-------------------
#include <rtems/monitor.h>
...
rtems_monitor_init(0);
The parameter to rtems_monitor_init() tells the monitor whether
to suspend itself on startup. A value of 0 causes the monitor
to immediately enter command mode; a non-zero value causes the
monitor to suspend itself after creation and wait for explicit
wakeup.
rtems_monitor_wakeup();
wakes up a suspended monitor and causes it to reenter command mode.
Monitor commands
----------------
The monitor prompt is 'rtems> '.
Can abbreviate commands to "uniquity"
There is a 'help' command. Here is the output from various
help commands:
Commands (may be abbreviated)
help -- get this message or command specific help
task -- show task information
queue -- show message queue information
symbol -- show entries from symbol table
pause -- pause monitor for a specified number of ticks
fatal -- invoke a fatal RTEMS error
task [id [id ...] ]
display information about the specified tasks.
Default is to display information about all tasks on this node
queue [id [id ... ] ]
display information about the specified message queues
Default is to display information about all queues on this node
symbol [ symbolname [symbolname ... ] ]
display value associated with specified symbol.
Defaults to displaying all known symbols.
pause [ticks]
monitor goes to "sleep" for specified ticks (default is 1)
monitor will resume at end of period or if explicitly awakened
fatal [status]
Invoke 'rtems_fatal_error_occurred' with 'status'
(default is RTEMS_INTERNAL_ERROR)
continue
put the monitor to sleep waiting for an explicit wakeup from the
program running.
Sample output from 'task' command
---------------------------------
rtems> task
ID NAME PRIO STAT MODES EVENTS WAITID WAITARG NOTES
------------------------------------------------------------------------
00010001 UI1 2 READY P:T:nA NONE15: 0x40606348
00010002 RMON 1 READY nP NONE15: 0x40604110
'RMON' is the monitor itself, so we have 1 "user" task.
Its modes are P:T:nA which translate to:
preemptable
timesliced
no ASRS
It has no events.
It has a notepad value for notepad 15 which is 0x40606348
(this is the libc thread state)
File diff suppressed because it is too large. Load diff
-131
View File
@@ -1,131 +0,0 @@
/*
* RTEMS Config display support
*
* TODO
*
* $Id$
*/
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
#include <rtems.h>
#include <rtems/monitor.h>
#include <stdio.h>
#include <stdlib.h> /* strtoul() */
#define DATACOL 15
#define CONTCOL DATACOL /* continued col */
/*
* Fill in entire monitor config table
* for sending to a remote monitor or printing on the local system
*/
void
rtems_monitor_config_canonical(
rtems_monitor_config_t *canonical_config,
void *config_void
)
{
rtems_configuration_table *c = (rtems_configuration_table *) config_void;
rtems_api_configuration_table *r = c->RTEMS_api_configuration;
canonical_config->work_space_start = c->work_space_start;
canonical_config->work_space_size = c->work_space_size;
canonical_config->maximum_tasks = r->maximum_tasks;
canonical_config->maximum_timers = r->maximum_timers;
canonical_config->maximum_semaphores = r->maximum_semaphores;
canonical_config->maximum_message_queues = r->maximum_message_queues;
canonical_config->maximum_partitions = r->maximum_partitions;
canonical_config->maximum_regions = r->maximum_regions;
canonical_config->maximum_ports = r->maximum_ports;
canonical_config->maximum_periods = r->maximum_periods;
canonical_config->maximum_extensions = c->maximum_extensions;
canonical_config->microseconds_per_tick = c->microseconds_per_tick;
canonical_config->ticks_per_timeslice = c->ticks_per_timeslice;
canonical_config->number_of_initialization_tasks = r->number_of_initialization_tasks;
}
/*
* This is easy, since there is only 1 (altho we could get them from
* other nodes...)
*/
void *
rtems_monitor_config_next(
void *object_info,
rtems_monitor_config_t *canonical_config,
rtems_id *next_id
)
{
rtems_configuration_table *c = _Configuration_Table;
int n = rtems_get_index(*next_id);
if (n >= 1)
goto failed;
_Thread_Disable_dispatch();
*next_id += 1;
return (void *) c;
failed:
*next_id = RTEMS_OBJECT_ID_FINAL;
return 0;
}
void
rtems_monitor_config_dump_header(
boolean verbose
)
{
printf("\
INITIAL (startup) Configuration Info\n");
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
0 1 2 3 4 5 6 7 */
rtems_monitor_separator();
}
void
rtems_monitor_config_dump(
rtems_monitor_config_t *monitor_config,
boolean verbose
)
{
unsigned32 length = 0;
length = 0;
length += printf("WORKSPACE");
length += rtems_monitor_pad(DATACOL, length);
length += printf("start: 0x%x; size: 0x%x\n",
(unsigned32) monitor_config->work_space_start,
monitor_config->work_space_size);
length = 0;
length += printf("TIME");
length += rtems_monitor_pad(DATACOL, length);
length += printf("usec/tick: %d; tick/timeslice: %d; tick/sec: %d\n",
monitor_config->microseconds_per_tick,
monitor_config->ticks_per_timeslice,
1000000 / monitor_config->microseconds_per_tick);
length = 0;
length += printf("MAXIMUMS");
length += rtems_monitor_pad(DATACOL, length);
length += printf("tasks: %d; timers: %d; sems: %d; que's: %d; ext's: %d\n",
monitor_config->maximum_tasks,
monitor_config->maximum_timers,
monitor_config->maximum_semaphores,
monitor_config->maximum_message_queues,
monitor_config->maximum_extensions);
length = 0;
length += rtems_monitor_pad(CONTCOL, length);
length += printf("partitions: %d; regions: %d; ports: %d; periods: %d\n",
monitor_config->maximum_partitions,
monitor_config->maximum_regions,
monitor_config->maximum_ports,
monitor_config->maximum_periods);
}
-112
View File
@@ -1,112 +0,0 @@
/*
* RTEMS monitor driver names support.
*
* There are 2 "driver" things the monitor knows about.
*
* 1. Regular RTEMS drivers.
* This is a table indexed by major device number and
* containing driver entry points only.
*
* 2. Driver name table.
* A separate table of names for drivers.
* The table converts driver names to a major number
* as index into the driver table and a minor number
* for an argument to driver.
*
* Drivers are displayed with 'driver' command.
* Names are displayed with 'dname' command.
*
* $Id$
*/
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
#include <rtems.h>
#include <rtems/monitor.h>
#include <stdio.h>
#include <stdlib.h> /* strtoul() */
#include <string.h> /* strncpy() */
#define DATACOL 15
#define CONTCOL DATACOL /* continued col */
void
rtems_monitor_dname_canonical(
rtems_monitor_dname_t *canonical_dname,
void *dname_void
)
{
rtems_driver_name_t *np = (rtems_driver_name_t *) dname_void;
(void) strncpy(canonical_dname->name_string, np->device_name, sizeof(canonical_dname->name_string));
canonical_dname->major = np->major;
canonical_dname->minor = np->minor;
}
void *
rtems_monitor_dname_next(
void *object_information,
rtems_monitor_dname_t *canonical_dname,
rtems_id *next_id
)
{
rtems_unsigned32 n = rtems_get_index(*next_id);
rtems_driver_name_t *table = _IO_Driver_name_table;
rtems_driver_name_t *np = 0;
/* XXX should we be using _IO_Number_of_devices */
for (np = table + n ; n<_IO_Number_of_devices; n++, np++)
if (np->device_name)
goto done;
*next_id = RTEMS_OBJECT_ID_FINAL;
return 0;
done:
_Thread_Disable_dispatch();
/*
* dummy up a fake id and name for this item
*/
canonical_dname->id = n;
canonical_dname->name = rtems_build_name('-', '-', '-', '-');
*next_id += 1;
return np;
}
void
rtems_monitor_dname_dump_header(
boolean verbose
)
{
printf("\
Major:Minor Name\n");
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
0 1 2 3 4 5 6 7 */
rtems_monitor_separator();
}
void
rtems_monitor_dname_dump(
rtems_monitor_dname_t *monitor_dname,
boolean verbose
)
{
unsigned32 length = 0;
length += rtems_monitor_pad(6, length);
length += rtems_monitor_dump_hex(monitor_dname->major);
length += printf(":");
length += rtems_monitor_dump_hex(monitor_dname->minor);
length += rtems_monitor_pad(16, length);
length += printf("%.*s",
(int) sizeof(monitor_dname->name_string),
(char *) monitor_dname->name_string);
length += printf("\n");
length = 0;
}
-136
View File
@@ -1,136 +0,0 @@
/*
* RTEMS monitor IO (device drivers) support
*
* There are 2 "driver" things the monitor knows about.
*
* 1. Regular RTEMS drivers.
* This is a table indexed by major device number and
* containing driver entry points only.
*
* 2. Driver name table.
* A separate table of names for drivers.
* The table converts driver names to a major number
* as index into the driver table and a minor number
* for an argument to driver.
*
* Drivers are displayed with 'driver' command.
* Names are displayed with 'name' command.
*
* $Id$
*/
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
#include <rtems.h>
#include <rtems/monitor.h>
#include <stdio.h>
#include <stdlib.h> /* strtoul() */
#define DATACOL 15
#define CONTCOL DATACOL /* continued col */
void
rtems_monitor_driver_canonical(
rtems_monitor_driver_t *canonical_driver,
void *driver_void
)
{
rtems_driver_address_table *d = (rtems_driver_address_table *) driver_void;
rtems_monitor_symbol_canonical_by_value(&canonical_driver->initialization,
(void *) d->initialization_entry);
rtems_monitor_symbol_canonical_by_value(&canonical_driver->open,
(void *) d->open_entry);
rtems_monitor_symbol_canonical_by_value(&canonical_driver->close,
(void *) d->close_entry);
rtems_monitor_symbol_canonical_by_value(&canonical_driver->read,
(void *) d->read_entry);
rtems_monitor_symbol_canonical_by_value(&canonical_driver->write,
(void *) d->write_entry);
rtems_monitor_symbol_canonical_by_value(&canonical_driver->control,
(void *) d->control_entry);
}
void *
rtems_monitor_driver_next(
void *object_info,
rtems_monitor_driver_t *canonical_driver,
rtems_id *next_id
)
{
rtems_configuration_table *c = _Configuration_Table;
rtems_unsigned32 n = rtems_get_index(*next_id);
if (n >= c->number_of_device_drivers)
goto failed;
_Thread_Disable_dispatch();
/*
* dummy up a fake id and name for this item
*/
canonical_driver->id = n;
canonical_driver->name = rtems_build_name('-', '-', '-', '-');
*next_id += 1;
return (void *) (c->Device_driver_table + n);
failed:
*next_id = RTEMS_OBJECT_ID_FINAL;
return 0;
}
void
rtems_monitor_driver_dump_header(
boolean verbose
)
{
printf("\
Major Entry points\n");
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
0 1 2 3 4 5 6 7 */
rtems_monitor_separator();
}
void
rtems_monitor_driver_dump(
rtems_monitor_driver_t *monitor_driver,
boolean verbose
)
{
unsigned32 length = 0;
length += printf(" %d", monitor_driver->id);
length += rtems_monitor_pad(13, length);
length += printf("init: ");
length += rtems_monitor_symbol_dump(&monitor_driver->initialization, verbose);
length += printf("; control: ");
length += rtems_monitor_symbol_dump(&monitor_driver->control, verbose);
length += printf("\n");
length = 0;
length += rtems_monitor_pad(13, length);
length += printf("open: ");
length += rtems_monitor_symbol_dump(&monitor_driver->open, verbose);
length += printf("; close: ");
length += rtems_monitor_symbol_dump(&monitor_driver->close, verbose);
length += printf("\n");
length = 0;
length += rtems_monitor_pad(13, length);
length += printf("read: ");
length += rtems_monitor_symbol_dump(&monitor_driver->read, verbose);
length += printf("; write: ");
length += rtems_monitor_symbol_dump(&monitor_driver->write, verbose);
length += printf("\n");
length = 0;
}
-98
View File
@@ -1,98 +0,0 @@
/*
* RTEMS Monitor extension support
*
* $Id$
*/
#include <rtems.h>
#include <rtems/monitor.h>
#include <stdio.h>
void
rtems_monitor_extension_canonical(
rtems_monitor_extension_t *canonical_extension,
void *extension_void
)
{
Extension_Control *rtems_extension = (Extension_Control *) extension_void;
rtems_extensions_table *e = &rtems_extension->Extension.Callouts;
rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_create,
(void *) e->thread_create);
rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_start,
(void *) e->thread_start);
rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_restart,
(void *) e->thread_restart);
rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_delete,
(void *) e->thread_delete);
rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_tswitch,
(void *) e->thread_switch);
rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_begin,
(void *) e->thread_begin);
rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_exitted,
(void *) e->thread_exitted);
rtems_monitor_symbol_canonical_by_value(&canonical_extension->e_fatal,
(void *) e->fatal);
}
void
rtems_monitor_extension_dump_header(
boolean verbose
)
{
printf("\
ID NAME\n");
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
0 1 2 3 4 5 6 7 */
rtems_monitor_separator();
}
/*
* Dump out the canonical form
*/
void
rtems_monitor_extension_dump(
rtems_monitor_extension_t *monitor_extension,
boolean verbose
)
{
unsigned32 length = 0;
length += rtems_monitor_dump_id(monitor_extension->id);
length += rtems_monitor_pad(11, length);
length += rtems_monitor_dump_name(monitor_extension->name);
length += rtems_monitor_pad(18, length);
length += printf("create: ");
length += rtems_monitor_symbol_dump(&monitor_extension->e_create, verbose);
length += printf("; start: ");
length += rtems_monitor_symbol_dump(&monitor_extension->e_start, verbose);
length += printf("; restart: ");
length += rtems_monitor_symbol_dump(&monitor_extension->e_restart, verbose);
length += printf("\n");
length = 0;
length += rtems_monitor_pad(18, length);
length += printf("delete: ");
length += rtems_monitor_symbol_dump(&monitor_extension->e_delete, verbose);
length += printf("; switch: ");
length += rtems_monitor_symbol_dump(&monitor_extension->e_tswitch, verbose);
length += printf("; begin: ");
length += rtems_monitor_symbol_dump(&monitor_extension->e_begin, verbose);
length += printf("\n");
length = 0;
length += rtems_monitor_pad(18, length);
length += printf("exitted: ");
length += rtems_monitor_symbol_dump(&monitor_extension->e_exitted, verbose);
length += printf("; fatal: ");
length += rtems_monitor_symbol_dump(&monitor_extension->e_fatal, verbose);
length += printf("\n");
length = 0;
printf("\n");
}
-115
View File
@@ -1,115 +0,0 @@
/*
* RTEMS Monitor init task support
*
* $Id$
*/
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
#include <rtems.h>
#include <rtems/monitor.h>
#include <stdio.h>
/*
* As above, but just for init tasks
*/
void
rtems_monitor_init_task_canonical(
rtems_monitor_init_task_t *canonical_itask,
void *itask_void
)
{
rtems_initialization_tasks_table *rtems_itask = itask_void;
rtems_monitor_symbol_canonical_by_value(&canonical_itask->entry,
(void *) rtems_itask->entry_point);
canonical_itask->argument = rtems_itask->argument;
canonical_itask->stack_size = rtems_itask->stack_size;
canonical_itask->priority = rtems_itask->initial_priority;
canonical_itask->modes = rtems_itask->mode_set;
canonical_itask->attributes = rtems_itask->attribute_set;
}
void *
rtems_monitor_init_task_next(
void *object_info,
rtems_monitor_init_task_t *canonical_init_task,
rtems_id *next_id
)
{
rtems_configuration_table *c = _Configuration_Table;
rtems_initialization_tasks_table *itask;
rtems_unsigned32 n = rtems_get_index(*next_id);
if (n >= c->RTEMS_api_configuration->number_of_initialization_tasks)
goto failed;
_Thread_Disable_dispatch();
itask = c->RTEMS_api_configuration->User_initialization_tasks_table + n;
/*
* dummy up a fake id and name for this item
*/
canonical_init_task->id = n;
canonical_init_task->name = itask->name;
*next_id += 1;
return (void *) itask;
failed:
*next_id = RTEMS_OBJECT_ID_FINAL;
return 0;
}
void
rtems_monitor_init_task_dump_header(
boolean verbose
)
{
printf("\
# NAME ENTRY ARGUMENT PRIO MODES ATTRIBUTES STACK SIZE\n");
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
0 1 2 3 4 5 6 7 */
rtems_monitor_separator();
}
/*
*/
void
rtems_monitor_init_task_dump(
rtems_monitor_init_task_t *monitor_itask,
boolean verbose
)
{
int length = 0;
length += rtems_monitor_dump_decimal(monitor_itask->id);
length += rtems_monitor_pad(7, length);
length += rtems_monitor_dump_name(monitor_itask->name);
length += rtems_monitor_pad(14, length);
length += rtems_monitor_symbol_dump(&monitor_itask->entry, verbose);
length += rtems_monitor_pad(25, length);
length += printf("%d [0x%x]", monitor_itask->argument, monitor_itask->argument);
length += rtems_monitor_pad(39, length);
length += rtems_monitor_dump_priority(monitor_itask->priority);
length += rtems_monitor_pad(46, length);
length += rtems_monitor_dump_modes(monitor_itask->modes);
length += rtems_monitor_pad(54, length);
length += rtems_monitor_dump_attributes(monitor_itask->attributes);
length += rtems_monitor_pad(66, length);
length += printf("%d [0x%x]", monitor_itask->stack_size, monitor_itask->stack_size);
printf("\n");
}
-51
View File
@@ -1,51 +0,0 @@
/*
* RTEMS Monitor "manager" support.
* Used to traverse object (chain) lists and print them out.
*
* $Id$
*/
#include <rtems.h>
#include <rtems/monitor.h>
#include <stdio.h>
/*
* "next" routine for all objects that are RTEMS manager objects
*/
void *
rtems_monitor_manager_next(
void *table_void,
void *canonical,
rtems_id *next_id
)
{
Objects_Information *table = table_void;
rtems_monitor_generic_t *copy;
Objects_Control *object = 0;
Objects_Locations location;
/*
* When we are called, it must be local
*/
if ( ! _Objects_Is_local_id(*next_id))
goto done;
object = _Objects_Get_next(table, *next_id, &location, next_id);
if (object)
{
copy = (rtems_monitor_generic_t *) canonical;
copy->id = object->id;
if(table->is_string)
_Objects_Copy_name_raw(object->name, &copy->name, sizeof(copy->name));
else
_Objects_Copy_name_raw(&object->name, &copy->name, sizeof(copy->name));
}
done:
return object;
}
File diff suppressed because it is too large. Load diff
-159
View File
@@ -1,159 +0,0 @@
/*
* RTEMS MPCI Config display support
*
* TODO
*
* $Id$
*/
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
#include <rtems.h>
#include <rtems/monitor.h>
#include <stdio.h>
#include <stdlib.h> /* strtoul() */
#define DATACOL 15
/*
* Fill in entire monitor config table
* for sending to a remote monitor or printing on the local system
*/
void
rtems_monitor_mpci_canonical(
rtems_monitor_mpci_t *canonical_mpci,
void *config_void
)
{
rtems_configuration_table *c = _Configuration_Table;
rtems_multiprocessing_table *m;
rtems_mpci_table *mt;
m = c->User_multiprocessing_table;
if (m == 0)
return;
mt = m->User_mpci_table;
canonical_mpci->node = m->node;
canonical_mpci->maximum_nodes = m->maximum_nodes;
canonical_mpci->maximum_global_objects = m->maximum_global_objects;
canonical_mpci->maximum_proxies = m->maximum_proxies;
canonical_mpci->default_timeout = mt->default_timeout;
canonical_mpci->maximum_packet_size = mt->maximum_packet_size;
rtems_monitor_symbol_canonical_by_value(&canonical_mpci->initialization,
(void *) mt->initialization);
rtems_monitor_symbol_canonical_by_value(&canonical_mpci->get_packet,
(void *) mt->get_packet);
rtems_monitor_symbol_canonical_by_value(&canonical_mpci->return_packet,
(void *) mt->return_packet);
rtems_monitor_symbol_canonical_by_value(&canonical_mpci->send_packet,
(void *) mt->send_packet);
rtems_monitor_symbol_canonical_by_value(&canonical_mpci->receive_packet,
(void *) mt->receive_packet);
}
/*
* This is easy, since there is only 1 (altho we could get them from
* other nodes...)
*/
void *
rtems_monitor_mpci_next(
void *object_info,
rtems_monitor_mpci_t *canonical_mpci,
rtems_id *next_id
)
{
rtems_configuration_table *c = _Configuration_Table;
int n = rtems_get_index(*next_id);
if (n >= 1)
goto failed;
if ( ! c->User_multiprocessing_table)
goto failed;
_Thread_Disable_dispatch();
*next_id += 1;
return (void *) c;
failed:
*next_id = RTEMS_OBJECT_ID_FINAL;
return 0;
}
void
rtems_monitor_mpci_dump_header(
boolean verbose
)
{
printf("\
max max max default max\n\
node nodes globals proxies timeout pktsize\n");
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
0 1 2 3 4 5 6 7 */
rtems_monitor_separator();
}
void
rtems_monitor_mpci_dump(
rtems_monitor_mpci_t *monitor_mpci,
boolean verbose
)
{
unsigned32 length = 0;
length += rtems_monitor_pad(2, length);
length += printf(" %d", monitor_mpci->node);
length += rtems_monitor_pad(11, length);
length += printf("%d", monitor_mpci->maximum_nodes);
length += rtems_monitor_pad(18, length);
length += rtems_monitor_dump_decimal(monitor_mpci->maximum_global_objects);
length += rtems_monitor_pad(28, length);
length += rtems_monitor_dump_decimal(monitor_mpci->maximum_proxies);
length += rtems_monitor_pad(37, length);
length += rtems_monitor_dump_decimal(monitor_mpci->default_timeout);
length += rtems_monitor_pad(46, length);
length += rtems_monitor_dump_decimal(monitor_mpci->maximum_packet_size);
printf("\n");
length = 0;
length += rtems_monitor_pad(DATACOL, length);
length += printf("init: ");
length += rtems_monitor_symbol_dump(&monitor_mpci->initialization, verbose);
printf("\n");
length = 0;
length += rtems_monitor_pad(DATACOL, length);
length += printf("get: ");
length += rtems_monitor_symbol_dump(&monitor_mpci->get_packet, verbose);
length += printf("; return: ");
length += rtems_monitor_symbol_dump(&monitor_mpci->return_packet, verbose);
printf("\n");
length = 0;
length += rtems_monitor_pad(DATACOL, length);
length += printf("send: ");
length += rtems_monitor_symbol_dump(&monitor_mpci->send_packet, verbose);
length += printf("; receive: ");
length += rtems_monitor_symbol_dump(&monitor_mpci->receive_packet, verbose);
printf("\n");
length = 0;
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-64
View File
@@ -1,64 +0,0 @@
/*
* $Id$
*/
#include <rtems.h>
#include <rtems/monitor.h>
#include <stdio.h>
void
rtems_monitor_queue_canonical(
rtems_monitor_queue_t *canonical_queue,
void *queue_void
)
{
Message_queue_Control *rtems_queue = (Message_queue_Control *) queue_void;
canonical_queue->attributes = rtems_queue->attribute_set;
canonical_queue->maximum_message_size = rtems_queue->message_queue.maximum_message_size;
canonical_queue->maximum_pending_messages = rtems_queue->message_queue.maximum_pending_messages;
canonical_queue->number_of_pending_messages = rtems_queue->message_queue.number_of_pending_messages;
}
void
rtems_monitor_queue_dump_header(
boolean verbose
)
{
printf("\
ID NAME ATTRIBUTES PEND MAXPEND MAXSIZE\n");
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
0 1 2 3 4 5 6 7 */
rtems_monitor_separator();
}
/*
* Dump out the "next" queue indicated by 'id'.
* Returns next one to check.
* Returns RTEMS_OBJECT_ID_FINAL when all done
*/
void
rtems_monitor_queue_dump(
rtems_monitor_queue_t *monitor_queue,
boolean verbose
)
{
unsigned32 length = 0;
length += rtems_monitor_dump_id(monitor_queue->id);
length += rtems_monitor_pad(11, length);
length += rtems_monitor_dump_name(monitor_queue->name);
length += rtems_monitor_pad(19, length);
length += rtems_monitor_dump_attributes(monitor_queue->attributes);
length += rtems_monitor_pad(31, length);
length += rtems_monitor_dump_decimal(monitor_queue->number_of_pending_messages);
length += rtems_monitor_pad(39, length);
length += rtems_monitor_dump_decimal(monitor_queue->maximum_pending_messages);
length += rtems_monitor_pad(48, length);
length += rtems_monitor_dump_decimal(monitor_queue->maximum_message_size);
printf("\n");
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-93
View File
@@ -1,93 +0,0 @@
/*
* RTEMS Monitor task support
*
* $Id$
*/
#include <rtems.h>
#include <rtems/monitor.h>
#include <stdio.h>
#include <string.h> /* memcpy() */
void
rtems_monitor_task_canonical(
rtems_monitor_task_t *canonical_task,
void *thread_void
)
{
Thread_Control *rtems_thread = (Thread_Control *) thread_void;
RTEMS_API_Control *api;
api = rtems_thread->API_Extensions[ THREAD_API_RTEMS ];
canonical_task->entry = rtems_thread->Start.entry_point;
canonical_task->argument = rtems_thread->Start.numeric_argument;
canonical_task->stack = rtems_thread->Start.Initial_stack.area;
canonical_task->stack_size = rtems_thread->Start.Initial_stack.size;
canonical_task->priority = rtems_thread->current_priority;
canonical_task->state = rtems_thread->current_state;
canonical_task->wait_id = rtems_thread->Wait.id;
canonical_task->events = api->pending_events;
/* XXX modes and attributes only exist in the RTEMS API .. */
/* XXX not directly in the core thread.. they will have to be derived */
/* XXX if they are important enough to include anymore. */
canonical_task->modes = 0; /* XXX FIX ME.... rtems_thread->current_modes; */
canonical_task->attributes = 0 /* XXX FIX ME rtems_thread->API_Extensions[ THREAD_API_RTEMS ]->attribute_set */;
(void) memcpy(canonical_task->notepad, api ->Notepads, sizeof(canonical_task->notepad));
/* XXX more to fix */
/*
(void) memcpy(&canonical_task->wait_args, &rtems_thread->Wait.Extra, sizeof(canonical_task->wait_args));
*/
}
void
rtems_monitor_task_dump_header(
boolean verbose
)
{
printf("\
ID NAME PRIO STAT MODES EVENTS WAITID WAITARG NOTES\n");
/*23456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
0 1 2 3 4 5 6 7 */
rtems_monitor_separator();
}
/*
*/
void
rtems_monitor_task_dump(
rtems_monitor_task_t *monitor_task,
boolean verbose
)
{
int length = 0;
length += rtems_monitor_dump_id(monitor_task->id);
length += rtems_monitor_pad(11, length);
length += rtems_monitor_dump_name(monitor_task->name);
length += rtems_monitor_pad(18, length);
length += rtems_monitor_dump_priority(monitor_task->priority);
length += rtems_monitor_pad(24, length);
length += rtems_monitor_dump_state(monitor_task->state);
length += rtems_monitor_pad(31, length);
length += rtems_monitor_dump_modes(monitor_task->modes);
length += rtems_monitor_pad(39, length);
length += rtems_monitor_dump_events(monitor_task->events);
if (monitor_task->wait_id)
{
length += rtems_monitor_pad(47, length);
length += rtems_monitor_dump_id(monitor_task->wait_id);
length += rtems_monitor_pad(57, length);
length += rtems_monitor_dump_hex(monitor_task->wait_args);
}
length += rtems_monitor_pad(65, length);
length += rtems_monitor_dump_notepad(monitor_task->notepad);
printf("\n");
}
File diff suppressed because it is too large. Load diff
-62
View File
@@ -1,62 +0,0 @@
/*
* RTEMS monitor symbol table functions
*
* Description:
* Entry points for symbol table routines.
*
*
*
* TODO:
*
* $Id$
*/
#ifndef _INCLUDE_SYMBOLS_H
#define _INCLUDE_SYMBOLS_H
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
rtems_unsigned32 value;
char *name;
} rtems_symbol_t;
#define SYMBOL_STRING_BLOCK_SIZE 4080
typedef struct rtems_symbol_string_block_s {
struct rtems_symbol_string_block_s *next;
char buffer[SYMBOL_STRING_BLOCK_SIZE];
} rtems_symbol_string_block_t;
typedef struct {
rtems_unsigned32 sorted; /* are symbols sorted right now? */
rtems_unsigned32 growth_factor; /* % to grow by when needed */
rtems_unsigned32 next; /* next symbol slot to use when adding */
rtems_unsigned32 size; /* max # of symbols */
/*
* Symbol list -- sorted by address (when we do a lookup)
*/
rtems_symbol_t *addresses; /* symbol array by address */
/*
* String pool, unsorted, a list of blocks of string data
*/
rtems_symbol_string_block_t *string_buffer_head;
rtems_symbol_string_block_t *string_buffer_current;
rtems_unsigned32 strings_next; /* next byte to use in this block */
} rtems_symbol_table_t;
#define rtems_symbol_name(sp) ((sp)->name)
#define rtems_symbol_value(sp) ((sp)->value)
#ifdef __cplusplus
}
#endif
#endif /* ! _INCLUDE_SYMBOLS_H */
-2
View File
@@ -1,2 +0,0 @@
Makefile
Makefile.in
-43
View File
@@ -1,43 +0,0 @@
##
## $Id$
##
include_rtemsdir = $(includedir)/rtems
LIBNAME = libmw-fb-tmp
LIB = ${ARCH}/${LIBNAME}.a
C_FILES = mw_fb.c mw_uid.c
C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT))
include_rtems_HEADERS = mw_fb.h mw_uid.h
SRCS = $(C_FILES)
OBJS = $(C_O_FILES)
include $(top_srcdir)/../../../automake/compile.am
include $(top_srcdir)/../../../automake/lib.am
$(PROJECT_INCLUDE)/rtems:
@$(mkinstalldirs) $@
$(PROJECT_INCLUDE)/rtems/%.h: %.h
$(INSTALL_DATA) $< $@
#
# (OPTIONAL) Add local stuff here using +=
#
${LIB}: ${OBJS}
$(make-library)
PREINSTALL_FILES = $(PROJECT_INCLUDE)/rtems \
$(include_rtems_HEADERS:%=$(PROJECT_INCLUDE)/rtems/%)
all-local: ${ARCH} $(PREINSTALL_FILES) $(LIB) $(TMPINSTALL_FILES)
.PRECIOUS: $(LIB)
EXTRA_DIST = $(C_FILES)
include $(top_srcdir)/../../../automake/local.am
-137
View File
@@ -1,137 +0,0 @@
/*
/////////////////////////////////////////////////////////////////////////////
// $Header$
//
// Copyright (c) 2000 - Rosimildo da Silva
//
// MODULE DESCRIPTION:
// Wrapper API around the ioctls calls for the Micro FrameBuffer
// interface for Embedded Systems
//
// All functions returns 0 on success. Any other value should be
// decoded as an error. A list of errors will be created over time.
//
// MODIFICATION/HISTORY:
//
// $Log$
//
/////////////////////////////////////////////////////////////////////////////
*/
#include <sys/ioctl.h>
#include <rtems/mw_fb.h>
/*
* This function returns the information regarding the display.
* It is called just after the driver be opened to get all needed
* information about the driver. No change in the mode of operation
* of the driver is done with this call.
*/
int ufb_get_screen_info( int fd, struct fb_screeninfo *info )
{
return ioctl( fd, FB_SCREENINFO, ( void *)info);
}
/*
* Returns the mode of the graphics subsystem
*/
int ufb_get_mode( int fd, int *mode )
{
struct fb_exec_function exec;
exec.func_no = FB_FUNC_GET_MODE;
exec.param = ( void *)mode;
return ioctl( fd, FB_EXEC_FUNCTION , ( void *)&exec );
}
/*
* Returns the current collor pallete
*/
int ufb_get_palette( int fd, struct fb_cmap *color )
{
return ioctl( fd, FB_GETPALETTE, ( void *)color );
}
/*
* Set the current collor pallete
*/
int ufb_set_palette( int fd, struct fb_cmap *color )
{
return ioctl( fd, FB_SETPALETTE, ( void *)color );
}
/*
* Does all necessary initialization to put the device in
* graphics mode
*/
int ufb_enter_graphics( int fd, int mode )
{
struct fb_exec_function exec;
exec.func_no = FB_FUNC_ENTER_GRAPHICS;
exec.param = ( void *)mode;
return ioctl( fd, FB_EXEC_FUNCTION , ( void *)&exec );
}
/*
* Switch the device back to the default mode of operation.
* In most cases it put the device back to plain text mode.
*/
int ufb_exit_graphics( int fd )
{
struct fb_exec_function exec;
exec.func_no = FB_FUNC_EXIT_GRAPHICS;
exec.param = 0;
return ioctl( fd, FB_EXEC_FUNCTION , ( void *)&exec );
}
/*
* Tell the driver that the "virtual buffer" is dirty, and an update
* of it to the real device, maybe a serial/parallel LCD or whatever
* is required
*/
int ufb_buffer_is_dirty( int fd )
{
struct fb_exec_function exec;
exec.func_no = FB_FUNC_IS_DIRTY;
exec.param = 0;
return ioctl( fd, FB_EXEC_FUNCTION , ( void *)&exec );
}
/*
* This function maps the physical ( kernel mode ) address of the framebuffer device
* and maps it to the user space address.
*/
int ufb_mmap_to_user_space( int fd, void **fb_addr, void *physical_addr, unsigned long size )
{
#ifdef __rtems__
/* RTEMS runs in ring 0, and there is no distinction between
user space and kernel space, so we just return the same
pointer to the caller.
*/
*fb_addr = physical_addr;
return 0;
#else
/* other kernels might want to map it to the user space,
maybe using mmap()
*/
return 0;
#endif
}
/*
* This function unmaps memory of the FB from the user's space
*/
int ufb_unmmap_from_user_space( int fd, void *addr )
{
return 0;
}
-153
View File
@@ -1,153 +0,0 @@
/*
/////////////////////////////////////////////////////////////////////////////
// $Header$
//
// Copyright (c) 2000 - Rosimildo da Silva
//
// MODULE DESCRIPTION:
// Micro FrameBuffer interface for Embedded Systems.
//
// MODIFICATION/HISTORY:
//
// $Log$
//
/////////////////////////////////////////////////////////////////////////////
*/
#ifndef _MW_FB_H
#define _MW_FB_H
#ifdef __cplusplus
extern "C" {
#endif
/* ioctls
0x46 is 'F' */
#define FB_SCREENINFO 0x4601
#define FB_GETPALETTE 0x4602
#define FB_SETPALETTE 0x4603
#define FB_EXEC_FUNCTION 0x4604
#define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */
#define FB_TYPE_PLANES 1 /* Non interleaved planes */
#define FB_TYPE_INTERLEAVED_PLANES 2 /* Interleaved planes */
#define FB_TYPE_TEXT 3 /* Text/attributes */
#define FB_TYPE_VGA_PLANES 4 /* EGA/VGA planes */
#define FB_TYPE_VIRTUAL_BUFFER 5 /* Virtual Buffer */
#define FB_VISUAL_MONO01 0 /* Monochr. 1=Black 0=White */
#define FB_VISUAL_MONO10 1 /* Monochr. 1=White 0=Black */
#define FB_VISUAL_TRUECOLOR 2 /* True color */
#define FB_VISUAL_PSEUDOCOLOR 3 /* Pseudo color (like atari) */
#define FB_VISUAL_DIRECTCOLOR 4 /* Direct color */
#define FB_VISUAL_STATIC_PSEUDOCOLOR 5 /* Pseudo color readonly */
#define FB_ACCEL_NONE 0 /* no hardware accelerator */
/* no dependency on any other header file */
typedef unsigned long __u32;
typedef unsigned short __u16;
struct fb_screeninfo {
__u32 xres; /* visible resolution */
__u32 yres;
__u32 bits_per_pixel; /* guess what */
__u32 line_length; /* number of chars per line */
volatile char *smem_start; /* Start of frame buffer mem */
/* (physical address) */
__u32 smem_len; /* Length of frame buffer mem */
__u32 type; /* see FB_TYPE_* */
__u32 visual; /* see FB_VISUAL_* */
};
struct fb_cmap {
__u32 start; /* First entry */
__u32 len; /* Number of entries */
__u16 *red; /* Red values */
__u16 *green;
__u16 *blue;
__u16 *transp; /* transparency, can be NULL */
};
/* type of function to be executed at the driver level */
#define FB_FUNC_ENTER_GRAPHICS 0
#define FB_FUNC_EXIT_GRAPHICS 1
#define FB_FUNC_IS_DIRTY 2
#define FB_FUNC_GET_MODE 3
struct fb_exec_function
{
int func_no;
void *param;
};
/* Micro Framebuffer API Wrapper */
/*
* This function returns the information regarding the display.
* It is called just after the driver be opened to get all needed
* information about the driver. No change in the mode of operation
* of the driver is done with this call.
*/
extern int ufb_get_screen_info( int fd, struct fb_screeninfo *info );
/*
* Returns the mode of the graphics subsystem
*/
extern int ufb_get_mode( int fd, int *mode );
/*
* Returns the current collor pallete
*/
extern int ufb_get_palette( int fd, struct fb_cmap *color );
/*
* Set the current collor pallete
*/
extern int ufb_set_palette( int fd, struct fb_cmap *color );
/*
* Does all necessary initialization to put the device in
* graphics mode
*/
extern int ufb_enter_graphics( int fd, int mode );
/*
* Switch the device back to the default mode of operation.
* In most cases it put the device back to plain text mode.
*/
extern int ufb_exit_graphics( int fd );
/*
* Tell the driver that the "virtual buffer" is dirty, and an update
* of it to the real device, maybe a serial/parallel LCD or whatever
* is required
*/
extern int ufb_buffer_is_dirty( int fd );
/*
* This function maps the physical ( kernel mode ) address of the framebuffer device
* and maps it to the user space address.
*/
int ufb_mmap_to_user_space( int fd, void **fb_addr, void *physical_addr, unsigned long size );
/*
* This function unmaps memory of the FB from the user's space
*/
int ufb_unmmap_from_user_space( int fd, void *addr );
#ifdef __cplusplus
}
#endif
#endif /* _MW_FB_H */
-185
View File
@@ -1,185 +0,0 @@
/*
/////////////////////////////////////////////////////////////////////////////
// $Header$
//
// Copyright (c) 2000 - Rosimildo da Silva
//
// MODULE DESCRIPTION:
// This module implements the input devices interface used by MicroWindows
// in an embedded system environment.
// It uses the RTEMS message queue as the repository for the messages posted
// by the devices registered.
//
// MODIFICATION/HISTORY:
//
// $Log$
// Revision 1.3 2000/11/30 14:36:46 joel
// 2000-11-30 Joel Sherrill <joel@OARcorp.com>
//
// * mw-fb/mw_uid.c: Removed unnecessary dependency on <bsp.h>.
//
// Revision 1.2 2000/08/30 17:12:55 joel
// 2000-08-30 Joel Sherrill <joel@OARcorp.com>
//
// * Many files: Moved posix/include/rtems/posix/seterr.h to
// score/include/rtems/seterr.h so it would be available within
// all APIs.
//
// Revision 1.1 2000/08/30 08:21:24 joel
// 2000-08-26 Rosimildo da Silva <rdasilva@connecttel.com>
//
// * Added generic Micro FrameBuffer interface for MicroWindows.
// This interface allows MicroWindows to under RTEMS. A sample
// driver has been developed for the pc386 BSP. See
// pc386/fb_vga.c as a sample.
// * Added Uniform Input Device interface for MicroWindows.
// See PC386 bsp for sample drivers for mouse and keyboard (console).
// * mw-bf: New directory.
// * Makefile.am, configure.in, wrapup/Makefile.am: Account for mw-fb.
// * mw-fb/Makefile.am: New file.
// * mw-fb/mw_fb.c: New file.
// * mw-fb/mw_fb.h: New file.
// * mw-fb/mw_uid.c: New file.
// * mw-fb/mw_uid.h: New file.
//
//
/////////////////////////////////////////////////////////////////////////////
*/
#include <stdio.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <rtems.h>
#include <rtems/mw_uid.h>
#include <rtems/seterr.h>
static rtems_id queue_id = 0;
static int open_count = 0;
/*
#define MW_DEBUG_ON 1
*/
/* open a message queue with the kernel */
int uid_open_queue( const char *q_name, int flags, size_t max_msgs )
{
static rtems_name queue_name;
/*
* For the first device calling this function we would create the queue.
* It is assumed that this call is done at initialization, and no concerns
* regarding multi-threading is taken in consideration here.
*/
if( !open_count )
{
rtems_status_code status;
queue_name = rtems_build_name( q_name[0],
q_name[1],
q_name[2],
q_name[3] );
status = rtems_message_queue_create( queue_name,
max_msgs,
sizeof( struct MW_UID_MESSAGE ),
RTEMS_FIFO | RTEMS_LOCAL,
&queue_id );
if( status != RTEMS_SUCCESSFUL )
{
#ifdef MW_DEBUG_ON
printk( "UID_Queue: error creating queue: %d\n", status );
#endif
return -1;
}
#ifdef MW_DEBUG_ON
printk( "UID_Queue: id=%X\n", queue_id );
#endif
}
open_count++;
return 0;
}
/* close message queue */
int uid_close_queue( void )
{
if( open_count == 1 )
{
rtems_message_queue_delete( queue_id );
queue_id = 0;
}
open_count--;
return 0;
}
/* reads for a message from the device */
int uid_read_message( struct MW_UID_MESSAGE *m, unsigned long timeout )
{
rtems_status_code status;
rtems_unsigned32 size = 0;
unsigned long micro_secs = timeout*1000;
int wait = ( timeout != 0 );
status = rtems_message_queue_receive( queue_id,
(void*)m,
&size,
wait ? RTEMS_WAIT : RTEMS_NO_WAIT,
TOD_MICROSECONDS_TO_TICKS(micro_secs ) );
if( status == RTEMS_SUCCESSFUL )
{
return size;
}
else if( ( status == RTEMS_UNSATISFIED ) || ( status == RTEMS_TIMEOUT ) )
{
/* this macro returns -1 */
rtems_set_errno_and_return_minus_one( ETIMEDOUT );
}
/* Here we have one error condition */
#ifdef MW_DEBUG_ON
printk( "UID_Queue: error reading queue: %d\n", status );
#endif
return -1;
}
/*
* add a message to the queue of events. This method cna be used to
* simulate hardware events, and it can be very handy during development
* a new interface.
*/
int uid_send_message( struct MW_UID_MESSAGE *m )
{
rtems_status_code status;
status = rtems_message_queue_send( queue_id, ( void * )m,
sizeof( struct MW_UID_MESSAGE ) );
return status == RTEMS_SUCCESSFUL ? 0 : -1;
}
/*
* register the device to insert events to the message
* queue named as the value passed in q_name
*/
int uid_register_device( int fd, const char *q_name )
{
return ioctl( fd, MW_UID_REGISTER_DEVICE, q_name );
}
/* tell this device to stop adding events to the queue */
int uid_unregister_device( int fd )
{
return ioctl( fd, MW_UID_UNREGISTER_DEVICE, NULL );
}
/* set the keyboard */
int uid_set_kbd_mode( int fd, int mode, int *old_mode )
{
if (ioctl( fd, MV_KDGKBMODE, old_mode) < 0)
{
return -1;
}
if (ioctl(fd, MV_KDSKBMODE, mode ) < 0 )
{
return -1;
}
return 0;
}
-143
View File
@@ -1,143 +0,0 @@
/*
/////////////////////////////////////////////////////////////////////////////
// $Header$
//
// Copyright (c) 2000 - Rosimildo da Silva
//
// MODULE DESCRIPTION:
// This module defines the interface for input devices used by MicroWindows
// in an embedded system environment.
//
// MODIFICATION/HISTORY:
//
// $Log$
//
/////////////////////////////////////////////////////////////////////////////
*/
#ifndef _MW_UID_H
#define _MW_UID_H
#ifdef __cplusplus
extern "C" {
#endif
/* 0x41XX -- IOCLT functions for the Micro Input Devices commands */
#define MW_UID_REGISTER_DEVICE 0x4100
#define MW_UID_UNREGISTER_DEVICE 0x4101
/* devices supported by MicroWindows */
enum MW_INPUT_DEVICE_TYPE
{
MV_UID_INVALID = 0,
MV_UID_REL_POS = 1, /* mouse */
MV_UID_ABS_POS = 2, /* touch-screen */
MV_UID_KBD = 3, /* keyboard */
MV_UID_TIMER = 4 /* timer -- not used */
};
/* matching MicroWindows */
#define MV_BUTTON_RIGHT 0x01
#define MV_BUTTON_CENTER 0x02
#define MV_BUTTON_LEFT 0x04
/* modifiers of the keyboard type devices */
#define MV_KEY_MODIFIER_SHIFT_DOWN 0x10
#define MV_KEY_MODIFIER_ALT_DOWN 0x20
/* indication of the LEDS */
#define MV_KEY_MODIFIER_CAPS_ON 0x04
#define MV_KEY_MODIFIER_NUN_LOCK_ON 0x02
#define MV_KEY_SCROLL_LOCK_ON 0x01
/* keyboard modes -- default ASCII */
#define MV_KEY_MODE_ASCII 0x01
/*
* This mode one event is sent when a key is pressed,
* and another one is send when a key is released.
*/
#define MV_KEY_MODE_SCANCODE 0x00
/* these defines match with the linux keyboard range
for ioctls functions for the keyboard interface.
0x4BXX --- keyboard related functions
*/
#define MV_KDGKBMODE 0x4B44 /* gets current keyboard mode */
#define MV_KDSKBMODE 0x4B45 /* sets current keyboard mode */
/*
* Message generated by input devices controlled by MicroWindows.
*/
struct MW_UID_MESSAGE
{
enum MW_INPUT_DEVICE_TYPE type; /* device type */
union
{
/* fired when keyboard events are raised */
struct kbd_t {
unsigned short code; /* keycode or scancode */
unsigned char modifiers; /* key modifiers */
unsigned char mode; /* current Kbd mode */
} kbd;
/* fired when position events are raised, mouse, touch screen, etc */
struct pos_t {
unsigned short btns; /* indicates which buttons are pressed */
short x; /* x location */
short y; /* y location */
short z; /* z location, 0 for 2D */
} pos;
/* fired by a timer device periodically */
struct timer_t {
unsigned long frt; /* free running timer */
unsigned long seq; /* sequence number */
} tmr;
} m;
};
/*
* API for creating/closing/accessing the message queue used by the micro
* input device interface. All functions in this interface returns a
* zero ( 0 ) on success. One exception for that is the "read" routine
* that returns the number of bytes read. Negaive numbers indicate errors
*
* The implementation of the message queue for RTEMS uses a POSIX message
* queue interface. It should be very portable among systems with a POSIX
* support.
*/
/* creates the message queue that holds events from the input devices */
extern int uid_open_queue( const char *q_name, int flags, size_t max_msgs );
/* closes message queue */
extern int uid_close_queue( void );
/*
* reads a message from the queue. It waits up to the specified
* timeout in mili-seconds.
*/
extern int uid_read_message( struct MW_UID_MESSAGE *m, unsigned long timeout );
/* write a message to the queue */
extern int uid_write_message( struct MW_UID_MESSAGE *m );
/* register device to insert data to the queue */
extern int uid_register_device( int fd, const char *q_name );
/* unregister device to stop adding messages to the queue */
extern int uid_unregister_device( int fd );
/* set the keyboard */
extern int uid_set_kbd_mode( int fd, int mode, int *old_mode );
#ifdef __cplusplus
}
#endif
#endif /* _MW_UID_H */
-2
View File
@@ -1,2 +0,0 @@
Makefile
Makefile.in
-42
View File
@@ -1,42 +0,0 @@
##
## $Id$
##
include_rtemsdir = $(includedir)/rtems
LIBNAME = librtmonuse-tmp
LIB = $(ARCH)/$(LIBNAME).a
C_FILES = rtmonuse.c
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
include_rtems_HEADERS = rtmonuse.h
OBJS = $(C_O_FILES)
include $(top_srcdir)/../../../automake/compile.am
include $(top_srcdir)/../../../automake/lib.am
$(PROJECT_INCLUDE)/rtems:
@$(mkinstalldirs) $@
$(PROJECT_INCLUDE)/rtems/%.h: %.h
$(INSTALL_DATA) $< $@
#
# (OPTIONAL) Add local stuff here using +=
#
$(LIB): $(OBJS)
$(make-library)
PREINSTALL_FILES = $(PROJECT_INCLUDE)/rtems \
$(include_rtems_HEADERS:%=$(PROJECT_INCLUDE)/rtems/%)
all-local: $(ARCH) $(PREINSTALL_FILES) $(OBJS) $(LIB)
.PRECIOUS: $(LIB)
EXTRA_DIST = rtmonuse.c
include $(top_srcdir)/../../../automake/local.am
-178
View File
@@ -1,178 +0,0 @@
/*
* $Id$
*/
#include <rtems.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <rtems/rtmonuse.h>
typedef struct {
rtems_id id;
unsigned32 count;
unsigned32 missed_count;
unsigned32 min_cpu_time;
unsigned32 max_cpu_time;
unsigned32 total_cpu_time;
unsigned32 min_wall_time;
unsigned32 max_wall_time;
unsigned32 total_wall_time;
} Period_usage_t;
Period_usage_t *Period_usage_Information;
/*PAGE
*
* Period_usage_Initialize
*/
void Period_usage_Initialize( void )
{
int maximum;
maximum = _Configuration_Table->RTEMS_api_configuration->maximum_periods;
Period_usage_Information = malloc( sizeof(Period_usage_t) * (maximum+1) );
Period_usage_Reset();
}
/*PAGE
*
* Period_usage_Reset
*/
void Period_usage_Reset( void )
{
unsigned32 i;
Period_usage_t *the_usage;
for ( i=0 ;
i<_Configuration_Table->RTEMS_api_configuration->maximum_periods ;
i++ ) {
the_usage = &Period_usage_Information[ i ];
the_usage->count = 0;
the_usage->missed_count = 0;
the_usage->min_cpu_time = 0xFFFFFFFF;
the_usage->max_cpu_time = 0;
the_usage->total_cpu_time = 0;
the_usage->min_wall_time = 0xFFFFFFFF;
the_usage->max_wall_time = 0;
the_usage->total_wall_time = 0;
}
}
/*PAGE
*
* Period_usage_Update
*/
void Period_usage_Update(
rtems_id id
)
{
rtems_rate_monotonic_period_status rm_status;
rtems_status_code status;
Period_usage_t *the_usage;
assert( Period_usage_Information );
status = rtems_rate_monotonic_get_status( id, &rm_status );
assert( status == RTEMS_SUCCESSFUL );
the_usage = &Period_usage_Information[ rtems_get_index( id ) ];
the_usage->id = id;
the_usage->count++;
if ( rm_status.state == RATE_MONOTONIC_EXPIRED )
the_usage->missed_count++;
the_usage->total_cpu_time += rm_status.ticks_executed_since_last_period;
the_usage->total_wall_time += rm_status.ticks_since_last_period;
/*
* Update CPU time
*/
if ( rm_status.ticks_executed_since_last_period < the_usage->min_cpu_time )
the_usage->min_cpu_time = rm_status.ticks_executed_since_last_period;
if ( rm_status.ticks_executed_since_last_period > the_usage->max_cpu_time )
the_usage->max_cpu_time = rm_status.ticks_executed_since_last_period;
/*
* Update Wall time
*/
if ( rm_status.ticks_since_last_period < the_usage->min_wall_time )
the_usage->min_wall_time = rm_status.ticks_since_last_period;
if ( rm_status.ticks_since_last_period > the_usage->max_wall_time )
the_usage->max_wall_time = rm_status.ticks_since_last_period;
}
/*PAGE
*
* Period_usage_Dump
*/
void Period_usage_Dump( void )
{
unsigned32 i;
Period_usage_t *the_usage;
Rate_monotonic_Control *the_period;
unsigned32 u32_name;
char name[5];
if ( !Period_usage_Information ) {
printf( "Period statistics library is not initialized\n" );
return;
}
printf( "Period information by period\n" );
printf( " ID OWNER PERIODS MISSED CPU TIME WALL TIME\n" );
/*
* RTEMS does not use an index of zero for object ids.
*/
for ( i=1 ;
i<_Configuration_Table->RTEMS_api_configuration->maximum_periods ;
i++ ) {
the_usage = &Period_usage_Information[ i ];
if ( the_usage->count == 0 )
continue;
the_period =
(Rate_monotonic_Control *)_Rate_monotonic_Information.local_table[ i ];
if ( the_period->owner )
u32_name = *(unsigned32 *)the_period->owner->Object.name;
else
u32_name = rtems_build_name(' ', ' ', ' ', ' ');
name[ 0 ] = (u32_name >> 24) & 0xff;
name[ 1 ] = (u32_name >> 16) & 0xff;
name[ 2 ] = (u32_name >> 8) & 0xff;
name[ 3 ] = (u32_name >> 0) & 0xff;
name[ 4 ] = '\0';
printf(
"0x%08x %4s %6d %3d %d/%d/%5.2f %d/%d/%3.2f\n",
the_usage->id,
name,
the_usage->count,
the_usage->missed_count,
the_usage->min_cpu_time,
the_usage->max_cpu_time,
(double) the_usage->total_cpu_time / (double) the_usage->count,
the_usage->min_wall_time,
the_usage->max_wall_time,
(double) the_usage->total_wall_time / (double) the_usage->count
);
}
}
-18
View File
@@ -1,18 +0,0 @@
/*
* $Id$
*/
#ifndef __RATE_MONOTONIC_USAGE_h
#define __RATE_MONOTONIC_USAGE_h
void Period_usage_Initialize( void );
void Period_usage_Reset( void );
void Period_usage_Update(
rtems_id id
);
void Period_usage_Dump( void );
#endif
-2
View File
@@ -1,2 +0,0 @@
Makefile
Makefile.in
-44
View File
@@ -1,44 +0,0 @@
##
## $Id$
##
include_rtemsdir = $(includedir)/rtems
LIBNAME = libserdbg-tmp
LIB = $(ARCH)/$(LIBNAME).a
C_FILES = serdbg.c serdbgio.c termios_printk.c
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
noinst_HEADERS =
include_HEADERS = serdbgcnf.h serdbg.h termios_printk_cnf.h \
termios_printk.h
OBJS = $(C_O_FILES)
include $(top_srcdir)/../../../automake/compile.am
include $(top_srcdir)/../../../automake/lib.am
$(PROJECT_INCLUDE):
@$(mkinstalldirs) $@
$(PROJECT_INCLUDE)/%.h: %.h
$(INSTALL_DATA) $< $@
#
# (OPTIONAL) Add local stuff here using +=
#
$(LIB): $(OBJS)
$(make-library)
PREINSTALL_FILES = $(PROJECT_INCLUDE) \
$(include_HEADERS:%=$(PROJECT_INCLUDE)/%)
all-local: $(ARCH) $(PREINSTALL_FILES) $(OBJS) $(LIB)
.PRECIOUS: $(LIB)
EXTRA_DIST = README serdbg.c serdbgio.c serdbgcnf.h serdbg.h \
termios_printk.c termios_printk.h termios_printk_cnf.h
include $(top_srcdir)/../../../automake/local.am
-138
View File
@@ -1,138 +0,0 @@
#
# $Id$
#
This directory contains three useful packages related to the termios I/O
system:
PACKAGE SERDBGIO
================
"serdbgio" provides the "serial gdb" standard I/O functions "getDebugChar"
and "putDebugChar" for any device driver supporting polled termios mode.
The initialization function "serdbg_open" opens the v.24 port intended
for the serial debug connection, and sets the desired baud rate. The
"getDebugChar" and "putDebugChar" functions then interact with the
corresponding driver using the calls intended for polled termios
operation.
Specification for the debug device, baud rate and other parameters is
done in a global structure of type "serdbg_conf_t". A configuration
mechanism quite similar to the overall RTEMS configuration is available.
PACKAGE SERDBG
==============
"serdbg" provides a means to optionally initialize and/or start a
serial gdb session as soon as possible, this means as soon as all
drivers have been initialized. The serial debug I/O functions can
either be integrated as special routines of the BSP drivers, or using
the package "serdbgio"
PACKAGE TERMIOS_PRINTK
======================
"termios_printk" provides a standard output function suitable to use
with "printk". It uses the same technique as serdbgio, hooking the
interface between a polled device driver and the termios system.
REQUIREMENTS
============
- These two packages can be used with any polled termios device
driver.
- For standard initialization, they need a modified "bsppost.c"
to perform the initialization calls.
USAGE
=====
For using these packages add the following to your "init" module or
your "system.h" file (Note: most macro settings fall back to a
default, if not set.):
/*
* CONFIGURE_USE_SERDBG
* set this macro, if you want to connect gdb over a serial line
* when set, the debug stub will be connected after driver
* initialization in "bsppost.c"
*/
#define CONFIGURE_USE_SERDBG
/*
* CONFIGURE_SERDBG_SKIP_INIT_BKPT
* set this macro, if you do not want the gdb interface to wait for a
* debugger connection directly after initialization
* If you set this macro, the gdb stub will only hook various
* exception vectors when called from "bsppost.c".
*/
/* #define CONFIGURE_SERDBG_SKIP_INIT_BKPT */
/*
* CONFIGURE_SERDBG_USE_POLLED_TERMIOS
* set this macro, if you want "serdbgio" to provide the I/O
* functions for the serial gdb connection
*/
#define CONFIGURE_SERDBG_USE_POLLED_TERMIOS
/*
* CONFIGURE_SERDBG_DEVNAME
* use this macro to specify the serial device to use
* for "serdbgio".
* Only used, when CONFIGURE_SERDBG_USE_POLLED_TERMIOS is set
*/
#define CONFIGURE_SERDBG_DEVNAME "/dev/tty03"
/*
* CONFIGURE_SERDBG_BAUDRATE
* use this macro to specify the baud rate to use
* for "serdbgio".
* Only used, when CONFIGURE_SERDBG_USE_POLLED_TERMIOS is set
*/
#define CONFIGURE_SERDBG_BAUDRATE 57600
/*
* CONFIGURE_SERDBG_CALLOUT
* use this macro to specify a routine that will called during I/O polling
* Only used, when CONFIGURE_SERDBG_USE_POLLED_TERMIOS is set
* This function of type "void pollfnc(void)" can be used for e.g.
* tickling a watchdog
*/
/* #define CONFIGURE_SERDBG_CALLOUT tickle_my_watchdog_fnc */
#include <serdbgcnf.h>
/*
* CONFIGURE_USE_TERMIOS_PRINTK
* set this macro, if you want printk output to be sent to a serial
* driver using the polled termios interface
* when set, the printk output function will be connected after driver
* initialization in "bsppost.c"
*/
#define CONFIGURE_USE_TERMIOS_PRINTK
/*
* CONFIGURE_TERMIOS_PRINTK_DEVNAME
* use this macro to specify the serial device to use
* for printk output.
* Only used, when CONFIGURE_USE_TERMIOS_PRINTK is set
*/
#define CONFIGURE_TERMIOS_PRINTK_DEVNAME "/dev/console"
/*
* CONFIGURE_TERMIOS_PRINTK_BAUDRATE
* use this macro to specify the baudrate to use
* for printk output.
* Only used, when CONFIGURE_USE_TERMIOS_PRINTK is set
*/
#define CONFIGURE_TERMIOS_PRINTK_BAUDRATE 9600
/*
* CONFIGURE_TERMIOS_PRINTK_CALLOUT
* use this macro to specify a routine that will called during I/O polling
* This function of type "void pollfnc(void)" can be used for e.g.
* tickling a watchdog
*/
/* #define CONFIGURE_TERMIOS_PRINTK_CALLOUT tickle_my_watchdog_fnc */
#include <termios_printk_cnf.h>
-90
View File
@@ -1,90 +0,0 @@
/*===============================================================*\
| Project: RTEMS remote gdb over serial line |
+-----------------------------------------------------------------+
| File: serdbg.c |
+-----------------------------------------------------------------+
| Copyright (c) 2002 IMD |
| Ingenieurbuero fuer Microcomputertechnik Th. Doerfler |
| <Thomas.Doerfler@imd-systems.de> |
| all rights reserved |
+-----------------------------------------------------------------+
| this file contains intialization and utility functions to add |
| a gdb remote debug stub to an RTEMS system |
| |
+-----------------------------------------------------------------+
| date history ID |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 04.04.02 creation doe |
\*===============================================================*/
/*
* $Id$
*/
#include <rtems.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <serdbg.h>
/*=========================================================================*\
| Function: |
\*-------------------------------------------------------------------------*/
int serdbg_init_dbg
(
/*-------------------------------------------------------------------------*\
| Purpose: |
| initialize remote gdb session over serial line |
+---------------------------------------------------------------------------+
| Input Parameters: |
\*-------------------------------------------------------------------------*/
void
)
/*-------------------------------------------------------------------------*\
| Return Value: |
| rtems_status_code |
\*=========================================================================*/
{
static boolean is_initialized = FALSE;
rtems_status_code rc = RTEMS_SUCCESSFUL;
extern void set_debug_traps(void);
extern void breakpoint(void);
if (is_initialized) {
return RTEMS_SUCCESSFUL;
}
is_initialized = TRUE;
/*
* try to open serial device
*/
if (rc == RTEMS_SUCCESSFUL) {
if ((serdbg_conf.open_io != NULL) &&
(0 > serdbg_conf.open_io(serdbg_conf.devname,serdbg_conf.baudrate))) {
fprintf(stderr,
"remote_gdb_init: cannot open device %s "
"for gdb connection:%s\n",serdbg_conf.devname,strerror(errno));
rc = RTEMS_IO_ERROR;
}
}
/*
* initialize gdb stub
*/
if (rc == RTEMS_SUCCESSFUL) {
set_debug_traps();
}
/*
* now activate gdb stub
*/
if ((rc == RTEMS_SUCCESSFUL) &&
!serdbg_conf.skip_init_bkpt) {
breakpoint();
}
/*
* return to original function
* this may be already unter gdb control
*/
return rc;
}
-174
View File
@@ -1,174 +0,0 @@
/*===============================================================*\
| Project: RTEMS remote gdb over serial line |
+-----------------------------------------------------------------+
| File: serdbg.h |
+-----------------------------------------------------------------+
| Copyright (c) 2002 IMD |
| Ingenieurbuero fuer Microcomputertechnik Th. Doerfler |
| <Thomas.Doerfler@imd-systems.de> |
| all rights reserved |
+-----------------------------------------------------------------+
| this file declares intialization functions to add |
| a gdb remote debug stub to an RTEMS system |
| |
+-----------------------------------------------------------------+
| date history ID |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 04.04.02 creation doe |
\*===============================================================*/
/*
* $Id$
*/
#ifndef _SERDBG_H
#define _SERDBG_H
#include <rtems.h>
#include <termios.h>
typedef struct {
unsigned32 baudrate; /* debug baud rate, e.g. 57600 */
void (*callout)(void); /* callout pointer during polling */
int (*open_io)(const char *dev_name,unsigned32 baudrate); /* I/O open fnc */
const char *devname; /* debug device, e.g. "/dev/tty01" */
unsigned8 skip_init_bkpt; /* if TRUE, do not stop when initializing */
} serdbg_conf_t;
/*
* must be defined in init module...
*/
extern serdbg_conf_t serdbg_conf;
/*=========================================================================*\
| Function: |
\*-------------------------------------------------------------------------*/
void putDebugChar
(
/*-------------------------------------------------------------------------*\
| Purpose: |
| send character to remote debugger |
+---------------------------------------------------------------------------+
| Input Parameters: |
\*-------------------------------------------------------------------------*/
char c /* char to send */
);
/*-------------------------------------------------------------------------*\
| Return Value: |
| <none> |
\*=========================================================================*/
/*=========================================================================*\
| Function: |
\*-------------------------------------------------------------------------*/
int getDebugChar
(
/*-------------------------------------------------------------------------*\
| Purpose: |
| get character from remote debugger |
+---------------------------------------------------------------------------+
| Input Parameters: |
\*-------------------------------------------------------------------------*/
void /* <none> */
);
/*-------------------------------------------------------------------------*\
| Return Value: |
| <none> |
\*=========================================================================*/
/*=========================================================================*\
| Function: |
\*-------------------------------------------------------------------------*/
void serdbg_exceptionHandler
(
/*-------------------------------------------------------------------------*\
| Purpose: |
| hook directly to an exception vector |
+---------------------------------------------------------------------------+
| Input Parameters: |
\*-------------------------------------------------------------------------*/
int vecnum, /* vector index to hook at */
void *vector /* address of handler function */
);
/*-------------------------------------------------------------------------*\
| Return Value: |
| <none> |
\*=========================================================================*/
/*=========================================================================*\
| Function: |
\*-------------------------------------------------------------------------*/
int serdbg_init
(
/*-------------------------------------------------------------------------*\
| Purpose: |
| initialize remote gdb session over serial line |
+---------------------------------------------------------------------------+
| Input Parameters: |
\*-------------------------------------------------------------------------*/
void
);
/*-------------------------------------------------------------------------*\
| Return Value: |
| rtems_status_code |
\*=========================================================================*/
/*
* stuff from serdbgio.c
*/
/*=========================================================================*\
| Function: |
\*-------------------------------------------------------------------------*/
int serdbg_open
/*-------------------------------------------------------------------------*\
| Purpose: |
| try to open given serial debug port |
+---------------------------------------------------------------------------+
| Input Parameters: |
\*-------------------------------------------------------------------------*/
(
const char *dev_name, /* name of device to open */
unsigned32 baudrate /* baud rate to use */
);
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0 on success, -1 and errno otherwise |
\*=========================================================================*/
/*=========================================================================*\
| Function: |
\*-------------------------------------------------------------------------*/
void putDebugChar
/*-------------------------------------------------------------------------*\
| Purpose: |
| send one character to serial port |
+---------------------------------------------------------------------------+
| Input Parameters: |
\*-------------------------------------------------------------------------*/
(
char c /* character to print */
);
/*-------------------------------------------------------------------------*\
| Return Value: |
| <none> |
\*=========================================================================*/
/*=========================================================================*\
| Function: |
\*-------------------------------------------------------------------------*/
int getDebugChar
/*-------------------------------------------------------------------------*\
| Purpose: |
| wait for one character from serial port |
+---------------------------------------------------------------------------+
| Input Parameters: |
\*-------------------------------------------------------------------------*/
(
void /* none */
);
/*-------------------------------------------------------------------------*\
| Return Value: |
| received character |
\*=========================================================================*/
#endif /* _SERDBG_H */
-81
View File
@@ -1,81 +0,0 @@
/*===============================================================*\
| Project: RTEMS configure remote gdb over serial line |
+-----------------------------------------------------------------+
| File: serdbgcnf.h |
+-----------------------------------------------------------------+
| Copyright (c) 2002 IMD |
| Ingenieurbuero fuer Microcomputertechnik Th. Doerfler |
| <Thomas.Doerfler@imd-systems.de> |
| all rights reserved |
+-----------------------------------------------------------------+
| this file declares intialization functions to add |
| a gdb remote debug stub to an RTEMS system |
| |
+-----------------------------------------------------------------+
| date history ID |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 13.05.02 creation doe |
\*===============================================================*/
/*
* $Id$
*/
#ifndef _SERDBGCNF_H
#define _SERDBGCNF_H
#include "serdbg.h"
#ifdef CONFIGURE_INIT
/*
* fallback for baud rate to use
*/
#ifndef CONFIGURE_SERDBG_BAUDRATE
#define CONFIGURE_SERDBG_BAUDRATE 9600
#endif
/*
* fallback for device name to use
*/
#ifndef CONFIGURE_SERDBG_DEVNAME
#define CONFIGURE_SERDBG_DEVNAME "/dev/tty01"
#endif
/*
* fill in serdbg_conf structure
*/
serdbg_conf_t serdbg_conf = {
CONFIGURE_SERDBG_BAUDRATE,
#ifdef CONFIGURE_SERDBG_CALLOUT
CONFIGURE_SERDBG_CALLOUT,
#else
NULL,
#endif
#ifdef CONFIGURE_SERDBG_USE_POLLED_TERMIOS
serdbg_open,
#else
NULL,
#endif
CONFIGURE_SERDBG_DEVNAME,
#ifdef CONFIGURE_SERDBG_SKIP_INIT_BKPT
TRUE,
#else
FALSE,
#endif
};
int serdbg_init(void) {
#ifdef CONFIGURE_USE_SERDBG
extern int serdbg_init_dbg(void);
return serdbg_init_dbg();
#else
return 0;
#endif
}
#endif /* CONFIGURE_INIT */
#endif /* _SERDBGCNF_H */
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-95
View File
@@ -1,95 +0,0 @@
/*===============================================================*\
| Project: RTEMS remote gdb over serial line |
+-----------------------------------------------------------------+
| File: termios_printk.h |
+-----------------------------------------------------------------+
| Copyright (c) 2002 IMD |
| Ingenieurbuero fuer Microcomputertechnik Th. Doerfler |
| <Thomas.Doerfler@imd-systems.de> |
| all rights reserved |
+-----------------------------------------------------------------+
| this file declares intialization functions to add |
| printk polled output via termios polled drivers |
| |
+-----------------------------------------------------------------+
| date history ID |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 13.04.02 creation doe |
\*===============================================================*/
/*
* $Id$
*/
#ifndef _TERMIOS_PRINTK_H
#define _TERMIOS_PRINTK_H
#include <rtems.h>
#include <termios.h>
typedef struct {
unsigned32 baudrate; /* debug baud rate, e.g. 57600 */
void (*callout)(void); /* callout pointer during polling */
const char *devname; /* debug device, e.g. "/dev/tty01" */
} termios_printk_conf_t;
/*
* must be defined in init module...
*/
extern termios_printk_conf_t termios_printk_conf;
/*=========================================================================*\
| Function: |
\*-------------------------------------------------------------------------*/
void termios_printk_outputchar
/*-------------------------------------------------------------------------*\
| Purpose: |
| send one character to serial port |
+---------------------------------------------------------------------------+
| Input Parameters: |
\*-------------------------------------------------------------------------*/
(
char c /* character to print */
);
/*-------------------------------------------------------------------------*\
| Return Value: |
| <none> |
\*=========================================================================*/
/*=========================================================================*\
| Function: |
\*-------------------------------------------------------------------------*/
char termios_printk_inputchar
/*-------------------------------------------------------------------------*\
| Purpose: |
| wait for one character from serial port |
+---------------------------------------------------------------------------+
| Input Parameters: |
\*-------------------------------------------------------------------------*/
(
void /* none */
);
/*-------------------------------------------------------------------------*\
| Return Value: |
| received character |
\*=========================================================================*/
/*=========================================================================*\
| Function: |
\*-------------------------------------------------------------------------*/
int termios_printk_open
/*-------------------------------------------------------------------------*\
| Purpose: |
| try to open given serial debug port |
+---------------------------------------------------------------------------+
| Input Parameters: |
\*-------------------------------------------------------------------------*/
(
const char *dev_name, /* name of device to open */
unsigned32 baudrate /* baud rate to use */
);
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0 on success, -1 and errno otherwise |
\*=========================================================================*/
#endif /* _TERMIOS_PRINTK_H */
-70
View File
@@ -1,70 +0,0 @@
/*===============================================================*\
| Project: RTEMS configure remote gdb over serial line |
+-----------------------------------------------------------------+
| File: termios_printk_cnf.h |
+-----------------------------------------------------------------+
| Copyright (c) 2002 IMD |
| Ingenieurbuero fuer Microcomputertechnik Th. Doerfler |
| <Thomas.Doerfler@imd-systems.de> |
| all rights reserved |
+-----------------------------------------------------------------+
| this file declares intialization functions to add |
| printk support via polled termios |
| |
+-----------------------------------------------------------------+
| date history ID |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 13.05.02 creation doe |
\*===============================================================*/
/*
* $Id$
*/
#ifndef _TERMIOS_PRINTK_CNF_H
#define _TERMIOS_PRINTK_CNF_H
#include "termios_printk.h"
#ifdef CONFIGURE_INIT
/*
* fallback for baud rate to use
*/
#ifndef CONFIGURE_TERMIOS_PRINTK_BAUDRATE
#define CONFIGURE_TERMIOS_PRINTK_BAUDRATE 9600
#endif
/*
* fallback for device name to use
*/
#ifndef CONFIGURE_TERMIOS_PRINTK_DEVNAME
#define CONFIGURE_TERMIOS_PRINTK_DEVNAME "/dev/console"
#endif
#ifdef CONFIGURE_USE_TERMIOS_PRINTK
/*
* fill in termios_printk_conf structure
*/
termios_printk_conf_t termios_printk_conf = {
CONFIGURE_TERMIOS_PRINTK_BAUDRATE,
#ifdef CONFIGURE_TERMIOS_PRINTK_CALLOUT
CONFIGURE_TERMIOS_PRINTK_CALLOUT,
#else
NULL,
#endif
CONFIGURE_TERMIOS_PRINTK_DEVNAME,
};
#endif
int termios_printk_init(void) {
#ifdef CONFIGURE_USE_TERMIOS_PRINTK
return termios_printk_open(termios_printk_conf.devname,
termios_printk_conf.baudrate);
#else
return 0;
#endif
}
#endif /* CONFIGURE_INIT */
#endif /* _TERMIOS_PRINTK_CNF_H */
-2
View File
@@ -1,2 +0,0 @@
Makefile
Makefile.in
-46
View File
@@ -1,46 +0,0 @@
##
## $Id$
##
include_rtemsdir = $(includedir)/rtems
LIBNAME = libshell-tmp
LIB = $(ARCH)/$(LIBNAME).a
C_FILES = cmds.c shell.c
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
if RTEMS_LIBSHELL
include_rtems_HEADERS = shell.h
endif
OBJS = $(C_O_FILES)
include $(top_srcdir)/../../../automake/compile.am
include $(top_srcdir)/../../../automake/lib.am
$(PROJECT_INCLUDE)/rtems:
@$(mkinstalldirs) $@
$(PROJECT_INCLUDE)/rtems/%.h: %.h
$(INSTALL_DATA) $< $@
#
# (OPTIONAL) Add local stuff here using +=
#
$(LIB): $(OBJS)
$(make-library)
PREINSTALL_FILES = $(PROJECT_INCLUDE)/rtems \
$(include_rtems_HEADERS:%=$(PROJECT_INCLUDE)/rtems/%)
if RTEMS_LIBSHELL
all-local: $(ARCH) $(PREINSTALL_FILES) $(OBJS) $(LIB)
endif
.PRECIOUS: $(LIB)
EXTRA_DIST = README shell.c cmds.c shell.h
include $(top_srcdir)/../../../automake/local.am
-27
View File
@@ -1,27 +0,0 @@
#
# $Id$
#
This directory contains a shell user extension
primary features:
+ create a user shell terminal task.
This code has not been extensively tested. It is provided as a tool
for RTEMS users to open more shell terminal.
Suggestions and comments are appreciated.
NOTES:
1. printf() & getchar() works but you can't use
0,1,2 like fildes. You need to use fileno(stdin),fileno(stdout),...
2. You only need a termios dev to start a new session, add your new commands
and enjoy it.
3. Telnetd daemon uses this (browse libnetworking/rtems_telnetd)
Enjoy it.
FUTURE:
1. Adding new commands in cmds.c to give file manegement to shell.
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-88
View File
@@ -1,88 +0,0 @@
/*
*
* Instantatiate a new terminal shell.
*
* Author:
*
* WORK: fernando.ruiz@ctv.es
* HOME: correo@fernando-ruiz.com
*
* Thanks at:
* Chris John
*
* $Id$
*/
#ifndef __SHELL_H__
#define __SHELL_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <rtems.h>
#include <stdio.h>
#include <termios.h>
typedef int (*shell_command_t)(int argc,char * argv[]);
struct shell_cmd_tt ;
typedef struct shell_cmd_tt shell_cmd_t;
struct shell_cmd_tt {
char * name;
char * usage;
char * topic;
shell_command_t command;
shell_cmd_t * alias;
shell_cmd_t * next;
};
rtems_unsigned32 new_rtems_name(char * rtems_name);
shell_cmd_t * shell_lookup_cmd(char * cmd);
shell_cmd_t * shell_add_cmd(char * cmd,
char * topic,
char * usage,
shell_command_t command);
shell_cmd_t * shell_alias_cmd(char * cmd, char * alias);
int shell_make_args(char * cmd,
int * pargc,
char * argv[]);
typedef struct {
rtems_name magic; /* 'S','E','N','V': Shell Environment */
char * devname;
char * taskname;
tcflag_t tcflag;
/* user extensions */
int exit_shell; /* logout */
int forever ; /* repeat login */
int errorlevel;
int mdump_adr;
} shell_env_t;
int shell_scanline(char * line,int size,FILE * in,FILE * out) ;
void cat_file(FILE * out,char *name);
void write_file(char *name,char * content);
rtems_status_code shell_init(char * task_name ,
rtems_unsigned32 task_stacksize,/*0 default*/
rtems_task_priority task_priority ,
char * devname ,
tcflag_t tcflag ,
int forever );
extern shell_env_t global_shell_env,
* current_shell_env;
/*--------*/
/* cmds.c */
/*--------*/
int str2int(char * s);
void register_cmds(void);
#ifdef __cplusplus
}
#endif
#endif
-2
View File
@@ -1,2 +0,0 @@
Makefile
Makefile.in
-43
View File
@@ -1,43 +0,0 @@
##
## $Id$
##
include_rtemsdir = $(includedir)/rtems
LIBNAME = libstackchk-tmp
LIB = $(ARCH)/$(LIBNAME).a
C_FILES = check.c
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
noinst_HEADERS = internal.h
include_rtems_HEADERS = stackchk.h
OBJS = $(C_O_FILES)
include $(top_srcdir)/../../../automake/compile.am
include $(top_srcdir)/../../../automake/lib.am
$(PROJECT_INCLUDE)/rtems:
@$(mkinstalldirs) $@
$(PROJECT_INCLUDE)/rtems/%.h: %.h
$(INSTALL_DATA) $< $@
#
# (OPTIONAL) Add local stuff here using +=
#
$(LIB): $(OBJS)
$(make-library)
PREINSTALL_FILES = $(PROJECT_INCLUDE)/rtems \
$(include_rtems_HEADERS:%=$(PROJECT_INCLUDE)/rtems/%)
all-local: $(ARCH) $(PREINSTALL_FILES) $(OBJS) $(LIB)
.PRECIOUS: $(LIB)
EXTRA_DIST = README check.c
include $(top_srcdir)/../../../automake/local.am
-56
View File
@@ -1,56 +0,0 @@
#
# $Id$
#
Introduction
============
This directory contains a stack bounds checker. It provides two
primary features:
+ check for stack overflow at each context switch
+ provides an educated guess at each task's stack usage
Enabling
========
Add the stack checker extension to the initial user extension set.
If using confdefs.h to build your configuration table, this is
as simple as adding -DSTACK_CHECK_ON to the gcc command line which
compiles the file defining the configuration table. In the RTEMS
test suites and samples, this is always init.c
Background
==========
The stack overflow check at context switch works by looking for
a 16 byte pattern at the logical end of the stack to be corrupted.
The "guesser" assumes that the entire stack was prefilled with a known
pattern and assumes that the pattern is still in place if the memory
has not been used as a stack.
Both of these can be fooled by pushing large holes onto the stack
and not writing to them... or (much more unlikely) writing the
magic patterns into memory.
This code has not been extensively tested. It is provided as a tool
for RTEMS users to catch the most common mistake in multitasking
systems ... too little stack space. Suggestions and comments are appreciated.
NOTES:
1. Stack usage information is questionable on CPUs which push
large holes on stack.
2. The stack checker has a tendency to generate a fault when
trying to print the helpful diagnostic message. If it comes
out, congratulations. If not, then the variable Stack_check_Blown_task
contains a pointer to the TCB of the offending task. This
is usually enough to go on.
FUTURE:
1. Determine how/if gcc will generate stack probe calls and support that.
2. Get accurate stack usage numbers on i960.. it pushes very large
holes on the stack.
File diff suppressed because it is too large. Load diff
-95
View File
@@ -1,95 +0,0 @@
/* internal.h
*
* This include file contains internal information
* for the RTEMS stack checker.
*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.OARcorp.com/rtems/license.html.
*
* $Id$
*/
#ifndef __INTERNAL_STACK_CHECK_h
#define __INTERNAL_STACK_CHECK_h
#ifdef __cplusplus
extern "C" {
#endif
/*
* This structure is used to fill in and compare the "end of stack"
* marker pattern.
* pattern area must be a multiple of 4 words.
*/
#ifdef CPU_STACK_CHECK_SIZE
#define PATTERN_SIZE_WORDS (((CPU_STACK_CHECK_SIZE / 4) + 3) & ~0x3)
#else
#define PATTERN_SIZE_WORDS (4)
#endif
#define PATTERN_SIZE_BYTES (PATTERN_SIZE_WORDS * sizeof(unsigned32))
typedef struct {
unsigned32 pattern[ PATTERN_SIZE_WORDS ];
} Stack_check_Control;
/*
* The pattern used to fill the entire stack.
*/
#define BYTE_PATTERN 0xA5
#define U32_PATTERN 0xA5A5A5A5
/*
* Stack_check_Create_extension
*/
boolean Stack_check_Create_extension(
Thread_Control *running,
Thread_Control *the_thread
);
/*
* Stack_check_Begin_extension
*/
void Stack_check_Begin_extension(
Thread_Control *the_thread
);
/*
* Stack_check_Switch_extension
*/
void Stack_check_Switch_extension(
Thread_Control *running,
Thread_Control *heir
);
/*
* Stack_check_Fatal_extension
*/
void Stack_check_Fatal_extension(
Internal_errors_Source source,
boolean is_internal,
unsigned32 status
);
/*
* Stack_check_Dump_usage
*/
void Stack_check_Dump_usage( void );
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */
-82
View File
@@ -1,82 +0,0 @@
/* stackchk.h
*
* This include file contains information necessary to utilize
* and install the stack checker mechanism.
*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.OARcorp.com/rtems/license.html.
*
* $Id$
*/
#ifndef __STACK_CHECK_h
#define __STACK_CHECK_h
#ifdef __cplusplus
extern "C" {
#endif
/*
* Stack_check_Initialize
*/
void Stack_check_Initialize( void );
/*
* Stack_check_Dump_usage
*/
void Stack_check_Dump_usage( void );
/*
* Stack_check_Create_extension
*/
boolean Stack_check_Create_extension(
Thread_Control *running,
Thread_Control *the_thread
);
/*
* Stack_check_Begin_extension
*/
void Stack_check_Begin_extension(
Thread_Control *the_thread
);
/*
* Stack_check_Switch_extension
*/
void Stack_check_Switch_extension(
Thread_Control *running,
Thread_Control *heir
);
/*
* Extension set definition
*/
#define STACK_CHECKER_EXTENSION \
{ \
Stack_check_Create_extension, /* rtems_task_create */ \
0, /* rtems_task_start */ \
0, /* rtems_task_restart */ \
0, /* rtems_task_delete */ \
Stack_check_Switch_extension, /* task_switch */ \
Stack_check_Begin_extension, /* task_begin */ \
0, /* task_exitted */ \
0 /* Stack_check_Fatal_extension */, /* fatal */ \
}
#ifdef __cplusplus
}
#endif
#endif
/* end of include file */
-2
View File
@@ -1,2 +0,0 @@
Makefile
Makefile.in
-42
View File
@@ -1,42 +0,0 @@
##
## $Id$
##
include_rtemsdir = $(includedir)/rtems
LIBNAME = libuntar-tmp
LIB = $(ARCH)/$(LIBNAME).a
C_FILES = untar.c
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
include_rtems_HEADERS = untar.h
OBJS = $(C_O_FILES)
include $(top_srcdir)/../../../automake/compile.am
include $(top_srcdir)/../../../automake/lib.am
$(PROJECT_INCLUDE)/rtems:
@$(mkinstalldirs) $@
$(PROJECT_INCLUDE)/rtems/%.h: %.h
$(INSTALL_DATA) $< $@
#
# (OPTIONAL) Add local stuff here using +=
#
$(LIB): $(OBJS)
$(make-library)
PREINSTALL_FILES = $(PROJECT_INCLUDE)/rtems \
$(include_rtems_HEADERS:%=$(PROJECT_INCLUDE)/rtems/%)
all-local: $(ARCH) $(PREINSTALL_FILES) $(OBJS) $(LIB)
.PRECIOUS: $(LIB)
EXTRA_DIST = README untar.c
include $(top_srcdir)/../../../automake/local.am
-26
View File
@@ -1,26 +0,0 @@
#
#
# untar information
#
# Author: Jake Janovetz 7.6.1999
#
# $Id$
#
untar.c contains two procedures for extracting files from a UNIX
tar file:
int Untar_FromMemory(unsigned char *tar_buf, unsigned long size);
int Untar_FromFile(char *tar_name);
Untar_FromMemory(...) takes its input from a chunk of allocated memory.
This is particularly useful when the tar is stored in Flash memory or
comes from the FTP daemon by way of a hook.
Untar_FromFile(...) is identical except the source is from an existing
file. The fully qualified filename is passed through char *tar_name.
BUGS: Please email janovetz@uiuc.edu
-----
File diff suppressed because it is too large. Load diff
-25
View File
@@ -1,25 +0,0 @@
/*
* Written by: Jake Janovetz <janovetz@tempest.ece.uiuc.edu>
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.OARcorp.com/rtems/license.html.
*
* $Id$
*/
#ifndef __UNTAR_H__
#define __UNTAR_H__
#define UNTAR_SUCCESSFUL 0
#define UNTAR_FAIL 1
#define UNTAR_INVALID_CHECKSUM 2
#define UNTAR_INVALID_HEADER 3
int Untar_FromMemory(unsigned char *tar_buf, unsigned long size);
int Untar_FromFile(char *tar_name);
#endif /* __UNTAR_H__ */
-2
View File
@@ -1,2 +0,0 @@
Makefile
Makefile.in
-39
View File
@@ -1,39 +0,0 @@
##
## $Id$
##
LIB = $(ARCH)/libmisc.a
include $(top_srcdir)/../../../automake/compile.am
include $(top_srcdir)/../../../automake/lib.am
## XXX temporarily remove this from the list because it causes a
## XXX number of BSPs to not link "main(){}" used by autoconf
## ../serdbg/$(ARCH)/libserdbg-tmp.a
if RTEMS_LIBSHELL
RTEMS_LIBSHELL = ../shell/$(ARCH)/libshell-tmp.a
endif
TMP_LIBS = ../monitor/$(ARCH)/libmonitor-tmp.a \
../untar/$(ARCH)/libuntar-tmp.a ../stackchk/$(ARCH)/libstackchk-tmp.a \
../cpuuse/$(ARCH)/libcpuuse-tmp.a ../rtmonuse/$(ARCH)/librtmonuse-tmp.a \
$(RTEMS_LIBSHELL) ../dumpbuf/$(ARCH)/libdumpbuf-tmp.a \
../devnull/$(ARCH)/libdevnull-tmp.a ../dummy/$(ARCH)/libdummy-tmp.a \
../mw-fb/$(ARCH)/libmw-fb-tmp.a ../capture/$(ARCH)/libcapture-tmp.a
#
# (OPTIONAL) Add local stuff here using +=
#
$(LIB): $(TMP_LIBS)
$(RM) $@
$(RM) -r $(ARCH)
mkdir $(ARCH)
cd $(ARCH); for lib in $^; do $(AR) -xv ../$$lib; done
$(AR) ruv $@ $(ARCH)/*
$(RANLIB) $@
all-local: $(ARCH) $(LIB)
include $(top_srcdir)/../../../automake/local.am