2003-09-26 Joel Sherrill <joel@OARcorp.com>

* hppa1.1/.cvsignore, hppa1.1/ChangeLog, hppa1.1/Makefile.am,
	hppa1.1/configure.ac, hppa1.1/clock/.cvsignore,
	hppa1.1/clock/Makefile.am, hppa1.1/clock/clock.c,
	hppa1.1/include/.cvsignore, hppa1.1/include/Makefile.am,
	hppa1.1/include/runway.h, hppa1.1/include/semaphore.h,
	hppa1.1/milli/.cvsignore, hppa1.1/milli/Makefile.am,
	hppa1.1/milli/milli.S, hppa1.1/semaphore/.cvsignore,
	hppa1.1/semaphore/Makefile.am, hppa1.1/semaphore/semaphore.c,
	hppa1.1/timer/.cvsignore, hppa1.1/timer/Makefile.am,
	hppa1.1/timer/timer.c: Removed.
This commit is contained in:
Joel Sherrill
2003-09-26 21:36:14 +00:00
parent 024fd916dc
commit 487c286c32
21 changed files with 13 additions and 3067 deletions

View File

@@ -1,3 +1,16 @@
2003-09-26 Joel Sherrill <joel@OARcorp.com>
* hppa1.1/.cvsignore, hppa1.1/ChangeLog, hppa1.1/Makefile.am,
hppa1.1/configure.ac, hppa1.1/clock/.cvsignore,
hppa1.1/clock/Makefile.am, hppa1.1/clock/clock.c,
hppa1.1/include/.cvsignore, hppa1.1/include/Makefile.am,
hppa1.1/include/runway.h, hppa1.1/include/semaphore.h,
hppa1.1/milli/.cvsignore, hppa1.1/milli/Makefile.am,
hppa1.1/milli/milli.S, hppa1.1/semaphore/.cvsignore,
hppa1.1/semaphore/Makefile.am, hppa1.1/semaphore/semaphore.c,
hppa1.1/timer/.cvsignore, hppa1.1/timer/Makefile.am,
hppa1.1/timer/timer.c: Removed.
2003-09-04 Joel Sherrill <joel@OARcorp.com>
* shared/include/cache.h, shared/src/cache_aligned_malloc.c,

View File

@@ -1,14 +0,0 @@
aclocal.m4
autom4te*.cache
config.cache
config.guess
config.log
config.status
config.sub
configure
depcomp
install-sh
Makefile
Makefile.in
missing
mkinstalldirs

View File

