From 9b605b28b497f398682a8ffd673f6860340957f8 Mon Sep 17 00:00:00 2001 From: WeiY Date: Wed, 24 Apr 2013 00:34:16 +0800 Subject: Using the generic atomic ops to implement UP mode atomic for all architectures. SMP atomic port will be later. --- cpukit/score/cpu/h8300/Makefile.am | 1 + cpukit/score/cpu/h8300/preinstall.am | 3 ++ cpukit/score/cpu/h8300/rtems/score/cpuatomic.h | 40 ++++++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 cpukit/score/cpu/h8300/rtems/score/cpuatomic.h (limited to 'cpukit/score/cpu/h8300') diff --git a/cpukit/score/cpu/h8300/Makefile.am b/cpukit/score/cpu/h8300/Makefile.am index 5a3a8cc680..db04025581 100644 --- a/cpukit/score/cpu/h8300/Makefile.am +++ b/cpukit/score/cpu/h8300/Makefile.am @@ -7,6 +7,7 @@ include_rtems_scoredir = $(includedir)/rtems/score include_rtems_score_HEADERS = rtems/score/cpu.h include_rtems_score_HEADERS += rtems/score/h8300.h include_rtems_score_HEADERS += rtems/score/types.h +include_rtems_score_HEADERS += rtems/score/cpuatomic.h noinst_LIBRARIES = libscorecpu.a libscorecpu_a_SOURCES = cpu.c cpu_asm.S diff --git a/cpukit/score/cpu/h8300/preinstall.am b/cpukit/score/cpu/h8300/preinstall.am index c3fb644817..0a4032ffa7 100644 --- a/cpukit/score/cpu/h8300/preinstall.am +++ b/cpukit/score/cpu/h8300/preinstall.am @@ -39,3 +39,6 @@ $(PROJECT_INCLUDE)/rtems/score/types.h: rtems/score/types.h $(PROJECT_INCLUDE)/r $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/types.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/types.h +$(PROJECT_INCLUDE)/rtems/score/cpuatomic.h: rtems/score/cpuatomic.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp) + $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/cpuatomic.h +PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/cpuatomic.h diff --git a/cpukit/score/cpu/h8300/rtems/score/cpuatomic.h b/cpukit/score/cpu/h8300/rtems/score/cpuatomic.h new file mode 100644 index 0000000000..fd8064535e --- /dev/null +++ b/cpukit/score/cpu/h8300/rtems/score/cpuatomic.h @@ -0,0 +1,40 @@ +/** + * @file rtems/score/cpuatomic.h + * + * This include file implements the atomic operations for h8300 and defines + * atomic data types which are used by the atomic operations API file. This + * file should use fixed name cpuatomic.h and should be included in atomic + * operations API file atomic.h. If the architecture works at the UP mode it + * will use a generic atomic ops using disable/enable-IRQ simulated. If the + * the architecture works at SMP mode, most of the parts of implementations + * are imported from FreeBSD kernel. + */ + +#ifndef _RTEMS_SCORE_ATOMIC_CPU_H +#define _RTEMS_SCORE_ATOMIC_CPU_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @defgroup RTEMS atomic implementation + * + */ + +/**@{*/ + +#if !defined(RTEMS_SMP) +#include +#else +#endif + +#ifdef __cplusplus +} +#endif + +/**@}*/ +#endif +/* end of include file */ -- cgit v1.2.3