File: dgrs_asstruct.h

package info (click to toggle)
kernel-source-2.4.14 2.4.14-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 139,160 kB
  • ctags: 428,423
  • sloc: ansic: 2,435,554; asm: 141,119; makefile: 8,258; sh: 3,099; perl: 2,561; yacc: 1,177; cpp: 755; tcl: 577; lex: 352; awk: 251; lisp: 218; sed: 72
file content (37 lines) | stat: -rw-r--r-- 1,129 bytes parent folder | download | duplicates (25)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 *	For declaring structures shared with assembly routines
 *
 *	$Id: asstruct.h,v 1.1.1.1 1994/10/23 05:08:32 rick Exp $
 */

#if ASSEMBLER

#	define MO(t,a)		(a)
#	define VMO(t,a)		(a)

#	define	BEGIN_STRUCT(x)	_Off=0
#	define	S1A(t,x,n)	_Off=(_Off+0)&~0; x=_Off; _Off=_Off+(1*n)
#	define	S2A(t,x,n)	_Off=(_Off+1)&~1; x=_Off; _Off=_Off+(2*n)
#	define	S4A(t,x,n)	_Off=(_Off+3)&~3; x=_Off; _Off=_Off+(4*n)
#	define	WORD(x)		_Off=(_Off+3)&~3; x=_Off; _Off=_Off+4
#	define	WORDA(x,n)	_Off=(_Off+3)&~3; x=_Off; _Off=_Off+(4*n)
#	define	VWORD(x)	_Off=(_Off+3)&~3; x=_Off; _Off=_Off+4
#	define	S1(t,x)		_Off=(_Off+0)&~0; x=_Off; _Off=_Off+1
#	define	S2(t,x)		_Off=(_Off+1)&~1; x=_Off; _Off=_Off+2
#	define	S4(t,x)		_Off=(_Off+3)&~3; x=_Off; _Off=_Off+4
#	define	END_STRUCT(x)	_Off=(_Off+3)&~3; x=_Off 

#else	/* C */

#define VMO(t,a)        (*(volatile t *)(a))

#	define BEGIN_STRUCT(x) struct x {
#	define S1(t,x)         t x ;
#	define S1A(t,x,n)      t x[n] ;
#	define S2(t,x)         t x ;
#	define S2A(t,x,n)      t x[n] ;
#	define S4(t,x)         t x ;
#	define S4A(t,x,n)      t x[n] ;
#	define END_STRUCT(x)   } ;

#endif