[U-Boot-Users] [Patch] U-Boot-v2: general replace __KERNEL__ with __UBOOT__

Menon, Nishanth x0nishan at ti.com
Thu Jun 19 05:57:32 CEST 2008


Robert,
> -----Original Message-----
> From: Robert Schwebel [mailto:r.schwebel at pengutronix.de]
> Sent: Wednesday, June 18, 2008 2:02 PM
> To: Menon, Nishanth
> Cc: Sascha Hauer; Laurent Desnogues; Kamat, Nishant; philip.balister at gmail.com; u-boot-
> users at lists.sourceforge.net
> Subject: Re: [U-Boot-Users] [Patch 1/9] U-boot-V2:ID: Sync mod_devicetable
>
> > +
> > +#ifndef LINUX_MOD_DEVICETABLE_H
> > +#define LINUX_MOD_DEVICETABLE_H
> > +
> > +#ifdef __KERNEL__
> > +#include <linux/types.h>
> > +typedef unsigned long kernel_ulong_t;
> > +#endif
>
> No Linux, no __KERNEL__.

Here is a patch to cleanup all other occurrences currently in u-boot v2. This is a blind replacement throughout. Do we want to consider replacing include/linux with include/u-boot?

Signed-off-by: Nishanth Menon <x0nishan at ti.com>

---
 Makefile                              |    2 +-
 include/asm-arm/byteorder.h           |    2 +-
 include/asm-arm/elf.h                 |    2 +-
 include/asm-arm/io.h                  |    4 ++--
 include/asm-arm/posix_types.h         |    8 ++++----
 include/asm-arm/proc-armv/ptrace.h    |    4 ++--
 include/asm-arm/processor.h           |    2 +-
 include/asm-arm/ptrace.h              |    2 +-
 include/asm-arm/types.h               |    4 ++--
 include/asm-blackfin/bitops.h         |    2 +-
 include/asm-blackfin/byteorder.h      |    2 +-
 include/asm-blackfin/elf.h            |    2 +-
 include/asm-blackfin/page.h           |    2 +-
 include/asm-blackfin/posix_types.h    |   10 +++++-----
 include/asm-blackfin/ptrace.h         |    2 +-
 include/asm-blackfin/setup.h          |    2 +-
 include/asm-blackfin/types.h          |    2 +-
 include/asm-m68k/byteorder.h          |    2 +-
 include/asm-m68k/elf.h                |    2 +-
 include/asm-m68k/io.h                 |    4 ++--
 include/asm-m68k/posix_types.h        |    8 ++++----
 include/asm-m68k/proc-mcfv4e/ptrace.h |    4 ++--
 include/asm-m68k/ptrace.h             |    2 +-
 include/asm-m68k/setup.h              |    8 ++++----
 include/asm-m68k/types.h              |    4 ++--
 include/asm-ppc/bitops.h              |    8 ++++----
 include/asm-ppc/cache.h               |    2 +-
 include/asm-ppc/elf.h                 |    8 ++++----
 include/asm-ppc/io.h                  |    3 ++-
 include/asm-ppc/posix_types.h         |    4 ++--
 include/asm-ppc/ptrace.h              |    2 +-
 include/asm-ppc/signal.h              |    4 ++--
 include/asm-ppc/types.h               |    4 ++--
 include/asm-sandbox/posix_types.h     |   10 +++++-----
 include/asm-sandbox/types.h           |    4 ++--
 include/cramfs/cramfs_fs.h            |    6 +++---
 include/envfs.h                       |    6 +++---
 include/linux/byteorder/generic.h     |    6 +++---
 include/linux/byteorder/swab.h        |    2 +-
 include/linux/types.h                 |    4 ++--
 40 files changed, 81 insertions(+), 80 deletions(-)

Index: u-boot-v2.git/Makefile
===================================================================
--- u-boot-v2.git.orig/Makefile 2008-06-18 22:34:23.000000000 -0500
+++ u-boot-v2.git/Makefile      2008-06-18 22:34:41.000000000 -0500
@@ -305,7 +305,7 @@
                    $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \
                   -include include/linux/autoconf.h

-CPPFLAGS        := -D__KERNEL__ -D__U_BOOT__ $(LINUXINCLUDE) -fno-builtin -ffreestanding
+CPPFLAGS        := -D__U_BOOT__ $(LINUXINCLUDE) -fno-builtin -ffreestanding

 CFLAGS          := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
                    -fno-strict-aliasing -fno-common -Os -pipe