@@ -1,114 +0,0 @@
2003-09-04 Joel Sherrill <joel@OARcorp.com>
* clock/clock.c, include/semaphore.h, semaphore/semaphore.c,
timer/timer.c: URL for license changed.
2003-08-18 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* Makefile.am: Reflect having moved aclocal/.
2003-08-16 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* Makefile.am: Reflect having moved automake/.
* clock/Makefile.am: Reflect having moved automake/.
* include/Makefile.am: Reflect having moved automake/.
* milli/Makefile.am: Reflect having moved automake/.
* semaphore/Makefile.am: Reflect having moved automake/.
* timer/Makefile.am: Reflect having moved automake/.
2003-08-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* configure.ac: Use rtems-bugs@rtems.com as bug report email address.
2003-03-06 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* configure.ac: Remove AC_CONFIG_AUX_DIR.
2003-02-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* configure.ac: AM_INIT_AUTOMAKE([1.7.2]).
2003-02-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* configure.ac: AC_PREREQ(2.57).
2002-12-16 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* configure.ac: RTEMS_CHECK_CUSTOM_BSP.
* clock/Makefile.am: Don't include @RTEMS_BSP@.cfg.
* milli/Makefile.am: Ditto.
* semaphore/Makefile.am: Ditto.
* timer/Makefile.am: Ditto.
2002-12-16 Joel Sherrill <joel@OARcorp.com>
* milli/milli.S: Per PR329, use GNU binutils assembler directives.
2002-12-06 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* configure.ac: Remove RTEMS_CHECK_BSP_CACHE.
2002-12-01 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* configure.ac: Add RTEMS_PROG_CCAS.
2002-10-21 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* .cvsignore: Reformat.
Add autom4te*cache.
Remove autom4te.cache.
2002-08-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* clock/Makefile.am: Use .$(OBJEXT) instead of .o.
* milli/Makefile.am: Use .$(OBJEXT) instead of .o.
* semaphore/Makefile.am: Use .$(OBJEXT) instead of .o.
* timer/Makefile.am: Use .$(OBJEXT) instead of .o.
2002-03-27 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* configure.ac:
AC_INIT(package,_RTEMS_VERSION,_RTEMS_BUGS).
AM_INIT_AUTOMAKE([no-define foreign 1.6]).
* clock/Makefile.am: Remove AUTOMAKE_OPTIONS.
* Makefile.am: Remove AUTOMAKE_OPTIONS.
* include/Makefile.am: Remove AUTOMAKE_OPTIONS.
* milli/Makefile.am: Remove AUTOMAKE_OPTIONS.
* semaphore/Makefile.am: Remove AUTOMAKE_OPTIONS.
* timer/Makefile.am: Remove AUTOMAKE_OPTIONS.
2001-10-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* .cvsignore: Add autom4te.cache for autoconf > 2.52.
* configure.in: Remove.
* configure.ac: New file, generated from configure.in by autoupdate.
2001-09-27 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* include/Makefile.am: Use 'PREINSTALL_FILES ='.
2001-02-18 Ralf Corsepius <corsepiu@faw.uni-ulm.de:
* include/Makefile.am: Apply include_*HEADERS instead of H_FILES.
2000-11-09 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* Makefile.am: Use ... instead of RTEMS_TOPdir in ACLOCAL_AMFLAGS.
2000-11-02 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* Makefile.am: Switch to ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal.
2000-10-26 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros.
Switch to GNU canonicalization.
2000-09-04 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* clock/Makefile.am, milli/Makefile.am, semaphore/Makefile.am,
timer/Makefile.am: Include compile.am
2000-08-10 Joel Sherrill <joel@OARcorp.com>
* ChangeLog: New file.

View File

@@ -1,10 +0,0 @@
##
## $Id$
##
ACLOCAL_AMFLAGS = -I ../../../aclocal
SUBDIRS = include milli clock timer semaphore
include $(top_srcdir)/../../../automake/subdirs.am
include $(top_srcdir)/../../../automake/local.am

View File

@@ -1,2 +0,0 @@
Makefile
Makefile.in

View File

@@ -1,28 +0,0 @@
##
## $Id$
##
PGM = $(ARCH)/clock.rel
C_FILES = clock.c
clock_rel_OBJECTS = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
include $(top_srcdir)/../../../automake/compile.am
include $(top_srcdir)/../../../automake/lib.am
#
# (OPTIONAL) Add local stuff here using +=
#
$(PGM): $(clock_rel_OBJECTS)
$(make-rel)
all-local: $(ARCH) $(clock_rel_OBJECTS) $(PGM)
.PRECIOUS: $(PGM)
EXTRA_DIST = clock.c
include $(top_srcdir)/../../../automake/local.am

View File

