OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [drivers/] [net/] [dgrs_asstruct.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1626 jcastillo
/*
2
 *      For declaring structures shared with assembly routines
3
 *
4
 *      $Id: dgrs_asstruct.h,v 1.1 2005-12-20 10:17:14 jcastillo Exp $
5
 */
6
 
7
#if ASSEMBLER
8
 
9
#       define MO(t,a)          (a)
10
#       define VMO(t,a)         (a)
11
 
12
#       define  BEGIN_STRUCT(x) _Off=0
13
#       define  S1A(t,x,n)      _Off=(_Off+0)&~0; x=_Off; _Off=_Off+(1*n)
14
#       define  S2A(t,x,n)      _Off=(_Off+1)&~1; x=_Off; _Off=_Off+(2*n)
15
#       define  S4A(t,x,n)      _Off=(_Off+3)&~3; x=_Off; _Off=_Off+(4*n)
16
#       define  WORD(x)         _Off=(_Off+3)&~3; x=_Off; _Off=_Off+4
17
#       define  WORDA(x,n)      _Off=(_Off+3)&~3; x=_Off; _Off=_Off+(4*n)
18
#       define  VWORD(x)        _Off=(_Off+3)&~3; x=_Off; _Off=_Off+4
19
#       define  S1(t,x)         _Off=(_Off+0)&~0; x=_Off; _Off=_Off+1
20
#       define  S2(t,x)         _Off=(_Off+1)&~1; x=_Off; _Off=_Off+2
21
#       define  S4(t,x)         _Off=(_Off+3)&~3; x=_Off; _Off=_Off+4
22
#       define  END_STRUCT(x)   _Off=(_Off+3)&~3; x=_Off 
23
 
24
#else   /* C */
25
 
26
#define VMO(t,a)        (*(volatile t *)(a))
27
 
28
#       define BEGIN_STRUCT(x) struct x {
29
#       define S1(t,x)         t x ;
30
#       define S1A(t,x,n)      t x[n] ;
31
#       define S2(t,x)         t x ;
32
#       define S2A(t,x,n)      t x[n] ;
33
#       define S4(t,x)         t x ;
34
#       define S4A(t,x,n)      t x[n] ;
35
#       define END_STRUCT(x)   } ;
36
 
37
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.