Initialize Tizen 2.3
[external/nettle.git] / asm.m4
1 changequote(<,>)dnl
2 dnl (progn (modify-syntax-entry ?< "(>") (modify-syntax-entry ?> ")<") )
3
4 dnl FORTRAN style comment character
5 define(<C>, <
6 dnl>)dnl
7
8 dnl Including files from the srcdir
9 define(<include_src>, <include(srcdir/$1)>)dnl
10
11 dnl Pseudo ops
12
13 define(<PROLOGUE>,
14 <ifelse(ELF_STYLE,yes,
15 <.globl C_NAME($1)
16 .type C_NAME($1),TYPE_FUNCTION
17 C_NAME($1):>,
18 <.globl C_NAME($1)
19 C_NAME($1):>)>)
20
21 define(<EPILOGUE>,
22 <ifelse(ELF_STYLE,yes,
23 <.size C_NAME($1), . - C_NAME($1)>,<>)>)
24
25 dnl Argument to ALIGN is always logarithmic
26 dnl Can't use << operator with our choice of quote characters...
27 define(<ALIGN>,
28 <.align ifelse(ALIGN_LOG,yes,$1,eval(2 ** $1))>)
29
30 dnl Struct defining macros
31
32 dnl STRUCTURE(prefix) 
33 define(<STRUCTURE>, <define(<SOFFSET>, 0)define(<SPREFIX>, <$1>)>)dnl
34
35 dnl STRUCT(name, size)
36 define(<STRUCT>,
37 <define(SPREFIX<_>$1, SOFFSET)dnl
38  define(<SOFFSET>, eval(SOFFSET + ($2)))>)dnl
39
40 dnl UCHAR(name)
41 define(<UCHAR>, <STRUCT(<$1>, 1)>)dnl
42
43 dnl UNSIGNED(name)
44 define(<UNSIGNED>, <STRUCT(<$1>, 4)>)dnl
45
46 dnl Offsets in arcfour_ctx
47 STRUCTURE(ARCFOUR)
48   STRUCT(S, 256)
49   UCHAR(I)
50   UCHAR(J)
51
52 dnl Offsets in aes_ctx and aes_table
53 STRUCTURE(AES)
54   STRUCT(KEYS, 4*60)
55   UNSIGNED(NROUNDS)
56
57 define(AES_SBOX_SIZE,   256)dnl
58 define(AES_TABLE_SIZE,  1024)dnl
59
60 STRUCTURE(AES)
61   STRUCT(SBOX, AES_SBOX_SIZE)
62   STRUCT(TABLE0, AES_TABLE_SIZE)
63   STRUCT(TABLE1, AES_TABLE_SIZE)
64   STRUCT(TABLE2, AES_TABLE_SIZE)
65   STRUCT(TABLE3, AES_TABLE_SIZE)