@@ -1,257 +0,0 @@
/* Clock
*
* This routine initializes the interval timer on the
* PA-RISC CPU. The tick frequency is specified by the bsp.
*
* 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.rtems.com/license/LICENSE.
*
* $Id$
*/
#include <rtems.h>
#include <rtems/libio.h>
/* should get this from bsp.h, but it is not installed yet */
rtems_isr_entry set_vector(rtems_isr_entry, rtems_vector_number, int);
#include <stdlib.h> /* for atexit() */
typedef unsigned long long hppa_click_count_t;
/*
* These are set by clock driver during its init
*/
rtems_device_major_number rtems_clock_major = ~0;
rtems_device_minor_number rtems_clock_minor;
/*
* CPU_HPPA_CLICKS_PER_TICK is either a #define or an rtems_unsigned32
* allocated and set by bsp_start()
*/
#ifndef CPU_HPPA_CLICKS_PER_TICK
extern rtems_unsigned32 CPU_HPPA_CLICKS_PER_TICK;
#endif
volatile rtems_unsigned32 Clock_driver_ticks;
rtems_unsigned32 Clock_isrs; /* ISRs until next tick */
rtems_unsigned32 most_recent_itimer_value;
rtems_unsigned64 Clock_clicks; /* running total of cycles */
rtems_unsigned32 Clock_clicks_interrupt;
void Clock_exit(void);
void
ReInstall_clock(rtems_isr_entry new_clock_isr)
{
rtems_unsigned32 isrlevel = 0;
rtems_interrupt_disable(isrlevel);
(void) set_vector(
new_clock_isr,
HPPA_INTERRUPT_EXTERNAL_INTERVAL_TIMER,
1
);
rtems_interrupt_enable(isrlevel);
}
/*
* read itimer and update Clock_clicks as appropriate
*/
rtems_unsigned32
Clock_read_itimer()
{
rtems_unsigned32 isrlevel;
rtems_unsigned32 itimer_value;
rtems_unsigned32 wrap_count;
rtems_unsigned32 recent_count;
rtems_interrupt_disable(isrlevel);
wrap_count = (Clock_clicks & 0xFFFFFFFF00000000ULL) >> 32;
recent_count = (rtems_unsigned32) Clock_clicks;
itimer_value = get_itimer();
if (itimer_value < recent_count)
wrap_count++;
Clock_clicks = (((rtems_unsigned64) wrap_count) << 32) + itimer_value;
rtems_interrupt_enable(isrlevel);
return itimer_value;
}
void Install_clock(rtems_isr_entry clock_isr)
{
Clock_driver_ticks = 0;
Clock_clicks_interrupt = 0;
Clock_clicks = 0;
Clock_isrs = rtems_configuration_get_milliseconds_per_tick();
/*
* initialize the interval here
* First tick is set to right amount of time in the future
* Future ticks will be incremented over last value set
* in order to provide consistent clicks in the face of
* interrupt overhead
*/
Clock_clicks_interrupt = Clock_read_itimer() + CPU_HPPA_CLICKS_PER_TICK;
set_itimer((rtems_unsigned32) Clock_clicks_interrupt);
(void) set_vector(clock_isr, HPPA_INTERRUPT_EXTERNAL_INTERVAL_TIMER, 1);
atexit(Clock_exit);
}
rtems_isr
Clock_isr(rtems_vector_number vector)
{
rtems_unsigned32 clicks_til_next_interrupt;
rtems_unsigned32 itimer_value;
/*
* setup for next interrupt; making sure the new value is reasonably
* in the future.... in case we lost out on an interrupt somehow
*/
itimer_value = Clock_read_itimer();
Clock_clicks_interrupt += CPU_HPPA_CLICKS_PER_TICK;
/*
* how far away is next interrupt *really*
* It may be a long time; this subtraction works even if
* Clock_clicks_interrupt < Clock_clicks_low_order via
* the miracle of unsigned math.
*/
clicks_til_next_interrupt = Clock_clicks_interrupt - itimer_value;
/*
* If it is too soon then bump it up.
* This should only happen if CPU_HPPA_CLICKS_PER_TICK is too small.
* But setting it low is useful for debug, so...
*/
if (clicks_til_next_interrupt < 400)
{
Clock_clicks_interrupt = itimer_value + 1000;
/* XXX: count these! this should be rare */
}
/*
* If it is too late, that means we missed the interrupt somehow.
* Rather than wait 35-50s for a wrap, we just fudge it here.
*/
if (clicks_til_next_interrupt > CPU_HPPA_CLICKS_PER_TICK)
{
Clock_clicks_interrupt = itimer_value + 1000;
/* XXX: count these! this should never happen :-) */
}
set_itimer((rtems_unsigned32) Clock_clicks_interrupt);
Clock_driver_ticks++;
if (Clock_isrs == 1)
{
rtems_clock_tick();
Clock_isrs = rtems_configuration_get_milliseconds_per_tick();
if (Clock_isrs == 0)
Clock_isrs = 1;
}
else
Clock_isrs--;
}
/*
* Called via atexit()
* Remove the clock interrupt handler by setting handler to NULL
*/
void
Clock_exit(void)
{
(void) set_vector(0, HPPA_INTERRUPT_EXTERNAL_INTERVAL_TIMER, 1);
}
/*
* spin delay for specified number of microseconds
* used by RTEMS delay macro
*/
void
Clock_delay(rtems_unsigned32 microseconds)
{
rtems_unsigned64 future_time;
(void) Clock_read_itimer();
future_time = Clock_clicks +
((rtems_unsigned64) microseconds) *
rtems_cpu_configuration_get_itimer_clicks_per_microsecond();
for (;;)
{
(void) Clock_read_itimer();
if (future_time <= Clock_clicks)
break;
}
}
rtems_device_driver Clock_initialize(
rtems_device_major_number major,
rtems_device_minor_number minor,
void *pargp
)
{
Install_clock(Clock_isr);
/*
* make major/minor avail to others such as shared memory driver
*/
rtems_clock_major = major;
rtems_clock_minor = minor;
return RTEMS_SUCCESSFUL;
}
rtems_device_driver Clock_control(
rtems_device_major_number major,
rtems_device_minor_number minor,
void *pargp
)
{
rtems_libio_ioctl_args_t *args = pargp;
if (args == 0)
goto done;
/*
* This is hokey, but until we get a defined interface
* to do this, it will just be this simple...
*/
if (args->command == rtems_build_name('I', 'S', 'R', ' '))
{
Clock_isr(HPPA_INTERRUPT_EXTERNAL_INTERVAL_TIMER);
}
else if (args->command == rtems_build_name('N', 'E', 'W', ' '))
{
ReInstall_clock(args->buffer);
}
done:
return RTEMS_SUCCESSFUL;
}

