RT-AC66 3.0.0.4.374.130 core
[tomato.git] / release / src-rt-6.x / linux / linux-2.6 / arch / powerpc / boot / flatdevtree_env.h
blob83bc1c718836f8d80a525aca082e971c9cedcdb6
1 /*
2 * This file adds the header file glue so that the shared files
3 * flatdevicetree.[ch] can compile and work in the powerpc bootwrapper.
5 * strncmp & strchr copied from <file:lib/strings.c>
6 * Copyright (C) 1991, 1992 Linus Torvalds
8 * Maintained by: Mark A. Greer <mgreer@mvista.com>
9 */
10 #ifndef _PPC_BOOT_FLATDEVTREE_ENV_H_
11 #define _PPC_BOOT_FLATDEVTREE_ENV_H_
13 #include <stdarg.h>
14 #include <stddef.h>
15 #include "types.h"
16 #include "string.h"
17 #include "stdio.h"
18 #include "ops.h"
20 #define be16_to_cpu(x) (x)
21 #define cpu_to_be16(x) (x)
22 #define be32_to_cpu(x) (x)
23 #define cpu_to_be32(x) (x)
24 #define be64_to_cpu(x) (x)
25 #define cpu_to_be64(x) (x)
27 static inline int strncmp(const char *cs, const char *ct, size_t count)
29 signed char __res = 0;
31 while (count) {
32 if ((__res = *cs - *ct++) != 0 || !*cs++)
33 break;
34 count--;
36 return __res;
39 static inline char *strchr(const char *s, int c)
41 for (; *s != (char)c; ++s)
42 if (*s == '\0')
43 return NULL;
44 return (char *)s;
47 #endif /* _PPC_BOOT_FLATDEVTREE_ENV_H_ */