diff options
author | Enrico Weigelt, metux IT consult <info@metux.net> | 2024-06-05 13:43:42 +0200 |
---|---|---|
committer | Martin-Éric Racine <martin-eric.racine@iki.fi> | 2024-10-11 09:02:37 +0000 |
commit | 8efe8313e45a851fd5cefb91c087b4dd0be47423 (patch) | |
tree | e6f9dea46cba69ce5821320639d8d3ea21c484b5 /src/gfx | |
parent | e006c8ca51f3b97d8e469ca737867820072a59fe (diff) |
fix FTBS on 64bit Linux
On 64bit the long int type is 64 bit, but the MSR operations still
are 32bit, thus we need to use uint32_t. Also need slighty modified
versions of the inline asm code, since on 64bit machines, the 32bit
(pseudo-)registers can't be used on push/pop.
This patch is mostly for CI purpose, since there isn't any known version
of this graphics device on a 64 bit machine.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Diffstat (limited to 'src/gfx')
-rw-r--r-- | src/gfx/gfx_defs.h | 10 | ||||
-rw-r--r-- | src/gfx/gfx_type.h | 6 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/gfx/gfx_defs.h b/src/gfx/gfx_defs.h index 045128c..46815db 100644 --- a/src/gfx/gfx_defs.h +++ b/src/gfx/gfx_defs.h @@ -31,6 +31,8 @@ * their own versions of these macros, which typically call a subroutine. * */ +#include <stdint.h> + /* ACCESS TO THE CPU REGISTERS */ #define WRITE_REG8(offset, value) \ @@ -111,10 +113,10 @@ /* ACCESS TO MSRS */ -void gfx_msr_asm_write(unsigned short msrReg, unsigned long msrAddr, - unsigned long *ptrHigh, unsigned long *ptrLow); -void gfx_msr_asm_read(unsigned short msrReg, unsigned long msrAddr, - unsigned long *ptrHigh, unsigned long *ptrLow); +void gfx_msr_asm_write(unsigned short msrReg, uint32_t msrAddr, + uint32_t *ptrHigh, uint32_t *ptrLow); +void gfx_msr_asm_read(unsigned short msrReg, uint32_t msrAddr, + uint32_t *ptrHigh, uint32_t *ptrLow); #define MSR_READ( MBD_MSR_CAP, address, valueHigh_ptr, valueLow_ptr ) \ gfx_msr_asm_read( ((unsigned short)(MBD_MSR_CAP)), address, \ diff --git a/src/gfx/gfx_type.h b/src/gfx/gfx_type.h index 4492354..290eacf 100644 --- a/src/gfx/gfx_type.h +++ b/src/gfx/gfx_type.h @@ -31,6 +31,8 @@ #ifndef _gfx_type_h #define _gfx_type_h +#include <stdint.h> + /* MSR DEFINITIONS */ typedef enum DevStatus @@ -44,8 +46,8 @@ typedef struct msr { } MSR; typedef struct mValue { - unsigned long high; - unsigned long low; + uint32_t high; + uint32_t low; } Q_WORD; typedef struct mbusNode { |