View File

@@ -1,34 +0,0 @@
## Process this file with autoconf to produce a configure script.
##
## $Id$
AC_PREREQ(2.57)
AC_INIT([rtems-c-src-lib-libcpu-hppa1.1],[_RTEMS_VERSION],[rtems-bugs@rtems.com])
AC_CONFIG_SRCDIR([clock])
RTEMS_TOP(../../../../..)
RTEMS_CANONICAL_TARGET_CPU
AM_INIT_AUTOMAKE([no-define foreign 1.7.2])
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_PROG_CCAS
# Explicitly list all Makefiles here
AC_CONFIG_FILES([Makefile
clock/Makefile
include/Makefile
milli/Makefile
semaphore/Makefile
timer/Makefile])
AC_OUTPUT

View File

@@ -1,2 +0,0 @@
Makefile
Makefile.in

View File

@@ -1,26 +0,0 @@
##
## $Id$
##
include_hppa1_1dir = $(includedir)/hppa1.1
include_hppa1_1_HEADERS = runway.h semaphore.h
# NOTE: Unlike other CPUS, we install into a subdirectory to avoid
# file name conflicts
$(PROJECT_INCLUDE)/hppa1.1:
$(mkinstalldirs) $@
$(PROJECT_INCLUDE)/hppa1.1/%.h: %.h
$(INSTALL_DATA) $< $@
PREINSTALL_FILES = $(PROJECT_INCLUDE)/hppa1.1 \
$(include_hppa1_1_HEADERS:%=$(PROJECT_INCLUDE)/hppa1.1/%)
all-local: $(TMPINSTALL_FILES)
EXTRA_DIST = runway.h semaphore.h
include $(top_srcdir)/../../../automake/local.am

View File

@@ -1,37 +0,0 @@
/*
* File: $RCSfile$
* Project: PixelFlow
* Created: 94/11/29
* RespEngr: tony bennett
* Revision: $Revision$
* Last Mod: $Date$
*
* Description:
* definitions specific to the runway bus
*
* TODO:
* Add lots more.
*
* $Id$
*/
#ifndef _INCLUDE_RUNWAY_H
#define _INCLUDE_RUNWAY_H
#ifdef __cplusplus
extern "C" {
#endif
#define HPPA_RUNWAY_PROC_HPA_BASE ((void *) 0xFFFA0000)
/* given a processor number, where is its HPA? */
#define HPPA_RUNWAY_HPA(cpu) \
((rtems_unsigned32) (HPPA_RUNWAY_PROC_HPA_BASE + ((cpu) * 0x2000)))
#define HPPA_RUNWAY_REG_IO_EIR_OFFSET 0x000
#ifdef __cplusplus
}
#endif
#endif /* ! _INCLUDE_RUNWAY_H */

View File