Index: u-boot-v2.git/include/asm-arm/byteorder.h
===================================================================
--- u-boot-v2.git.orig/include/asm-arm/byteorder.h      2008-06-18 22:32:41.000000000 -0500
+++ u-boot-v2.git/include/asm-arm/byteorder.h   2008-06-18 22:32:43.000000000 -0500
@@ -18,7 +18,7 @@

 #include <asm/types.h>

-#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
+#if !defined(__STRICT_ANSI__) || defined(__U_BOOT__)
 #  define __BYTEORDER_HAS_U64__
 #  define __SWAB_64_THRU_32__
 #endif
Index: u-boot-v2.git/include/asm-arm/elf.h
===================================================================
--- u-boot-v2.git.orig/include/asm-arm/elf.h    2008-06-18 22:32:53.000000000 -0500
+++ u-boot-v2.git/include/asm-arm/elf.h 2008-06-18 22:32:54.000000000 -0500
@@ -41,7 +41,7 @@
 #endif
 #define ELF_ARCH       EM_ARM

-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 #ifndef __ASSEMBLY__
 /*
  * This yields a string that ld.so will use to load implementation
Index: u-boot-v2.git/include/asm-arm/io.h
===================================================================
--- u-boot-v2.git.orig/include/asm-arm/io.h     2008-06-18 22:32:45.000000000 -0500
+++ u-boot-v2.git/include/asm-arm/io.h  2008-06-18 22:32:48.000000000 -0500
@@ -20,7 +20,7 @@
 #ifndef __ASM_ARM_IO_H
 #define __ASM_ARM_IO_H

-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #include <linux/types.h>
 #include <asm/byteorder.h>
@@ -297,5 +297,5 @@
 #define isa_check_signature(io,sig,len)        (0)

 #endif /* __mem_isa */
-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */
 #endif /* __ASM_ARM_IO_H */
Index: u-boot-v2.git/include/asm-arm/posix_types.h
===================================================================
--- u-boot-v2.git.orig/include/asm-arm/posix_types.h    2008-06-18 22:32:32.000000000 -0500
+++ u-boot-v2.git/include/asm-arm/posix_types.h 2008-06-18 22:32:33.000000000 -0500
@@ -49,14 +49,14 @@
 #endif

 typedef struct {
-#if defined(__KERNEL__) || defined(__USE_ALL)
+#if defined(__U_BOOT__) || defined(__USE_ALL)
        int     val[2];
-#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
+#else /* !defined(__U_BOOT__) && !defined(__USE_ALL) */
        int     __val[2];
-#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
+#endif /* !defined(__U_BOOT__) && !defined(__USE_ALL) */
 } __kernel_fsid_t;

-#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
+#if defined(__U_BOOT__) || !defined(__GLIBC__) || (__GLIBC__ < 2)

 #undef __FD_SET
 #define __FD_SET(fd, fdsetp) \
Index: u-boot-v2.git/include/asm-arm/proc-armv/ptrace.h
===================================================================
--- u-boot-v2.git.orig/include/asm-arm/proc-armv/ptrace.h       2008-06-18 22:32:28.000000000 -0500
+++ u-boot-v2.git/include/asm-arm/proc-armv/ptrace.h    2008-06-18 22:32:29.000000000 -0500
@@ -59,7 +59,7 @@
 #define ARM_r0         uregs[0]
 #define ARM_ORIG_r0    uregs[17]

-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #define user_mode(regs)        \
        (((regs)->ARM_cpsr & 0xf) == 0)
@@ -100,7 +100,7 @@
        return 0;
 }

-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */

 #endif /* __ASSEMBLY__ */

Index: u-boot-v2.git/include/asm-arm/processor.h
===================================================================
--- u-boot-v2.git.orig/include/asm-arm/processor.h      2008-06-18 22:32:40.000000000 -0500
+++ u-boot-v2.git/include/asm-arm/processor.h   2008-06-18 22:32:41.000000000 -0500
@@ -34,7 +34,7 @@

 typedef unsigned long mm_segment_t;            /* domain register      */

-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #define EISA_bus 0
 #define MCA_bus 0
