blob: 63b3210c452174d8887a451ce3c485053266a551 [file] [log] [blame]
%%{
/* --COPYRIGHT--,EPL
* Copyright (c) 2008 Texas Instruments and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Texas Instruments - initial implementation
*
* --/COPYRIGHT--*/
var unit = $args[0];
var PREFIX = "xdc_target__";
var TARGET = xdc.module(unit.getQualName());
%%}
%if (TARGET.name != null) {
/*
* ======== `TARGET.name`.h ========
* DO NOT MODIFY: This header is generated from stddef.xdt
*
* This header contains target-specific definitions of target-independent
* macros required by the ITarget interface. These definitions allow C/C++
* sources to portably compile for multiple targets (using #ifdef ...).
*/
#ifndef xdc_target_macros_include__
#define xdc_target_macros_include__ 1
/*
* ======== `TARGET.$name.replace(/\./g, "_")` ========
* This macro identifies the specific target being used. This macro should
* probably be avoided in portable sources.
*/
#define `TARGET.$name.replace(/\./g, "_")` 1
/*
* ======== `PREFIX + "isaCompatible_*"` macros ========
* The following definitions enable clients to conditionally compile for any
* compatible subset of the actual target ISA.
*/
%var chain = TARGET.getISAChain();
%for (var i = 0; i < chain.length; i++) {
#define `PREFIX + "isaCompatible_" + chain[i]` 1
%}
/*
* ======== `PREFIX + "isa_" + TARGET.isa` ========
* This macro identifies the specific target ISA for which we are being
* compiled.
*/
#define `PREFIX + "isa_" + TARGET.isa` 1
%if (TARGET.model.endian) {
/*
* ======== `PREFIX + "{big|little}Endian"` ========
* The following macro enables clients to portably compile for big or little
* endian targets.
*/
#define `PREFIX + TARGET.model.endian + "Endian"` 1
%}
%if (TARGET.model.codeModel) {
/*
* ======== `PREFIX + "{...}Code"` ========
* The following macro enables clients to portably compile for target specific
* code models; e.g., near, far, ...
*/
#define `PREFIX + TARGET.model.codeModel + "Code"` 1
%}
%if (TARGET.model.dataModel) {
/*
* ======== `PREFIX + "{...}Data"` ========
* The following macro enables clients to portably compile for target specific
* data models; e.g., near, far, ...
*/
#define `PREFIX + TARGET.model.dataModel + "Data"` 1
%}
%if (TARGET.os != "") {
/*
* ======== `PREFIX + "os_" + TARGET.os` ========
* The following macro enables clients to portably compile for target specific
* OS; e.g., Linux, Solaris, Windows, undefined.
*/
#define `PREFIX + "os_" + TARGET.os` 1
%}
/*
* ======== `PREFIX + "sizeof_"` ========
* The following macros enable clients to portably determine type sizes
* within #ifdef blocks; sizeof() can't be used and the definitions in
* stdint.h are not available to C++ clients (unless the special macro
* __STDC_LIMIT_MACROS is defined).
*/
%for (var name in TARGET.stdTypes) {
% var value = TARGET.stdTypes[name].size;
% if (value != null) {
#define `PREFIX + "sizeof_" + name.substring(2) + " " + value`
% }
%}
/*
* ======== `PREFIX + "alignof_"` ========
* The following macros enable clients to portably determine type alignment
* within #ifdef blocks; even if provided by the compiler, alignof() can't
* be used in pre-processor statements.
*/
%for (var name in TARGET.stdTypes) {
% var value = TARGET.stdTypes[name].align;
% if (value != null) {
#define `PREFIX + "alignof_" + name.substring(2) + " " + value`
% }
%}
/*
* ======== `PREFIX + "bitsPerChar"` ========
* The number of bits in a char. This macro allow one to determine the
* precise number of bits in any of the standard types (whose sizes are
* expressed as a number of chars).
*/
#define `PREFIX + "bitsPerChar " + TARGET.bitsPerChar`
#endif /* end multi-include guard */
%}
%else {
/* this file was generated by xdc/bld/stddefs.xdt */
%}