1183651Sjhay/*-
2183651Sjhay * Copyright (c) 2008 John Hay.  All rights reserved.
3183651Sjhay *
4183651Sjhay * Redistribution and use in source and binary forms, with or without
5183651Sjhay * modification, are permitted provided that the following conditions
6183651Sjhay * are met:
7183651Sjhay * 1. Redistributions of source code must retain the above copyright
8183651Sjhay *    notice, this list of conditions and the following disclaimer.
9183651Sjhay * 2. Redistributions in binary form must reproduce the above copyright
10183651Sjhay *    notice, this list of conditions and the following disclaimer in the
11183651Sjhay *    documentation and/or other materials provided with the distribution.
12183651Sjhay *
13183651Sjhay * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14183651Sjhay * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15183651Sjhay * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16183651Sjhay * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17183651Sjhay * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18183651Sjhay * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19183651Sjhay * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20183651Sjhay * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21183651Sjhay * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22183651Sjhay * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23183651Sjhay *
24183651Sjhay * $FreeBSD$
25183651Sjhay */
26183651Sjhay
27183651Sjhay#ifndef ARM_BOOT_LIB_H
28183651Sjhay#define ARM_BOOT_LIB_H
29183651Sjhay
30183651Sjhay#include <sys/cdefs.h>
31183651Sjhay#include <sys/param.h>
32183651Sjhay
33183651Sjhayvoid DELAY(int);
34183651Sjhay
35183651Sjhayint getc(int);
36183651Sjhayvoid putchar(int);
37183651Sjhayvoid xputchar(int);
38183651Sjhayvoid putstr(const char *);
39183651Sjhayvoid puthex8(u_int8_t);
40183651Sjhayvoid puthexlist(const u_int8_t *, int);
41183651Sjhayvoid printf(const char *fmt,...);
42183651Sjhay
43183651Sjhayvoid bzero(void *, size_t);
44183651Sjhaychar *strcpy(char *to, const char *from);
45183651Sjhayint strcmp(const char *to, const char *from);
46183651Sjhayint p_strlen(const char *);
47183651Sjhayint p_memcmp(const char *, const char *, unsigned);
48183651Sjhayvoid *memchr(const void *, int, size_t);
49183651Sjhayvoid memcpy(void *to, const void *from, unsigned size);
50183651Sjhayvoid *memmem(const void *, size_t, const void *, size_t);
51183651Sjhayvoid p_memset(char *buffer, char value, int size);
52183651Sjhay
53183651Sjhay#define strlen p_strlen
54183651Sjhay#define memcmp p_memcmp
55183651Sjhay#define memset p_memset
56183651Sjhay
57183651Sjhayu_int16_t swap16(u_int16_t);
58183651Sjhayu_int32_t swap32(u_int32_t);
59183651Sjhay
60183651Sjhayconst char *board_init(void);
61183651Sjhayvoid clr_board(void);
62183651Sjhayint avila_read(char*, unsigned, unsigned);
63186352Ssamu_int cpu_id(void);
64183651Sjhay
65183651Sjhay#endif /* !ARM_BOOT_LIB_H */
66