Index: u-boot-v2.git/include/asm-arm/ptrace.h
===================================================================
--- u-boot-v2.git.orig/include/asm-arm/ptrace.h 2008-06-18 22:32:44.000000000 -0500
+++ u-boot-v2.git/include/asm-arm/ptrace.h      2008-06-18 22:32:45.000000000 -0500
@@ -20,7 +20,7 @@
 #define instruction_pointer(regs) \
        (pc_pointer((regs)->ARM_pc))

-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 extern void show_regs(struct pt_regs *);

 #define predicate(x)   (x & 0xf0000000)
Index: u-boot-v2.git/include/asm-arm/types.h
===================================================================
--- u-boot-v2.git.orig/include/asm-arm/types.h  2008-06-18 22:32:21.000000000 -0500
+++ u-boot-v2.git/include/asm-arm/types.h       2008-06-18 22:32:24.000000000 -0500
@@ -29,7 +29,7 @@
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #define BITS_PER_LONG 32

@@ -54,6 +54,6 @@

 #endif /* __ASSEMBLY__ */

-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */

 #endif
Index: u-boot-v2.git/include/asm-blackfin/bitops.h
===================================================================
--- u-boot-v2.git.orig/include/asm-blackfin/bitops.h    2008-06-18 22:33:22.000000000 -0500
+++ u-boot-v2.git/include/asm-blackfin/bitops.h 2008-06-18 22:33:23.000000000 -0500
@@ -32,7 +32,7 @@
 #include <asm/byteorder.h>
 #include <asm/system.h>

-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 /*
  * Function prototypes to keep gcc -Wall happy
  */
Index: u-boot-v2.git/include/asm-blackfin/byteorder.h
===================================================================
--- u-boot-v2.git.orig/include/asm-blackfin/byteorder.h 2008-06-18 22:33:21.000000000 -0500
+++ u-boot-v2.git/include/asm-blackfin/byteorder.h      2008-06-18 22:33:22.000000000 -0500
@@ -30,7 +30,7 @@

 #include <asm/types.h>

-#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__U_BOOT__)
 #  define __BYTEORDER_HAS_U64__
 #  define __SWAB_64_THRU_32__
 #endif
Index: u-boot-v2.git/include/asm-blackfin/elf.h
===================================================================
--- u-boot-v2.git.orig/include/asm-blackfin/elf.h       2008-06-18 22:33:25.000000000 -0500
+++ u-boot-v2.git/include/asm-blackfin/elf.h    2008-06-18 22:33:26.000000000 -0500
@@ -120,7 +120,7 @@

 #define ELF_PLATFORM  (NULL)

-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
 #endif

Index: u-boot-v2.git/include/asm-blackfin/page.h
===================================================================
--- u-boot-v2.git.orig/include/asm-blackfin/page.h      2008-06-18 22:33:18.000000000 -0500
+++ u-boot-v2.git/include/asm-blackfin/page.h   2008-06-18 22:33:19.000000000 -0500
@@ -31,7 +31,7 @@
 #define PAGE_SIZE                      (4096)
 #define PAGE_MASK                      (~(PAGE_SIZE-1))

-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #include <asm/setup.h>

Index: u-boot-v2.git/include/asm-blackfin/posix_types.h
===================================================================
--- u-boot-v2.git.orig/include/asm-blackfin/posix_types.h       2008-06-18 22:33:03.000000000 -0500
+++ u-boot-v2.git/include/asm-blackfin/posix_types.h    2008-06-18 22:49:15.000000000 -0500
@@ -64,14 +64,14 @@
 #endif

 typedef struct {
-#if defined(__KERNEL__) || defined(__USE_ALL)
+#if defined(__U_BOOT__) || defined(__USE_ALL)
        int val[2];
-#else                          /* !defined(__KERNEL__) && !defined(__USE_ALL) */
+#else                  /* !defined(__U_BOOT__) && !defined(__USE_ALL) */
        int __val[2];
-#endif                         /* !defined(__KERNEL__) && !defined(__USE_ALL) */
+#endif                 /* !defined(__U_BOOT__) && !defined(__USE_ALL) */
 } __kernel_fsid_t;

-#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
+#if defined(__U_BOOT__) || !defined(__GLIBC__) || (__GLIBC__ < 2)

 #undef __FD_SET
 #define        __FD_SET(d, set)        ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
@@ -85,6 +85,6 @@
 #undef __FD_ZERO
 #define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp)))

