blob: 2b273c3ef43909c422c4b9b20932db815bc86396 [file] [log] [blame]
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +01001/*
2 * Copyright (C) 2008 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of
7 * the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
17 * MA 02111-1307 USA
18 */
19
20#ifndef __MACRO_H__
21#define __MACRO_H__
22#ifdef __ASSEMBLY__
23
24.macro write32, addr, data
25 mov.l \addr ,r1
26 mov.l \data ,r0
27 mov.l r0, @r1
28.endm
29
30.macro write16, addr, data
31 mov.l \addr ,r1
Nobuhiro Iwamatsubaa9f9b2009-06-16 22:29:15 +090032 mov.w \data ,r0
Jean-Christophe PLAGNIOL-VILLARDf7e78f32008-12-20 19:29:49 +010033 mov.w r0, @r1
34.endm
35
36.macro write8, addr, data
37 mov.l \addr ,r1
38 mov.l \data ,r0
39 mov.b r0, @r1
40.endm
41
42.macro wait_timer, time
43 mov.l \time ,r3
441:
45 nop
46 tst r3, r3
47 bf/s 1b
48 dt r3
49.endm
50
51#endif /* __ASSEMBLY__ */
52#endif /* __MACRO_H__ */