I develop embedded software for avionics. It is not unheard of for the software we develop to be used for 20+ years and to be ported to several different platforms over the years (a real example: Amiga PC -> 68000 -> 68020 -> 68040 -> PowerPC -> another PowerPC). As a result, we strive to write portable code.
ISO/IEC TR 18037:2008 specifies a series of extensions of the programming language C, which is specified by ISO/IEC 9899:1999. These extensions support embedded processors.
By definition, extensions to the language are not portable. However, the Basic I/O Hardware Addressing feature is implemented entirely through creation of a new standard library (<iohw.h>). The purpose of this library is to localize non-portable I/O code. We could implement our own platform-specific versions of this library to reap the rewards of portable platform-independent device driver source code.
Has anybody out there tried to do this?
Was it worth the effort to produce your own <iohw.h>?
Did the extra abstraction layer(s) recommended by TR 18037 actually improve the portability of your device drivers?
For anybody who wants to follow along, the most recent draft version of TR 18037 I can find is ISO/IEC JTC1 SC22 WG14 N1169. The draft is available for free; you have to pay for the standard. I have no idea what differences there may be between the draft and the standard.