-#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
+#endif /* defined(__U_BOOT__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */

 #endif
Index: u-boot-v2.git/include/asm-blackfin/ptrace.h
===================================================================
--- u-boot-v2.git.orig/include/asm-blackfin/ptrace.h    2008-06-18 22:33:24.000000000 -0500
+++ u-boot-v2.git/include/asm-blackfin/ptrace.h 2008-06-18 22:33:24.000000000 -0500
@@ -246,7 +246,7 @@
 #define PTRACE_GETREGS         12
 #define PTRACE_SETREGS         13      /* ptrace signal */

-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #ifndef PS_S
 #define PS_S                   (0x0c00)
Index: u-boot-v2.git/include/asm-blackfin/setup.h
===================================================================
--- u-boot-v2.git.orig/include/asm-blackfin/setup.h     2008-06-18 22:33:19.000000000 -0500
+++ u-boot-v2.git/include/asm-blackfin/setup.h  2008-06-18 22:33:20.000000000 -0500
@@ -35,7 +35,7 @@

 #define MACH_BFIN      1

-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #ifndef __ASSEMBLY__
 extern unsigned long blackfin_machtype;
Index: u-boot-v2.git/include/asm-blackfin/types.h
===================================================================
--- u-boot-v2.git.orig/include/asm-blackfin/types.h     2008-06-18 22:33:02.000000000 -0500
+++ u-boot-v2.git/include/asm-blackfin/types.h  2008-06-18 22:33:03.000000000 -0500
@@ -59,7 +59,7 @@
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 typedef signed char s8;
 typedef unsigned char u8;
Index: u-boot-v2.git/include/asm-m68k/byteorder.h
===================================================================
--- u-boot-v2.git.orig/include/asm-m68k/byteorder.h     2008-06-18 22:34:16.000000000 -0500
+++ u-boot-v2.git/include/asm-m68k/byteorder.h  2008-06-18 22:34:16.000000000 -0500
@@ -34,7 +34,7 @@

 #include <asm/types.h>

-#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
+#if !defined(__STRICT_ANSI__) || defined(__U_BOOT__)
 #  define __BYTEORDER_HAS_U64__
 #  define __SWAB_64_THRU_32__
 #endif
Index: u-boot-v2.git/include/asm-m68k/elf.h
===================================================================
--- u-boot-v2.git.orig/include/asm-m68k/elf.h   2008-06-18 22:34:22.000000000 -0500
+++ u-boot-v2.git/include/asm-m68k/elf.h        2008-06-18 22:34:23.000000000 -0500
@@ -139,7 +139,7 @@

 #define ELF_PLATFORM  (NULL)

-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 #define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
 #endif

Index: u-boot-v2.git/include/asm-m68k/io.h
===================================================================
--- u-boot-v2.git.orig/include/asm-m68k/io.h    2008-06-18 22:34:19.000000000 -0500
+++ u-boot-v2.git/include/asm-m68k/io.h 2008-06-18 22:34:20.000000000 -0500
@@ -26,7 +26,7 @@
 #ifndef __ASM_M68K_IO_H
 #define __ASM_M68K_IO_H

-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #include <linux/types.h>
 #include <asm/byteorder.h>
@@ -300,5 +300,5 @@
 #define isa_check_signature(io,sig,len)        (0)

 #endif /* __mem_isa */
-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */
 #endif /* __ASM_M68K_IO_H */
Index: u-boot-v2.git/include/asm-m68k/posix_types.h
===================================================================
--- u-boot-v2.git.orig/include/asm-m68k/posix_types.h   2008-06-18 22:33:54.000000000 -0500
+++ u-boot-v2.git/include/asm-m68k/posix_types.h        2008-06-18 22:33:55.000000000 -0500
@@ -57,14 +57,14 @@
 #endif

 typedef struct {
-#if defined(__KERNEL__) || defined(__USE_ALL)
+#if defined(__U_BOOT__) || defined(__USE_ALL)
        int     val[2];
-#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
+#else /* !defined(__U_BOOT__) && !defined(__USE_ALL) */
        int     __val[2];
-#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
+#endif /* !defined(__U_BOOT__) && !defined(__USE_ALL) */
 } __kernel_fsid_t;

-#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
+#if defined(__U_BOOT__) || !defined(__GLIBC__) || (__GLIBC__ < 2)

 #undef __FD_SET
 #define __FD_SET(fd, fdsetp) \
