gcc 11 compatibility fix (suggestion) (#5778)
Fixes missing include and runtime variable in offsetof * gcc 11 compatibility fix * Revert "gcc 11 compatibility fix" This reverts commit bf5711d944bbdf7b5663ba4fec1b9066f16e2bb2. * gcc 11 compatibility fix (with pointer math) * Don't require pointers for framebuffer field math * Code style fix (clang-format)
This commit is contained in:
@@ -30,6 +30,14 @@ constexpr double SCREEN_REFRESH_RATE = BASE_CLOCK_RATE_ARM11 / static_cast<doubl
|
||||
// Returns index corresponding to the Regs member labeled by field_name
|
||||
#define GPU_REG_INDEX(field_name) (offsetof(GPU::Regs, field_name) / sizeof(u32))
|
||||
|
||||
// Returns index corresponding to the Regs::FramebufferConfig labeled by field_name
|
||||
// screen_id is a subscript for Regs::framebuffer_config
|
||||
#define GPU_FRAMEBUFFER_REG_INDEX(screen_id, field_name) \
|
||||
((offsetof(GPU::Regs, framebuffer_config) + \
|
||||
sizeof(GPU::Regs::FramebufferConfig) * (screen_id) + \
|
||||
offsetof(GPU::Regs::FramebufferConfig, field_name)) / \
|
||||
sizeof(u32))
|
||||
|
||||
// MMIO region 0x1EFxxxxx
|
||||
struct Regs {
|
||||
|
||||
|
Reference in New Issue
Block a user