URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [rtos/] [rtems/] [README] - Rev 228
Go to most recent revision | Compare with Previous | Blame | View Log
## $Id: README,v 1.2 2001-09-27 11:59:04 chris Exp $#Building RTEMS==============See the file README.configure.Directory Overview==================This is the top level of the RTEMS directory structure. The followingis a description of the files and directories in this directory:INSTALLRudimentary installation instructions. For more detailedinformation please see the Release Notes. The Postscriptversion of this manual can be found in the filec_or_ada/doc/relnotes.tgz.LICENSERequired legalese.READMEThis file.cThis directory contains the source code for the Cimplementation of RTEMS as well as the test suites, sampleapplications, Board Support Packages, Device Drivers, andsupport libraries.docThis directory contains the PDL for the RTEMS executive.Ada versus C============There are two implementations of RTEMS in this source tree --in Ada and in C. These two implementations are functionallyand structurally equivalent. The C implementation followsthe packaging conventions and hiearchical nature of the Adaimplementation. In addition, a style has been followed whichallows one to easily find the corresponding Ada and Cimplementations.File names in C and code placement was carefully designed to insurea close mapping to the Ada implementation. The following file nameextensions are used:.adb - Ada body.ads - Ada specification.adp - Ada body requiring preprocessing.inc - include file for .adp files.c - C body (non-inlined routines).inl - C body (inlined routines).h - C specificationIn the executive source, XYZ.c and XYZ.inl correspond directly to asingle XYZ.adb or XYZ.adp file. A .h file corresponds directly tothe .ads file. There are only a handful of .inc files in theAda source and these are used to insure that the desired simpleinline textual expansion is performed. This avoids scoping andcalling convention side-effects in carefully constructed testswhich usually test context switch behavior.In addition, in Ada code and data name references are always fullyqualified as PACKAGE.NAME. In C, this convention is followedby having the package name as part of the name itself and using acapital letter to indicate the presence of a "." level. So we havePACKAGE.NAME in Ada and _Package_Name in C. The leading "_" in Cis used to avoid naming conflicts between RTEMS and user variables.By using these conventions, one can easily compare the C and Adaimplementations.The most noticeable difference between the C and Ada83 code isthe inability to easily obtain a "typed pointer" in Ada83.Using the "&" operator in C yields a pointer with a specific type.The 'Address attribute is the closest feature in Ada83. Thisreturns a System.Address and this must be coerced via Unchecked_Conversioninto an access type of the desired type. It is easy to viewSystem.Address as similar to a "void *" in C, but this is not the case.A "void *" can be assigned to any other pointer type without anexplicit conversion.The solution adopted to this problem was to provide two routines foreach access type in the Ada implementation -- one to convert fromSystem.Address to the access type and another to go the oppositedirection. This results in code which accomplishes the same thingas the corresponding C but it is easier to get lost in the clutterof the apparent subprogram invocations than the "less bulky"C equivalent.A related difference is the types which are only in Ada which are usedfor pointers to arrays. These types do not exist and are not neededin the C implementation.
Go to most recent revision | Compare with Previous | Blame | View Log