Index: u-boot-v2.git/include/asm-m68k/proc-mcfv4e/ptrace.h
===================================================================
--- u-boot-v2.git.orig/include/asm-m68k/proc-mcfv4e/ptrace.h    2008-06-18 22:34:03.000000000 -0500
+++ u-boot-v2.git/include/asm-m68k/proc-mcfv4e/ptrace.h 2008-06-18 22:34:04.000000000 -0500
@@ -81,7 +81,7 @@
 #define M68K_d0    uregs[ 0]


-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #define user_mode(regs)        \
        (((regs)->M68K_sr & SVR_MODE) == 0)
@@ -112,7 +112,7 @@
        return 0;
 }

-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */

 #endif /* __ASSEMBLY__ */

Index: u-boot-v2.git/include/asm-m68k/ptrace.h
===================================================================
--- u-boot-v2.git.orig/include/asm-m68k/ptrace.h        2008-06-18 22:34:17.000000000 -0500
+++ u-boot-v2.git/include/asm-m68k/ptrace.h     2008-06-18 22:34:18.000000000 -0500
@@ -46,7 +46,7 @@
 #define instruction_pointer(regs) ((regs)->M68K_pc)
 #define profile_pc(regs)          instruction_pointer(regs)

-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 extern void show_regs(struct pt_regs *);
 #endif

Index: u-boot-v2.git/include/asm-m68k/setup.h
===================================================================
--- u-boot-v2.git.orig/include/asm-m68k/setup.h 2008-06-18 22:34:07.000000000 -0500
+++ u-boot-v2.git/include/asm-m68k/setup.h      2008-06-18 22:34:08.000000000 -0500
@@ -45,7 +45,7 @@
     /* ColdFire boards */
 #define MACH_FIRE_ENGINE   12

-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #ifndef __ASSEMBLY__
 extern unsigned long m68k_machtype;
@@ -205,7 +205,7 @@
 #  define MACH_TYPE (m68k_machtype)
 #endif

-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */


     /*
@@ -261,7 +261,7 @@
 #define MMU_APOLLO     (1<<MMUB_APOLLO)
 #define MMU_CFV4E      (1<<MMUB_CFV4E)

-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #ifndef __ASSEMBLY__
 extern unsigned long m68k_cputype;
@@ -407,6 +407,6 @@
 #define  CHIP_RESTORE_DIRECTIVE  .chip 68k
 #endif

-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */

 #endif /* _M68K_SETUP_H */
Index: u-boot-v2.git/include/asm-m68k/types.h
===================================================================
--- u-boot-v2.git.orig/include/asm-m68k/types.h 2008-06-18 22:33:50.000000000 -0500
+++ u-boot-v2.git/include/asm-m68k/types.h      2008-06-18 22:33:51.000000000 -0500
@@ -52,7 +52,7 @@
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #define BITS_PER_LONG 32

@@ -77,6 +77,6 @@

 #endif /* __ASSEMBLY__ */

-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */

 #endif
Index: u-boot-v2.git/include/asm-ppc/bitops.h
===================================================================
--- u-boot-v2.git.orig/include/asm-ppc/bitops.h 2008-06-18 22:31:52.000000000 -0500
+++ u-boot-v2.git/include/asm-ppc/bitops.h      2008-06-18 22:31:53.000000000 -0500
@@ -166,7 +166,7 @@
        return __ilog2(x & -x);
 }

-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 /*
  * ffs: find first bit set. This is defined the same way as
@@ -187,7 +187,7 @@
 #define hweight16(x) generic_hweight16(x)
 #define hweight8(x) generic_hweight8(x)

-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */

 /*
  * This implementation of find_{first,next}_zero_bit was stolen from
@@ -235,7 +235,7 @@

 #define _EXT2_HAVE_ASM_BITOPS_

-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 /*
  * test_and_{set,clear}_bit guarantee atomicity without
  * disabling interrupts.
@@ -269,7 +269,7 @@
        *ADDR = *ADDR & ~mask;
        return oldbit;
 }
-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */

 extern __inline__ int ext2_test_bit(int nr, __const__ void * addr)
 {
Index: u-boot-v2.git/include/asm-ppc/cache.h
===================================================================
--- u-boot-v2.git.orig/include/asm-ppc/cache.h  2008-06-18 22:32:03.000000000 -0500
+++ u-boot-v2.git/include/asm-ppc/cache.h       2008-06-18 22:32:04.000000000 -0500
@@ -30,7 +30,7 @@
                 __section__(".data.cacheline_aligned")))
 #endif

