📄 makeoffset.c
字号:
/*
* The above copyright holder, limited to cases in which one satisfies
* conditions (1) ~ (4) below, or the conditions described in Version 2
* of of the GNU Public License officially announced by the Free Software
* Foundation, consents to the use, reproduction, alteration, and
* redistribution (hereafter called utilization) of this software (this
* software includes alterations, likewise below) without compensation.
*
* (1) When this software is utilized in the form of source code, the
* above copyright declaration, these conditions of utilization, and the
* following stipulation of no guarantee shall be included in unchanged
* form inside the source code.
* (2) When this software is redistributed in a form in which it can be
* used in the development of other software, library form, etc., the above
* copyright display, these terms of utilization, and the following
* stipulation of no guarantee shall be inserted in documentation accompanying
* redistribution (user's manual, etc.).
* (3) When this software is redistributed in a form in which it cannot be used
* in the development of other software, embedded in devices, etc., one of the
* following conditions shall be satisfied.
* (a) The above copyright display, these terms of utilization, and the
* following stipulation of no guarantee shall be inserted in documentation
* accompanying redistribution (user's manual, etc.).
* (b) The TOPPERS Project shall be notified owing to a method in which the
* form of distribution is decided otherwise.
* (4) The above copyright holder and the TOPPERS Project shall be exempt
* from responsibility for whatever damages occur either directly or indirectly
* through the utilization of this software.
*
* This software is something that is provided with no guarantee. The above copyright
* holder and the TOPPERS Project make no guarantee whatsoever in regard to this
* software, including the possibility of its application. In addition, the above
* copyright holder and the TOPPERS Project shall also not bear responsibility for
* whatever damages occur either directly or indirectly through the utilization of
* this software.
*
* @(#) $Id: makeoffset.c,v 1.2 2006/07/21 09:50:00 9564907 Exp $
*/
#include "jsp_kernel.h"
#include "task.h"
#undef offsetof
#define offsetof(structure, field) \
((INT) &(((structure *) 0)->field))
#define OFFSET_DEF(TYPE, FIELD) \
Asm("OFFSET_DEF " #TYPE "_" #FIELD " = %0" \
: /* no output */ \
: "g"(offsetof(TYPE, FIELD)))
#define OFFSET_DEF2(TYPE, FIELD, FIELDNAME) \
Asm("OFFSET_DEF " #TYPE "_" #FIELDNAME " = %0" \
: /* no output */ \
: "g"(offsetof(TYPE, FIELD)))
void
makeoffset()
{
OFFSET_DEF(TCB, texptn);
OFFSET_DEF2(TCB, tskctxb.sp, sp);
OFFSET_DEF2(TCB, tskctxb.pc, pc);
}
UW BIT_REF_4 = 0x12345678;
UH BIT_REF_2 = 0x1234;
UB BIT_REF_1 = 0x12;
#ifdef __ARMEL__
TCB BIT_LB_TCB_enatex = {
#else
TCB BIT_BB_TCB_enatex = {
#endif /* __ARMEL__ */
{ NULL, NULL }, NULL, 0, 0,
FALSE, FALSE, TRUE,
0, NULL, {NULL, NULL }
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -