Author: bdragon
Date: Mon Sep 14 15:48:30 2020
New Revision: 365724
URL: https://svnweb.freebsd.org/changeset/base/365724

Log:
  stand/ficl 64-bit compatibility
  
  Currently, the only thing that prevents a functioning 64-bit FICL build is
  a few integer types that were intended to be fixed-width.
  
  Changing them to C99 integer types allows building a functioning 64-bit
  FICL.
  
  While this isn't applicable to the default settings of any in-tree loaders,
  it is necessary for a future Petitboot loader, due to the requirement that
  it be compiled as a 64-bit program.
  
  Reviewed by:  tsoome, imp (earlier revision)
  Sponsored by: Tag1 Consulting, Inc.
  Differential Revision:        https://reviews.freebsd.org/D26364

Modified:
  head/stand/ficl/ficl.h
  head/stand/ficl/powerpc/sysdep.h
  head/stand/powerpc/ofw/main.c

Modified: head/stand/ficl/ficl.h
==============================================================================
--- head/stand/ficl/ficl.h      Mon Sep 14 15:20:37 2020        (r365723)
+++ head/stand/ficl/ficl.h      Mon Sep 14 15:48:30 2020        (r365724)
@@ -249,7 +249,7 @@ typedef struct ficl_system_info FICL_SYSTEM_INFO;
 ** complement of false... that unifies logical and bitwise operations
 ** nicely.
 */
-#define FICL_TRUE  ((unsigned long)~(0L))
+#define FICL_TRUE  ((FICL_UNS)~(0LL))
 #define FICL_FALSE (0)
 #define FICL_BOOL(x) ((x) ? FICL_TRUE : FICL_FALSE)
 

Modified: head/stand/ficl/powerpc/sysdep.h
==============================================================================
--- head/stand/ficl/powerpc/sysdep.h    Mon Sep 14 15:20:37 2020        
(r365723)
+++ head/stand/ficl/powerpc/sysdep.h    Mon Sep 14 15:48:30 2020        
(r365724)
@@ -79,15 +79,15 @@
 ** System dependent data type declarations...
 */
 #if !defined INT32
-#define INT32 int
+#define INT32 int32_t
 #endif
 
 #if !defined UNS32
-#define UNS32 unsigned int
+#define UNS32 uint32_t
 #endif
 
 #if !defined UNS16
-#define UNS16 unsigned short
+#define UNS16 uint16_t
 #endif
 
 #if !defined UNS8
@@ -367,6 +367,9 @@ typedef struct
 */
 #if !defined FICL_ALIGN
 #define FICL_ALIGN 2
+#endif
+
+#if !defined FICL_ALIGN_ADD
 #define FICL_ALIGN_ADD ((1 << FICL_ALIGN) - 1)
 #endif
 

Modified: head/stand/powerpc/ofw/main.c
==============================================================================
--- head/stand/powerpc/ofw/main.c       Mon Sep 14 15:20:37 2020        
(r365723)
+++ head/stand/powerpc/ofw/main.c       Mon Sep 14 15:48:30 2020        
(r365724)
@@ -63,7 +63,7 @@ init_heap(void)
 {
        bzero(heap, HEAP_SIZE);
 
-       setheap(heap, (void *)((int)heap + HEAP_SIZE));
+       setheap(heap, (void *)((uintptr_t)heap + HEAP_SIZE));
 }
 
 uint64_t
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to