@@ -1,70 +0,0 @@
/*
* Description:
* HPPA fast spinlock semaphores based on LDCWX instruction.
* These semaphores are not known to RTEMS.
*
* TODO:
*
* COPYRIGHT (c) 1994,95 by Division Incorporated
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* $Id$
*/
#ifndef _INCLUDE_HPPA1_1_SEMAPHORE_H
#define _INCLUDE_HPPA1_1_SEMAPHORE_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* This structure has hardware requirements.
* LDCWX opcode requires 16byte alignment for the lock
* 'lock' must be first member of structure.
*/
#define SEM_ALIGN 16
typedef volatile struct {
rtems_unsigned32 lock __attribute__ ((aligned (SEM_ALIGN)));
rtems_unsigned32 flags;
void *owner_tcb; /* for debug/commentary only */
rtems_unsigned32 user; /* for use by user */
} hppa_semaphore_t;
/*
* Values for flags
*/
#define HPPA_SEM_IN_USE 0x0001 /* semaphore owned by somebody */
#define HPPA_SEM_NO_SPIN 0x0002 /* don't spin if unavailable */
#define HPPA_SEM_INITIALLY_FREE 0x0004 /* init it to be free */
/*
* Caller specifiable flags
*/
#define HPPA_SEM_CALLER_FLAGS (HPPA_SEM_NO_SPIN | HPPA_SEM_INITIALLY_FREE)
void hppa_semaphore_pool_initialize(void *pool_base, int pool_size);
rtems_unsigned32 hppa_semaphore_acquire(hppa_semaphore_t *sp, int flag);
void hppa_semaphore_release(hppa_semaphore_t *sp);
hppa_semaphore_t *hppa_semaphore_allocate(rtems_unsigned32 which, int flag);
#ifdef __cplusplus
}
#endif
#endif /* ! _INCLUDE_SEMAPHORE_H */

View File

@@ -1,2 +0,0 @@
Makefile
Makefile.in

View File

@@ -1,28 +0,0 @@
##
## $Id$
##
PGM = $(ARCH)/milli.rel
S_FILES = milli.S
milli_rel_OBJECTS = $(S_FILES:%.S=$(ARCH)/%.$(OBJEXT))
include $(top_srcdir)/../../../automake/compile.am
include $(top_srcdir)/../../../automake/lib.am
#
# (OPTIONAL) Add local stuff here using +=
#
$(PGM): $(milli_rel_OBJECTS)
$(make-rel)
all-local: $(ARCH) $(milli_rel_OBJECTS) $(PGM)
.PRECIOUS: $(PGM)
EXTRA_DIST = milli.S
include $(top_srcdir)/../../../automake/local.am

File diff suppressed because it is too large Load Diff

View File

@@ -1,2 +0,0 @@
Makefile
Makefile.in

View File

@@ -1,28 +0,0 @@
##
## $Id$
##
PGM = $(ARCH)/semaphore.rel
C_FILES = semaphore.c
semaphore_rel_OBJECTS = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
include $(top_srcdir)/../../../automake/compile.am
include $(top_srcdir)/../../../automake/lib.am
#
# (OPTIONAL) Add local stuff here using +=
#
$(PGM): $(semaphore_rel_OBJECTS)
$(make-rel)
all-local: $(ARCH) $(semaphore_rel_OBJECTS) $(PGM)
.PRECIOUS: $(PGM)
EXTRA_DIST = semaphore.c
include $(top_srcdir)/../../../automake/local.am

View File