-#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
+#if defined(__U_BOOT__) && !defined(__ASSEMBLY__)
 extern void flush_dcache_range(unsigned long start, unsigned long stop);
 extern void clean_dcache_range(unsigned long start, unsigned long stop);
 extern void invalidate_dcache_range(unsigned long start, unsigned long stop);
Index: u-boot-v2.git/include/asm-ppc/elf.h
===================================================================
--- u-boot-v2.git.orig/include/asm-ppc/elf.h    2008-06-18 22:32:14.000000000 -0500
+++ u-boot-v2.git/include/asm-ppc/elf.h 2008-06-18 22:32:15.000000000 -0500
@@ -153,7 +153,7 @@
 #endif
 #endif

-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 /*
  * This is used to ensure we don't load something for the wrong architecture.
  */
@@ -196,7 +196,7 @@

 #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs) dump_task_fpu(tsk, elf_fpregs)

-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */

 /* ELF_HWCAP yields a mask that user programs can use to figure out what
    instruction set this cpu supports.  This could be done in userspace,
@@ -215,7 +215,7 @@
 } while (0)
 #endif /* __powerpc64__ */

-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 #ifdef __powerpc64__
 # define SET_PERSONALITY(ex, ibcs2)                            \
@@ -244,7 +244,7 @@
 # define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
 #endif /* __powerpc64__ */

-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */

 extern int dcache_bsize;
 extern int icache_bsize;
Index: u-boot-v2.git/include/asm-ppc/io.h
===================================================================
--- u-boot-v2.git.orig/include/asm-ppc/io.h     2008-06-18 22:32:12.000000000 -0500
+++ u-boot-v2.git/include/asm-ppc/io.h  2008-06-18 22:49:46.000000000 -0500
@@ -1,6 +1,7 @@
 /* originally from linux source.
  * removed the dependencies on CONFIG_ values
- * removed virt_to_phys stuff (and in fact everything surrounded by #if __KERNEL__)
+ * removed virt_to_phys stuff (and in fact everything surrounded by
+ * #if __U_BOOT__)
  * Modified By Rob Taylor, Flying Pig Systems, 2000
  */

Index: u-boot-v2.git/include/asm-ppc/posix_types.h
===================================================================
--- u-boot-v2.git.orig/include/asm-ppc/posix_types.h    2008-06-18 22:31:48.000000000 -0500
+++ u-boot-v2.git/include/asm-ppc/posix_types.h 2008-06-18 22:31:50.000000000 -0500
@@ -50,7 +50,7 @@

 #else /* __GNUC__ */

-#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) \
+#if defined(__U_BOOT__) || !defined(__GLIBC__) || (__GLIBC__ < 2) \
     || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 0)
 /* With GNU C, use inline functions instead so args are evaluated only once: */

@@ -104,6 +104,6 @@
        }
 }

-#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
+#endif /* defined(__U_BOOT__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
 #endif /* __GNUC__ */
 #endif /* _PPC_POSIX_TYPES_H */
Index: u-boot-v2.git/include/asm-ppc/ptrace.h
===================================================================
--- u-boot-v2.git.orig/include/asm-ppc/ptrace.h 2008-06-18 22:32:04.000000000 -0500
+++ u-boot-v2.git/include/asm-ppc/ptrace.h      2008-06-18 22:32:07.000000000 -0500
@@ -90,7 +90,7 @@

 #define PT_NIP 32
 #define PT_MSR 33
-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 #define PT_ORIG_R3 34
 #endif
 #define PT_CTR 35
Index: u-boot-v2.git/include/asm-ppc/signal.h
===================================================================
--- u-boot-v2.git.orig/include/asm-ppc/signal.h 2008-06-18 22:32:08.000000000 -0500
+++ u-boot-v2.git/include/asm-ppc/signal.h      2008-06-18 22:32:09.000000000 -0500
@@ -97,7 +97,7 @@

 #define MINSIGSTKSZ    2048
 #define SIGSTKSZ       8192
