1/*
2 * Copyright 2017, Data61
3 * Commonwealth Scientific and Industrial Research Organisation (CSIRO)
4 * ABN 41 687 119 230.
5 *
6 * This software may be distributed and modified according to the terms of
7 * the GNU General Public License version 2. Note that NO WARRANTY is provided.
8 * See "LICENSE_GPLv2.txt" for details.
9 *
10 * @TAG(DATA61_GPL)
11 */
12
13#pragma once
14
15/* this is a dumping ground */
16#include <stddef.h>
17#include <stdio.h>
18#include <stdint.h>
19
20#ifndef RESOURCE
21#define RESOURCE(mapper, id) ps_io_map(mapper,  (uintptr_t) id##_PADDR, id##_SIZE, 0, PS_MEM_NORMAL)
22#define UNRESOURCE(mapper, id, addr) ps_io_unmap(mapper, addr, id##_SIZE)
23#endif
24
25#define __aligned(x) __attribute__((aligned(x)))
26#define unlikely(x) __builtin_expect(!!(x), 0)
27
28#define MAX_PKT_SIZE    1536
29
30#define BITS_PER_LONG 32
31
32void udelay(uint32_t us);
33
34unsigned long simple_strtoul(const char *cp, char **endp, unsigned int base);
35
36typedef uint64_t u64;
37typedef uint32_t u32;
38typedef uint16_t u16;
39typedef uint8_t  u8;
40
41typedef int64_t s64;
42typedef int32_t s32;
43typedef int16_t s16;
44typedef int8_t  s8;
45
46typedef unsigned long ulong;
47typedef unsigned short ushort;
48typedef unsigned int  uint;
49typedef unsigned char uchar;
50
51typedef u64 __u64;
52typedef u32 __u32;
53typedef u16 __u16;
54typedef u8  __u8;
55
56#define __bitwise /*__attribute__((bitwise))*/
57#define __force /* __attribute__((force)) */
58
59typedef s64 __bitwise __le64;
60typedef s32 __bitwise __le32;
61typedef s16 __bitwise __le16;
62typedef s8  __bitwise __le8;
63
64typedef s64 __bitwise __be64;
65typedef s32 __bitwise __be32;
66typedef s16 __bitwise __be16;
67typedef s8  __bitwise __be8;
68
69#define gpio_init()
70
71