@@ -1,302 +0,0 @@
/*
* Description:
* HPPA fast spinlock semaphores based on LDCWX instruction.
* These semaphores are not known to RTEMS.
*
* TODO:
* Put node number in high 16 bits of flag??
* XXX: Need h_s_deallocate
*
* COPYRIGHT (c) 1994 by Division Incorporated
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* $Id$
*/
#include <rtems.h>
#include <hppa1.1/semaphore.h>
/*
* Report fatal semaphore error
*/
#define SEM_FATAL_ERROR(sp) rtems_fatal_error_occurred((rtems_unsigned32) sp)
#define SEM_CHECK(sp) do { \
if (((sp) == 0) || (int) (sp) & 0xf) \
{ \
SEM_FATAL_ERROR(sp); \
} \
} while (0)
/*
* Init a semaphore to be free
*/
#define SEM_FREE_INIT(sp) \
do { \
(sp)->lock = 1; \
(sp)->flags = 0; \
(sp)->owner_tcb = 0; \
} while (0)
/*
* Grab a semaphore recording its owner.
*/
#define SEM_MARK_GRABBED(sp) \
do { \
(sp)->owner_tcb = _Thread_Executing; \
} while (0)
/*
* Mark the semaphore busy
*/
#define SEM_MARK_BUSY(sp) ((sp)->flags |= HPPA_SEM_IN_USE)
/*
* Is a semaphore available?
*/
#define SEM_IS_AVAILABLE(sp) ((sp)->owner_tcb == 0)
/*
* The pool control semaphore is the first in the pool
*/
#define SEM_CONTROL (&hppa_semaphore_pool[0])
#define SEM_FIRST (&hppa_semaphore_pool[1])
#define SEM_PRIVATE(cookie) rtems_interrupt_disable(cookie)
#define SEM_PUBLIC(cookie) rtems_interrupt_enable(cookie)
/*
* Control variables for the pool
*/
hppa_semaphore_t *hppa_semaphore_pool; /* ptr to first */
int hppa_semaphores;
int hppa_semaphores_available;
void
hppa_semaphore_pool_initialize(void *pool_base,
int pool_size)
{
hppa_semaphore_t *sp;
int align_factor;
rtems_unsigned32 isr_level;
/*
* round pool_base up to be a multiple of SEM_ALIGN
*/
align_factor = SEM_ALIGN - (((int) pool_base) & (SEM_ALIGN-1));
if (align_factor != SEM_ALIGN)
{
pool_base += align_factor;
pool_size -= align_factor;
}
/*
* How many can the pool hold?
* Assumes the semaphores are SEM_ALIGN bytes each
*/
if (sizeof(hppa_semaphore_t) != SEM_ALIGN)
rtems_fatal_error_occurred(RTEMS_INVALID_SIZE);
pool_size &= ~(SEM_ALIGN - 1);
SEM_PRIVATE(isr_level);
hppa_semaphore_pool = pool_base;
hppa_semaphores = pool_size / SEM_ALIGN;
/*
* If we are node0, then init all in the pool
*/
#if 0
if (cpu_number == 0)
#else
if (_Configuration_Table->User_multiprocessing_table->node == 1)
#endif
{
/*
* Tell other cpus we are not done, jic
*/
SEM_CONTROL->user = rtems_build_name('!', 'D', 'N', 'E');
for (sp=SEM_FIRST; sp < &hppa_semaphore_pool[hppa_semaphores]; sp++)
SEM_FREE_INIT(sp);
SEM_FREE_INIT(SEM_CONTROL);
}
/*
* Tell other cpus we are done, or wait for it to be done if on another cpu
*/
#if 0
if (cpu_number == 0)
#else
if (_Configuration_Table->User_multiprocessing_table->node == 1)
#endif
SEM_CONTROL->user = rtems_build_name('D', 'O', 'N', 'E');
else
while (SEM_CONTROL->user != rtems_build_name('D', 'O', 'N', 'E'))
;
hppa_semaphores_available = hppa_semaphores;
SEM_PUBLIC(isr_level);
}
/*
* Function: hppa_semaphore_acquire
* Created: 94/11/29
* RespEngr: tony bennett
*
* Description:
* Acquire a semaphore. Will spin on the semaphore unless
* 'flag' says not to.
*
* Parameters:
*
*
* Returns:
* 0 -- if did not acquire
* non-zero -- if acquired semaphore
* (actually this is the spin count)
*
* Notes:
* There is no requirement that the semaphore be within the pool
*
* Deficiencies/ToDo:
*
*/
rtems_unsigned32
hppa_semaphore_acquire(hppa_semaphore_t *sp,
int flag)
{
rtems_unsigned32 lock_value;
rtems_unsigned32 spin_count = 1;
SEM_CHECK(sp);
for (;;)
{
HPPA_ASM_LDCWS(0, 0, sp, lock_value);
if (lock_value) /* we now own the lock */
{
SEM_MARK_GRABBED(sp);
return spin_count ? spin_count : ~0; /* jic */
}
if (flag & HPPA_SEM_NO_SPIN)
return 0;
spin_count++;
}
}
void
hppa_semaphore_release(hppa_semaphore_t *sp)
{
SEM_CHECK(sp);
if (sp->owner_tcb != _Thread_Executing)
SEM_FATAL_ERROR("owner mismatch");
sp->lock = 1;
}
/*
* Function: hppa_semaphore_allocate
* Created: 94/11/29
* RespEngr: tony bennett
*
* Description:
* Get a pointer to a semaphore.
*
* Parameters:
* which -- if 0, then allocate a free semaphore from the pool
* if non-zero, then return pointer to that one, even
* if it is already busy.
*
* Returns:
* successful -- pointer to semaphore
* NULL otherwise
*
* Notes:
*
*
* Deficiencies/ToDo:
*
*
*/
hppa_semaphore_t *
hppa_semaphore_allocate(rtems_unsigned32 which,
int flag)
{
hppa_semaphore_t *sp = 0;
/*
* grab the control semaphore
*/
if (hppa_semaphore_acquire(SEM_CONTROL, 0) == 0)
SEM_FATAL_ERROR("could not grab control semaphore");
/*
* Find a free one and init it
*/
if (which)
{
if (which >= hppa_semaphores)
SEM_FATAL_ERROR("requested non-existent semaphore");
sp = &hppa_semaphore_pool[which];
/*
* if it is "free", then mark it claimed now.
* If it is not free then we are done.
*/
if (SEM_IS_AVAILABLE(sp))
goto allmine;
}
else for (sp = SEM_FIRST;
sp < &hppa_semaphore_pool[hppa_semaphores];
sp++)
{
if (SEM_IS_AVAILABLE(sp))
{
allmine: SEM_FREE_INIT(sp);
SEM_MARK_BUSY(sp);
if ( ! (flag & HPPA_SEM_INITIALLY_FREE))
SEM_MARK_GRABBED(sp);
break;
}
}
/*
* Free up the control semaphore
*/
hppa_semaphore_release(SEM_CONTROL);
return sp;
}