-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 /*
  * These values of sa_flags are used only by the kernel as part of the
@@ -146,7 +146,7 @@
        size_t ss_size;
 } stack_t;

-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 #include <asm/sigcontext.h>

 #endif
Index: u-boot-v2.git/include/asm-ppc/types.h
===================================================================
--- u-boot-v2.git.orig/include/asm-ppc/types.h  2008-06-18 22:31:46.000000000 -0500
+++ u-boot-v2.git/include/asm-ppc/types.h       2008-06-18 22:31:47.000000000 -0500
@@ -23,7 +23,7 @@
        __u32 u[4];
 } __attribute((aligned(16))) vector128;

-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
@@ -44,7 +44,7 @@
 /* DMA addresses are 32-bits wide */
 typedef u32 dma_addr_t;

-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */
 #endif /* __ASSEMBLY__ */

 #endif
Index: u-boot-v2.git/include/asm-sandbox/posix_types.h
===================================================================
--- u-boot-v2.git.orig/include/asm-sandbox/posix_types.h        2008-06-18 22:31:29.000000000 -0500
+++ u-boot-v2.git/include/asm-sandbox/posix_types.h     2008-06-18 22:31:33.000000000 -0500
@@ -37,14 +37,14 @@
 #endif

 typedef struct {
-#if defined(__KERNEL__) || defined(__USE_ALL)
+#if defined(__U_BOOT__) || defined(__USE_ALL)
        int     val[2];
-#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */
+#else /* !defined(__U_BOOT__) && !defined(__USE_ALL) */
        int     __val[2];
-#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
+#endif /* !defined(__U_BOOT__) && !defined(__USE_ALL) */
 } __kernel_fsid_t;

-#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
+#if defined(__U_BOOT__) || !defined(__GLIBC__) || (__GLIBC__ < 2)

 #undef __FD_SET
 #define __FD_SET(fd,fdsetp) \
@@ -75,6 +75,6 @@
                        "2" ((__kernel_fd_set *) (fdsetp)) : "memory"); \
 } while (0)

-#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
+#endif /* defined(__U_BOOT__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */

 #endif
Index: u-boot-v2.git/include/asm-sandbox/types.h
===================================================================
--- u-boot-v2.git.orig/include/asm-sandbox/types.h      2008-06-18 22:30:03.000000000 -0500
+++ u-boot-v2.git/include/asm-sandbox/types.h   2008-06-18 22:31:15.000000000 -0500
@@ -33,7 +33,7 @@
 /*
  * These aren't exported outside the kernel to avoid name space clashes
  */
-#ifdef __KERNEL__
+#ifdef __U_BOOT__

 typedef signed char s8;
 typedef unsigned char u8;
@@ -53,6 +53,6 @@

 typedef u32 dma_addr_t;

-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */

 #endif
Index: u-boot-v2.git/include/cramfs/cramfs_fs.h
===================================================================
--- u-boot-v2.git.orig/include/cramfs/cramfs_fs.h       2008-06-18 22:32:54.000000000 -0500
+++ u-boot-v2.git/include/cramfs/cramfs_fs.h    2008-06-18 22:32:57.000000000 -0500
@@ -97,15 +97,15 @@
 #define CRAMFS_SET_OFFSET(x,y) ((x)->offset = (y))
 #define CRAMFS_SET_NAMELEN(x,y) ((x)->namelen = (y))
 #elif defined __BIG_ENDIAN
-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 #define CRAMFS_16(x)   swab16(x)
 #define CRAMFS_24(x)   ((swab32(x)) >> 8)
 #define CRAMFS_32(x)   swab32(x)
-#else /* not __KERNEL__ */
+#else /* not __U_BOOT__ */
 #define CRAMFS_16(x)   bswap_16(x)
 #define CRAMFS_24(x)   ((bswap_32(x)) >> 8)
 #define CRAMFS_32(x)   bswap_32(x)
-#endif /* not __KERNEL__ */
+#endif /* not __U_BOOT__ */
 #define CRAMFS_GET_NAMELEN(x)  (((u8*)(x))[8] & 0x3f)
 #define CRAMFS_GET_OFFSET(x)   ((CRAMFS_24(((u32*)(x))[2] & 0xffffff) << 2) |\
                                 ((((u32*)(x))[2] & 0xc0000000) >> 30))
