Skip to contentSkip to conversation

[patch 1/3]

PATCH In review [email protected] 2 participants 3 messages Aug 27, 2004 – Aug 29, 2004 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 [patch 1/3]

#   The following is from Jean-Christophe Dubois <[email protected]>.
#   On Solaris 2.8, <stdint.h> does not exist, but <inttypes.h> does.
#   However, on cygwin (the other odd place that the kernel is compiled
#   on) <inttypes.h> doesn't exist.  So we end up with something like
#   the following.

#
# Signed-off-by: Tom Rini <[email protected]>
---

 linux-2.6-solaris-trini/arch/ppc/boot/utils/mkbugboot.c |   12 ++++++------
 linux-2.6-solaris-trini/arch/ppc/boot/utils/mktree.c    |    4 ++++
 linux-2.6-solaris-trini/scripts/mod/sumversion.c        |    4 ++++
 3 files changed, 14 insertions(+), 6 deletions(-)
arch/ppc/boot/utils/mkbugboot.c renamed from arch/ppc/boot/utils/mkbugboot.c~inttypes_stdint +6 -6
diff -puN arch/ppc/boot/utils/mkbugboot.c~inttypes_stdint arch/ppc/boot/utils/mkbugboot.c
@@ -1,5 +1,5 @@
 /*
- * arch/ppc/pp3boot/mkbugboot.c
+ * arch/ppc/boot/utils/mkbugboot.c
  *
  * Makes a Motorola PPCBUG ROM bootable image which can be flashed
  * into one of the FLASH banks on a Motorola PowerPlus board.
@@ -21,6 +21,11 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <fcntl.h>
+#ifdef __sun__
+#include <inttypes.h>
+#else
+#include <stdint.h>
+#endif
 
 #ifdef __i386__
 #define cpu_to_be32(x) le32_to_cpu(x)
@@ -49,11 +54,6 @@ unsigned short le16_to_cpu(unsigned shor
 /* size of read buffer */
 #define SIZE 0x1000
 
-/* typedef long int32_t; */
-typedef unsigned long uint32_t;
-typedef unsigned short uint16_t;
-typedef unsigned char uint8_t;
-
 /* PPCBUG ROM boot header */
 typedef struct bug_boot_header {
   uint8_t	magic_word[4];		/* "BOOT" */
arch/ppc/boot/utils/mktree.c renamed from arch/ppc/boot/utils/mktree.c~inttypes_stdint +4 -0
diff -puN arch/ppc/boot/utils/mktree.c~inttypes_stdint arch/ppc/boot/utils/mktree.c
@@ -15,7 +15,11 @@
 #include <sys/stat.h>
 #include <unistd.h>
 #include <netinet/in.h>
+#ifdef __sun__
+#include <inttypes.h>
+#else
 #include <stdint.h>
+#endif
 
 /* This gets tacked on the front of the image.  There are also a few
  * bytes allocated after the _start label used by the boot rom (see
scripts/mod/sumversion.c renamed from scripts/mod/sumversion.c~inttypes_stdint +4 -0
diff -puN scripts/mod/sumversion.c~inttypes_stdint scripts/mod/sumversion.c
@@ -1,5 +1,9 @@
 #include <netinet/in.h>
+#ifdef __sun__
+#include <inttypes.h>
+#else
 #include <stdint.h>
+#endif
 #include <ctype.h>
 #include <errno.h>
 #include <string.h>

_

author
#1 lore raw
Quoted 7 lines · On Fri, Aug 27, 2004 at 02:53:04PM -0700, [email protected] wrote:
#   The following is from Jean-Christophe Dubois <[email protected]>.
#   On Solaris 2.8, <stdint.h> does not exist, but <inttypes.h> does.
#   However, on cygwin (the other odd place that the kernel is compiled
#   on) <inttypes.h> doesn't exist.  So we end up with something like
#   the following.

#
# Signed-off-by: Tom Rini <[email protected]>

Arg, I thought I refpatch'ed, but didn't, so they all came out just a bit wrong. The descs elsewhere were correct, but this should have been:
On Solaris 2.8, <stdint.h> does not exist, but <inttypes.h> does. However, on Cygwin (the other odd place that the kernel is compiled on) <inttypes.h> doesn't exist. So we end up testing for __sun__ and using <inttypes.h> there, and <stdint.h> everywhere else.

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/
#2 lore raw
Quoted 10 lines · Tom Rini
Quoted 7 lines · On Fri, Aug 27, 2004 at 02:53:04PM -0700, [email protected] wrote:
#   The following is from Jean-Christophe Dubois <[email protected]>.
#   On Solaris 2.8, <stdint.h> does not exist, but <inttypes.h> does.
#   However, on cygwin (the other odd place that the kernel is compiled
#   on) <inttypes.h> doesn't exist.  So we end up with something like
#   the following.

#
# Signed-off-by: Tom Rini <[email protected]>

Quoted 6 lines

Arg, I thought I refpatch'ed, but didn't, so they all came out just a bit wrong. The descs elsewhere were correct, but this should have been:
On Solaris 2.8, <stdint.h> does not exist, but <inttypes.h> does. However, on Cygwin (the other odd place that the kernel is compiled on) <inttypes.h> doesn't exist. So we end up testing for __sun__ and using <inttypes.h> there, and <stdint.h> everywhere else.

All three patches applied - thanks!

Sam