View File

@@ -1,2 +0,0 @@
Makefile
Makefile.in

View File

@@ -1,28 +0,0 @@
##
## $Id$
##
PGM = $(ARCH)/timer.rel
C_FILES = timer.c
timer_rel_OBJECTS = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT))
include $(top_srcdir)/../../../automake/compile.am
include $(top_srcdir)/../../../automake/lib.am
#
# (OPTIONAL) Add local stuff here using +=
#
$(PGM): $(timer_rel_OBJECTS)
$(make-rel)
all-local: $(ARCH) $(timer_rel_OBJECTS) $(PGM)
.PRECIOUS: $(PGM)
EXTRA_DIST = timer.c
include $(top_srcdir)/../../../automake/local.am

View File

@@ -1,62 +0,0 @@
/* timer.c
*
* This file manages the interval timer on the PA-RISC.
*
* NOTE: It is important that the timer start/stop overhead be
* determined when porting or modifying this code.
*
* 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.rtems.com/license/LICENSE.
*
* $Id$
*/
#include <rtems.h>
volatile rtems_unsigned32 Timer_starting;
rtems_boolean Timer_driver_Find_average_overhead;
void Timer_initialize()
{
Timer_starting = get_itimer();
set_eiem(0x80000000);
}
#define AVG_OVERHEAD 0 /* It typically takes 3.0 microseconds */
/* (6 countdowns) to start/stop the timer. */
#define LEAST_VALID 1 /* Don't trust a value lower than this */
int Read_timer()
{
rtems_unsigned32 clicks;
rtems_unsigned32 total;
clicks = get_itimer();
total = clicks - Timer_starting;
if ( Timer_driver_Find_average_overhead == 1 )
return total; /* in XXX microsecond units */
else {
if ( total < LEAST_VALID )
return 0; /* below timer resolution */
return (total - AVG_OVERHEAD);
}
}
rtems_status_code Empty_function( void )
{
return RTEMS_SUCCESSFUL;
}
void Set_find_average_overhead(
rtems_boolean find_flag
)
{
Timer_driver_Find_average_overhead = find_flag;
}