cpu/amd: Fix cbtypes.h to match UINTN convention

There are some inconsistencies in AMDs APIs between the coreboot
code and the vendorcode code. Unify the API.

UINTN maps to uintptr_t in UEFI land. Do the same
here. Also switch the other UEFI types to map to
fixed size types.

Change-Id: Ib46893c7cd5368eae43e9cda30eed7398867ac5b
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Signed-off-by: Scott Duplichan <scott@notabs.org>
Reviewed-on: http://review.coreboot.org/10601
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
Stefan Reinauer
2015-07-29 23:54:38 -07:00
committed by Stefan Reinauer
parent d91ddc8d31
commit 5fa4cb6d32
14 changed files with 44 additions and 33 deletions

View File

@ -216,6 +216,7 @@
#elif defined __GNUC__
#include <stdint.h>
#define IN
#define OUT
#define STATIC static
@ -228,17 +229,20 @@
#define CALLCONV
#define _16BYTE_ALIGN __attribute__ ((aligned (16)))
// Create the universal 32, 16, and 8-bit data types
typedef unsigned char BOOLEAN;
typedef signed char INT8;
typedef signed short INT16;
typedef signed long INT32;
typedef char CHAR8;
typedef unsigned char UINT8;
typedef unsigned short UINT16;
typedef unsigned long UINT32;
typedef unsigned long UINTN;
typedef unsigned long long UINT64;
typedef long long INT64;
typedef uintptr_t UINTN;
typedef int64_t INT64;
typedef uint64_t UINT64;
typedef int32_t INT32;
typedef uint32_t UINT32;
typedef int16_t INT16;
typedef uint16_t UINT16;
typedef int8_t INT8;
typedef uint8_t UINT8;
typedef char CHAR8;
typedef unsigned short CHAR16;
typedef void VOID;
//typedef unsigned long size_t;

View File

@ -32,7 +32,7 @@
#pragma pack(push,1)
typedef UINT32 (*CIM_HOOK_ENTRY)(UINT32 Param1, UINTN Param2, void* pConfig);
typedef UINT32 (*CIM_HOOK_ENTRY)(UINT32 Param1, UINT32 Param2, void* pConfig);
typedef void (*SMM_SERVICE_ROUTINE) (void);
typedef struct _STDCFG{

View File

@ -46,6 +46,8 @@
#ifndef __VENDORCODE_AMD_CIMX_SB800_AMDSBLIB_H__
#define __VENDORCODE_AMD_CIMX_SB800_AMDSBLIB_H__
#include <cpu/amd/common/cbtypes.h>
//AMDSBLIB Routines
/**
@ -105,7 +107,7 @@ AGESA_STATUS AmdSbDispatcher (IN void *pConfig);
* @param[in] Length - Data length
*
*/
void AmdSbCopyMem (IN void* pDest, IN void* pSource, IN unsigned int Length);
void AmdSbCopyMem (IN void* pDest, IN void* pSource, IN UINTN Length);
/* SB800 CIMx and AGESA V5 can share lib functions */

View File

@ -69,10 +69,10 @@ unsigned char getEfuseByte (IN unsigned char Index);
AGESA_STATUS AmdSbDispatcher (IN void *pConfig);
/**< AmdSbCopyMem - Reserved */
void AmdSbCopyMem (IN void* pDest, IN void* pSource, IN unsigned int Length);
void AmdSbCopyMem (IN void* pDest, IN void* pSource, IN UINTN Length);
/**< GetRomSigPtr - Reserved */
void* GetRomSigPtr (IN unsigned int* RomSigPtr);
void* GetRomSigPtr (IN UINTN * RomSigPtr);
/**< RWXhciIndReg - Reserved */
void RWXhciIndReg (IN unsigned int Index, IN unsigned int AndMask, IN unsigned int OrMask);

View File

@ -71,7 +71,7 @@ void
MemoryCopy (
IN unsigned char *Dest,
IN unsigned char *Source,
IN unsigned int Size
IN unsigned long Size
);
//AMD Library Routines (PCILIB.C)

View File

@ -278,7 +278,7 @@ sbSmmAcpiOn (
UINTN
CallBackToOEM (
IN UINT32 Func,
IN UINT32 Data,
IN UINTN Data,
IN AMDSBCFG* pConfig
)
{

View File

@ -40,6 +40,7 @@
;
;*********************************************************************************/
#include <cpu/amd/common/cbtypes.h>
// Southbridge SBMAIN Routines
/**
@ -127,7 +128,7 @@ void sbSmmAcpiOn (IN AMDSBCFG* pConfig);
* @param[in] Data Callback specific data.
* @param[in] pConfig Southbridge configuration structure pointer.
*/
unsigned int CallBackToOEM (IN unsigned int Func, IN unsigned int Data, IN AMDSBCFG* pConfig);
UINTN CallBackToOEM (IN unsigned int Func, IN UINTN Data, IN AMDSBCFG* pConfig);
// Southbridge SBPOR Routines
@ -605,4 +606,4 @@ void TurnOffCG2 (OUT void);
*/
void BackUpCG2 (OUT void);
void XhciA12Fix (OUT void);
void XhciA12Fix (OUT void);