Index: u-boot-v2.git/include/envfs.h
===================================================================
--- u-boot-v2.git.orig/include/envfs.h  2008-06-18 22:33:27.000000000 -0500
+++ u-boot-v2.git/include/envfs.h       2008-06-18 22:33:27.000000000 -0500
@@ -47,15 +47,15 @@
 #define ENVFS_SET_NAMELEN(x,y) ((x)->namelen = (y))
 #elif __BYTE_ORDER == __BIG_ENDIAN
 #warning "envfs compiled on big endian host"
-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 #define ENVFS_16(x)    swab16(x)
 #define ENVFS_24(x)    ((swab32(x)) >> 8)
 #define ENVFS_32(x)    swab32(x)
-#else /* not __KERNEL__ */
+#else /* not __U_BOOT__ */
 #define ENVFS_16(x)    bswap_16(x)
 #define ENVFS_24(x)    ((bswap_32(x)) >> 8)
 #define ENVFS_32(x)    bswap_32(x)
-#endif /* not __KERNEL__ */
+#endif /* not __U_BOOT__ */
 #define ENVFS_GET_NAMELEN(x) ENVFS_32(((x)->namelen))
 #define ENVFS_GET_OFFSET(x)    ENVFS_32(((x)->offset))
 #define ENVFS_SET_NAMELEN(x,y)((x)->offset = ENVFS_32((y)))
Index: u-boot-v2.git/include/linux/byteorder/generic.h
===================================================================
--- u-boot-v2.git.orig/include/linux/byteorder/generic.h        2008-06-18 22:33:44.000000000 -0500
+++ u-boot-v2.git/include/linux/byteorder/generic.h     2008-06-18 22:50:28.000000000 -0500
@@ -79,7 +79,7 @@
  */


-#if defined(__KERNEL__)
+#if defined(__U_BOOT__)
 /*
  * inside the kernel, we can use nicknames;
  * outside of it, we must avoid POSIX namespace pollution...
@@ -146,7 +146,7 @@
  * Do the prototypes. Somebody might want to take the
  * address or some such sick thing..
  */
-#if defined(__KERNEL__) || (defined (__GLIBC__) && __GLIBC__ >= 2)
+#if defined(__U_BOOT__) || (defined(__GLIBC__) && __GLIBC__ >= 2)
 extern __u32                   ntohl(__u32);
 extern __u32                   htonl(__u32);
 #else
@@ -164,7 +164,7 @@
 #define ___ntohl(x) __be32_to_cpu(x)
 #define ___ntohs(x) __be16_to_cpu(x)

-#if defined(__KERNEL__) || (defined (__GLIBC__) && __GLIBC__ >= 2)
+#if defined(__U_BOOT__) || (defined (__GLIBC__) && __GLIBC__ >= 2)
 #define htonl(x) ___htonl(x)
 #define ntohl(x) ___ntohl(x)
 #else
Index: u-boot-v2.git/include/linux/byteorder/swab.h
===================================================================
--- u-boot-v2.git.orig/include/linux/byteorder/swab.h   2008-06-18 22:33:42.000000000 -0500
+++ u-boot-v2.git/include/linux/byteorder/swab.h        2008-06-18 22:33:43.000000000 -0500
@@ -143,7 +143,7 @@
 }
 #endif /* __BYTEORDER_HAS_U64__ */

-#if defined(__KERNEL__)
+#if defined(__U_BOOT__)
 #define swab16 __swab16
 #define swab32 __swab32
 #define swab64 __swab64
Index: u-boot-v2.git/include/linux/types.h
===================================================================
--- u-boot-v2.git.orig/include/linux/types.h    2008-06-18 22:33:32.000000000 -0500
+++ u-boot-v2.git/include/linux/types.h 2008-06-18 22:33:35.000000000 -0500
@@ -17,7 +17,7 @@
 typedef __kernel_key_t         key_t;
 typedef __kernel_suseconds_t   suseconds_t;

-#ifdef __KERNEL__
+#ifdef __U_BOOT__
 typedef __kernel_uid32_t       uid_t;
 typedef __kernel_gid32_t       gid_t;
 typedef __kernel_uid16_t        uid16_t;
@@ -35,7 +35,7 @@
 #else
 typedef __kernel_uid_t         uid_t;
 typedef __kernel_gid_t         gid_t;
-#endif /* __KERNEL__ */
+#endif /* __U_BOOT__ */

 #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
 typedef __kernel_loff_t                loff_t;




More information about the U-Boot mailing list