Changes between Version 18 and Version 19 of Projects/GSoC/Atomic_Operations
- Timestamp:
- 05/09/14 15:29:09 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Projects/GSoC/Atomic_Operations
v18 v19 117 117 118 118 119 The first part is a directory structure chart, atomic.h is API definition file and cpuatomic.h is implementation file.119 The first part is a directory structure chart, atomic.h is API definition file and cpuatomic.h is an implementation file. 120 120 121 121 |---/cpukit … … 142 142 | | ----cpu.h 143 143 144 Becuase most of the implementation of atomic operations are assembly instructions, if not they could also be implemented with inlilne C source code. So i place the architecture-independent atomic API definitions to the atomic.h which is visible to other rtems components like score, dirver and etc. The architecture-dependent atomic implementations are placed to the cpuatomic.h which exists in every architecture-related directory as show above. The API is associated with implementations using methodlike this:144 Most of the implementation of atomic operations are assembly instructions, if not they could also be implemented with inline C source code. So i place the architecture-independent atomic API definitions to the atomic.h which is visible to other rtems components like score, dirver and etc. The architecture-dependent atomic implementations are placed on the cpuatomic.h which exists in every architecture-related directory as show above. The API is associated with implementations using methods like this: 145 145 for example, the atomic general load function API: int Atomic_Load_Acq_Int(volatile int *p) 146 146 1. In the implementation file cpuatomic.h it will be implemented like this: … … 155 155 Synopsis: 156 156 157 The follow isatomic operation API definition in "rtems" style:157 The following is an atomic operation API definition in "rtems" style: 158 158 1. The atomic_store generic functions 159 159 void _Atomic_Store_Rel_<_type_>(volatile _type_ *p, _type_ v);