2010-06-15 Joel Sherrill <joel.sherrill@oarcorp.com>

PR 1561/cpukit
	* .cvsignore, ChangeLog, Makefile.am, Makefile.in, README, context.S,
	cpu.c, preinstall.am, rtems/asm.h, rtems/score/cpu.h,
	rtems/score/sparc64.h, rtems/score/types.h: New files.
This commit is contained in:
Joel Sherrill committed 2010-06-15 22:43:56 +00:00
1 parent 591b76084c
commit c86da31cb9
12 files changed
+2766

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
Makefile
Makefile.in
+31
View File
@@ -0,0 +1,31 @@
2010-06-15 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1561/cpukit
* .cvsignore, ChangeLog, Makefile.am, Makefile.in, README, context.S,
cpu.c, preinstall.am, rtems/asm.h, rtems/score/cpu.h,
rtems/score/sparc64.h, rtems/score/types.h: New files.
2010-05-10 Gedare Bloom <gedare@gwmail.gwu.edu>
* README: Explain separation of score between here and libcpu.
2010-05-03 Gedare Bloom <gedare@gwmail.gwu.edu>
* rtems/score/cpu.h, context.S, cpu.c: Remove privileged
registers from context.
2010-05-03 Gedare Bloom <gedare@gwmail.gwu.edu>
* cpu.c: Remove interrupt handling code. Moved to libcpu.
2010-05-03 Gedare Bloom <gedare@gwmail.gwu.edu>
* context.S: renamed cpu_asm.S to context.S
2010-05-02 Gedare Bloom <gedare@gwmail.gwu.edu>
* cpu_asm.S: Remove interrupt handling code. Moved to libcpu.
2009-10-19 Eugen Leontie <eugen@gwu.edu>
Added sparc64 architecture
+22
View File
@@ -0,0 +1,22 @@
##
## $Id$
##
include $(top_srcdir)/automake/compile.am
include_rtemsdir = $(includedir)/rtems
include_rtems_HEADERS = rtems/asm.h
#include_rtems_sparc64dir = $(includedir)/rtems/sparc64
#include_rtems_sparc64_HEADERS =
include_rtems_scoredir = $(includedir)/rtems/score
include_rtems_score_HEADERS = rtems/score/sparc64.h rtems/score/cpu.h \
rtems/score/types.h
noinst_LIBRARIES = libscorecpu.a
libscorecpu_a_SOURCES = context.S cpu.c
libscorecpu_a_CPPFLAGS = $(AM_CPPFLAGS)
include $(srcdir)/preinstall.am
include $(top_srcdir)/automake/local.am
File diff suppressed because it is too large. Load diff
+15
View File
@@ -0,0 +1,15 @@
#
# $Id$
#
A lot of explanation needed, will do when known.
The score/cpu/sparc64 contains only code that can execute without accessing
privileged registers or using privileged instructions. This was done because
the privileged registers differ between the sun4u and sun4v models.
The model specific and privileged code that would normally be found in
score/cpu/sparc64 resides in libcpu/sparc64/@RTEMS_CPU_MODEL@/score or in
libcpu/sparc64/shared/score directory. This is primarily the interrupt
handling code.
File diff suppressed because it is too large. Load diff
+116
View File
@@ -0,0 +1,116 @@
/*
* SPARC-v9 Dependent Source
*
* COPYRIGHT (c) 1989-2007.
* On-Line Applications Research Corporation (OAR).
*
* This file is based on the SPARC cpu.c file. Modifications are made to
* provide support for the SPARC-v9.
* COPYRIGHT (c) 2010. Gedare Bloom.
*
* 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/system.h>
#include <rtems/asm.h>
#include <rtems/score/isr.h>
#include <rtems/rtems/cache.h>
/*PAGE
*
* _CPU_Initialize
*
* This routine performs processor dependent initialization.
*
* INPUT PARAMETERS: NONE
*
* Output Parameters: NONE
*
* NOTE: There is no need to save the pointer to the thread dispatch routine.
* The SPARC's assembly code can reference it directly with no problems.
*/
void _CPU_Initialize(void)
{
#if (SPARC_HAS_FPU == 1)
Context_Control_fp *pointer;
/*
* This seems to be the most appropriate way to obtain an initial
* FP context on the SPARC. The NULL fp context is copied in to
* the task's FP context during Context_Initialize_fp.
*/
pointer = &_CPU_Null_fp_context;
_CPU_Context_save_fp( &pointer );
#endif
/*
* Since no tasks have been created yet and no interrupts have occurred,
* there is no way that the currently executing thread can have an
* _ISR_Dispatch stack frame on its stack.
*/
_CPU_ISR_Dispatch_disable = 0;
}
/*PAGE
*
* _CPU_Context_Initialize
*
* This kernel routine initializes the basic non-FP context area associated
* with each thread.
*
* Input parameters:
* the_context - pointer to the context area
* stack_base - address of memory for the SPARC
* size - size in bytes of the stack area
* new_level - interrupt level for this context area
* entry_point - the starting execution point for this this context
* is_fp - TRUE if this context is associated with an FP thread
*
* Output parameters: NONE
*/
void _CPU_Context_Initialize(
Context_Control *the_context,
void *stack_base,
uint32_t size,
uint32_t new_level,
void *entry_point,
bool is_fp
)
{
uint64_t stack_high; /* highest "stack aligned" address */
uint32_t the_size;
/*
* On CPUs with stacks which grow down (i.e. SPARC), we build the stack
* based on the stack_high address.
*/
stack_high = ((uint64_t)(stack_base) + size);
stack_high &= ~(CPU_STACK_ALIGNMENT - 1);
the_size = size & ~(CPU_STACK_ALIGNMENT - 1);
/*
* See the README in this directory for a diagram of the stack.
*/
the_context->o7 = ((uint64_t) entry_point) - 8;
the_context->o6_sp = stack_high - CPU_MINIMUM_STACK_FRAME_SIZE - STACK_BIAS;
the_context->i6_fp = 0;
/* PSTATE used to be built here, but is no longer included in context */
/*
* Since THIS thread is being created, there is no way that THIS
* thread can have an _ISR_Dispatch stack frame on its stack.
*/
the_context->isr_dispatch_disable = 0;
}
+41
View File
@@ -0,0 +1,41 @@
## Automatically generated by ampolish3 - Do not edit
if AMPOLISH3
$(srcdir)/preinstall.am: Makefile.am
$(AMPOLISH3) $(srcdir)/Makefile.am > $(srcdir)/preinstall.am
endif
PREINSTALL_DIRS =
DISTCLEANFILES = $(PREINSTALL_DIRS)
all-am: $(PREINSTALL_FILES)
PREINSTALL_FILES =
CLEANFILES = $(PREINSTALL_FILES)
$(PROJECT_INCLUDE)/rtems/$(dirstamp):
@$(MKDIR_P) $(PROJECT_INCLUDE)/rtems
@: > $(PROJECT_INCLUDE)/rtems/$(dirstamp)
PREINSTALL_DIRS += $(PROJECT_INCLUDE)/rtems/$(dirstamp)
$(PROJECT_INCLUDE)/rtems/asm.h: rtems/asm.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/asm.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/asm.h
$(PROJECT_INCLUDE)/rtems/score/$(dirstamp):
@$(MKDIR_P) $(PROJECT_INCLUDE)/rtems/score
@: > $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
PREINSTALL_DIRS += $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
$(PROJECT_INCLUDE)/rtems/score/sparc64.h: rtems/score/sparc64.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/sparc64.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/sparc64.h
$(PROJECT_INCLUDE)/rtems/score/cpu.h: rtems/score/cpu.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/cpu.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/cpu.h
$(PROJECT_INCLUDE)/rtems/score/types.h: rtems/score/types.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/types.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/types.h
+102
View File
@@ -0,0 +1,102 @@
/**
* @file rtems/asm.h
*
* This include file attempts to address the problems
* caused by incompatible flavors of assemblers and
* toolsets. It primarily addresses variations in the
* use of leading underscores on symbols and the requirement
* that register names be preceded by a %.
*/
/*
* NOTE: The spacing in the use of these macros
* is critical to them working as advertised.
*
* COPYRIGHT:
*
* This file is based on similar code found in newlib available
* from ftp.cygnus.com. The file which was used had no copyright
* notice. This file is freely distributable as long as the source
* of the file is noted.
*
* $Id$
*/
#ifndef _RTEMS_ASM_H
#define _RTEMS_ASM_H
/*
* Indicate we are in an assembly file and get the basic CPU definitions.
*/
#ifndef ASM
#define ASM
#endif
#ifndef __ASM__
#define __ASM__
#endif
#include <rtems/score/cpuopts.h>
#include <rtems/score/cpu.h>
/*
* Recent versions of GNU cpp define variables which indicate the
* need for underscores and percents. If not using GNU cpp or
* the version does not support this, then you will obviously
* have to define these as appropriate.
*/
/* XXX __USER_LABEL_PREFIX__ and __REGISTER_PREFIX__ do not work on gcc 2.7.0 */
/* XXX The following ifdef magic fixes the problem but results in a warning */
/* XXX when compiling assembly code. */
#ifndef __USER_LABEL_PREFIX__
#define __USER_LABEL_PREFIX__ _
#endif
#ifndef __REGISTER_PREFIX__
#define __REGISTER_PREFIX__
#endif
#include <rtems/concat.h>
/* Use the right prefix for global labels. */
#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
/* Use the right prefix for registers. */
#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x)
/*
* define macros for all of the registers on this CPU
*
* EXAMPLE: #define d0 REG (d0)
*/
/*
* Define macros to handle section beginning and ends.
*/
#define BEGIN_CODE_DCL .text
#define END_CODE_DCL
#define BEGIN_DATA_DCL .data
#define END_DATA_DCL
#define BEGIN_CODE .text
#define END_CODE
#define BEGIN_DATA
#define END_DATA
#define BEGIN_BSS
#define END_BSS
#define END
/*
* Following must be tailor for a particular flavor of the C compiler.
* They may need to put underscores in front of the symbols.
*/
#define PUBLIC(sym) .globl SYM (sym)
#define EXTERN(sym) .globl SYM (sym)
#endif
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,51 @@
/**
* @file rtems/score/types.h
*/
/*
* This include file contains type definitions pertaining to the
* SPARC-v9 processor family.
*
* 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$
*/
#ifndef _RTEMS_SCORE_TYPES_H
#define _RTEMS_SCORE_TYPES_H
#ifndef ASM
#include <stdbool.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* This section defines the basic types for this processor.
*/
typedef uint16_t Priority_Bit_map_control;
typedef void sparc_isr;
typedef void ( *sparc_isr_entry )( void );
#ifdef RTEMS_DEPRECATED_TYPES
typedef bool boolean; /* Boolean value */
typedef float single_precision; /* single precision float */
typedef double double_precision; /* double precision float */
#endif
#ifdef __cplusplus
}
#endif
#endif /* !ASM */
#endif