[coreboot-gerrit] New patch to review for coreboot: 5e07b0f vendorcode/amd/agesa: Use macros already defined in stdlib.h

Edward O'Callaghan (eocallaghan@alterapraxis.com) gerrit at coreboot.org
Mon Jul 7 13:11:22 CEST 2014


Edward O'Callaghan (eocallaghan at alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6199

-gerrit

commit 5e07b0f3c69827aa8db097cb4acb568bb99f2af9
Author: Edward O'Callaghan <eocallaghan at alterapraxis.com>
Date:   Mon Jul 7 21:08:23 2014 +1000

    vendorcode/amd/agesa: Use macros already defined in stdlib.h
    
    We already have these macros define in 'stdlib.h'. Make good use of them
    here to avoid redefinition conflicts of the pre-processor depending on
    header inclusion ordering. This has the nice side-effect of syncing up
    AGESA families in this particular regard.
    
    Change-Id: Icf911629a4a1a82b01062fe16af4c8f812b05717
    Signed-off-by: Edward O'Callaghan <eocallaghan at alterapraxis.com>
---
 src/vendorcode/amd/agesa/f10/Proc/Mem/mu.h   |  2 +-
 src/vendorcode/amd/agesa/f14/Proc/Mem/mu.h   | 15 +-------------
 src/vendorcode/amd/agesa/f15/Proc/Mem/mu.h   | 15 +-------------
 src/vendorcode/amd/agesa/f15tn/Proc/Mem/mu.h | 28 +------------------------
 src/vendorcode/amd/agesa/f16kb/Proc/Mem/mu.h | 31 +---------------------------
 5 files changed, 5 insertions(+), 86 deletions(-)

diff --git a/src/vendorcode/amd/agesa/f10/Proc/Mem/mu.h b/src/vendorcode/amd/agesa/f10/Proc/Mem/mu.h
index fc19314..9c4ad01 100644
--- a/src/vendorcode/amd/agesa/f10/Proc/Mem/mu.h
+++ b/src/vendorcode/amd/agesa/f10/Proc/Mem/mu.h
@@ -60,7 +60,7 @@
   #define PSO_ENTRY UINT8
 #endif
 
-#define MAX(X, Y) (((X) < (Y)) ? (Y) : (X))
+#include <stdlib.h>
 
 /*----------------------------------------------------------------------------
  *                         TYPEDEFS, STRUCTURES, ENUMS
diff --git a/src/vendorcode/amd/agesa/f14/Proc/Mem/mu.h b/src/vendorcode/amd/agesa/f14/Proc/Mem/mu.h
index 2a9067d..23925b2 100644
--- a/src/vendorcode/amd/agesa/f14/Proc/Mem/mu.h
+++ b/src/vendorcode/amd/agesa/f14/Proc/Mem/mu.h
@@ -62,20 +62,7 @@
   #define PSO_ENTRY UINT8
 #endif
 
-//
-// Maximum value macro
-//
-#define MAX(X, Y) (((X) < (Y)) ? (Y) : (X))
-//
-// Minimum Value macro
-//
-#define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
-//
-// Absolute Value Macro
-//
-#define ABS(X) (((X) < 0) ? (-(X)) : (X))
-
-
+#include <stdlib.h>
 
 /*----------------------------------------------------------------------------
  *                         TYPEDEFS, STRUCTURES, ENUMS
diff --git a/src/vendorcode/amd/agesa/f15/Proc/Mem/mu.h b/src/vendorcode/amd/agesa/f15/Proc/Mem/mu.h
index 20d369b..c68f321 100644
--- a/src/vendorcode/amd/agesa/f15/Proc/Mem/mu.h
+++ b/src/vendorcode/amd/agesa/f15/Proc/Mem/mu.h
@@ -61,20 +61,7 @@
   #define PSO_ENTRY UINT8
 #endif
 
-//
-// Maximum value macro
-//
-#define MAX(X, Y) (((X) < (Y)) ? (Y) : (X))
-//
-// Minimum Value macro
-//
-#define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
-//
-// Absolute Value Macro
-//
-#define ABS(X) (((X) < 0) ? (-(X)) : (X))
-
-
+#include <stdlib.h>
 
 /*----------------------------------------------------------------------------
  *                         TYPEDEFS, STRUCTURES, ENUMS
diff --git a/src/vendorcode/amd/agesa/f15tn/Proc/Mem/mu.h b/src/vendorcode/amd/agesa/f15tn/Proc/Mem/mu.h
index 2933453..2c6941d 100644
--- a/src/vendorcode/amd/agesa/f15tn/Proc/Mem/mu.h
+++ b/src/vendorcode/amd/agesa/f15tn/Proc/Mem/mu.h
@@ -60,33 +60,7 @@
   #define PSO_ENTRY UINT8
 #endif
 
-//
-// Maximum value macro
-//
-#ifndef MAX
-  #define MAX(X, Y) (((X) < (Y)) ? (Y) : (X))
-#endif
-//
-// Minimum Value macro
-//
-#ifndef MIN
-  #define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
-#endif
-//
-// Absolute Value Macro
-//
-#ifndef ABS
-  #define ABS(X) (((X) < 0) ? (-(X)) : (X))
-#endif
-//
-// Taking ceiling of (a / b)
-//
-#define CEIL_DIV(a, b)  (((a) + (b) - 1) / (b))
-//
-// Check if value x is a power of 2 or not
-//
-#define IS_POWER_OF_2(x)  (((x) & ((x) - 1)) == 0)
-
+#include <stdlib.h>
 
 /*----------------------------------------------------------------------------
  *                         TYPEDEFS, STRUCTURES, ENUMS
diff --git a/src/vendorcode/amd/agesa/f16kb/Proc/Mem/mu.h b/src/vendorcode/amd/agesa/f16kb/Proc/Mem/mu.h
index 1489fe8..f415e52 100644
--- a/src/vendorcode/amd/agesa/f16kb/Proc/Mem/mu.h
+++ b/src/vendorcode/amd/agesa/f16kb/Proc/Mem/mu.h
@@ -60,36 +60,7 @@
   #define PSO_ENTRY UINT8
 #endif
 
-//
-// Maximum value macro
-//
-#ifndef MAX
-  #define MAX(X, Y) (((X) < (Y)) ? (Y) : (X))
-#endif
-//
-// Minimum Value macro
-//
-#ifndef MIN
-  #define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
-#endif
-//
-// Absolute Value Macro
-//
-#ifndef ABS
-  #define ABS(X) (((X) < 0) ? (-(X)) : (X))
-#endif
-//
-// Taking ceiling of (a / b)
-//
-#ifndef CEIL_DIV
-  #define CEIL_DIV(a, b)  (((a) + (b) - 1) / (b))
-#endif
-//
-// Check if value x is a power of 2 or not
-//
-#ifndef IS_POWER_OF_2
-  #define IS_POWER_OF_2(x)  (((x) & ((x) - 1)) == 0)
-#endif
+#include <stdlib.h>
 //
 // Find offset of a member variable in a struct
 //



More information about the coreboot-gerrit mailing list