[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Detecting compile-time versus run-time incompatibilities in powerPC
- Date: Mon, 12 Apr 2010 10:17:21 -0400
- From: dufault at hda.com (Peter Dufault)
- Subject: Detecting compile-time versus run-time incompatibilities in powerPC
A few registers and programming modes have snuck into the MPC55XXEVB code that aren't supported on the MPC5554. I'm working this out with Thomas, but I have a general question.
With the number of different variants of the embedded powerPC family and what they support it's difficult to know what can be used across the board.
It is nice to have a single binary that supports multiple platforms, but it's also nice to detect problems clearly at compile time, and the headers are a good place to keep track of these incompatible differences. I'd like to undefine unsupported registers and modes in the headers so that compile fails. This will not play well with a generic binary that uses run-time code to handle differences.
What's the general consensus on this? Are feature test macros worth-while, e.g., such as:
#if (MPC55XX_CHIP_TYPE == 5554) && \
defined(DONT_DEFINE_UNSUPPORTED_REGISTERS_AND_MODES) && \
/* ALTCADR is reserved on the MPC5554 and writes will cause an exception.
Til, I expect you'll have thoughts
HD Associates, Inc. Software and System Engineering