From 081f461390903125d6705b2dd54d5cba6b71f6ec Mon Sep 17 00:00:00 2001 From: Rudolf Cornelissen Date: Mon, 13 Jun 2005 09:23:26 +0000 Subject: [PATCH] corrected all dummyreads to use volatile pointers. Thanks Marcus Overhagen for reading along. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13082 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../accelerants/nvidia/engine/nv_acc_dma.c | 2 +- .../accelerants/nvidia/engine/nv_info.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/add-ons/accelerants/nvidia/engine/nv_acc_dma.c b/src/add-ons/accelerants/nvidia/engine/nv_acc_dma.c index 60cac11443..e6a3278fbc 100644 --- a/src/add-ons/accelerants/nvidia/engine/nv_acc_dma.c +++ b/src/add-ons/accelerants/nvidia/engine/nv_acc_dma.c @@ -1264,7 +1264,7 @@ static void nv_start_dma(void) else { /* dummy read the first adress of the framebuffer to flush MTRR-WC buffers */ - dummy = *((uint32 *)(si->framebuffer)); + dummy = *((volatile uint32 *)(si->framebuffer)); } /* actually start DMA to execute all commands now in buffer */ diff --git a/src/add-ons/accelerants/nvidia/engine/nv_info.c b/src/add-ons/accelerants/nvidia/engine/nv_info.c index 3bf30d5027..488191236a 100644 --- a/src/add-ons/accelerants/nvidia/engine/nv_info.c +++ b/src/add-ons/accelerants/nvidia/engine/nv_info.c @@ -1,7 +1,7 @@ /* Read initialisation information from card */ /* some bits are hacks, where PINS is not known */ /* Author: - Rudolf Cornelissen 7/2003-5/2005 + Rudolf Cornelissen 7/2003-6/2005 */ #define MODULE_BIT 0x00002000 @@ -1916,10 +1916,10 @@ static void setup_ram_config_nv10_up(uint8* rom) /* reset first RAM adress */ ((uint32 *)si->framebuffer)[0x00] = 0x00000000; /* dummyread first RAM adress four times */ - dummy = ((uint32 *)si->framebuffer)[0x00]; - dummy = ((uint32 *)si->framebuffer)[0x00]; - dummy = ((uint32 *)si->framebuffer)[0x00]; - dummy = ((uint32 *)si->framebuffer)[0x00]; + dummy = ((volatile uint32 *)si->framebuffer)[0x00]; + dummy = ((volatile uint32 *)si->framebuffer)[0x00]; + dummy = ((volatile uint32 *)si->framebuffer)[0x00]; + dummy = ((volatile uint32 *)si->framebuffer)[0x00]; /* check testpattern to have survived */ if (((uint32 *)si->framebuffer)[(data >> 2)] == 0x4e564441) stat = B_OK; cnt++; @@ -1958,13 +1958,13 @@ static void setup_ram_config_nv28(uint8* rom) /* reset first RAM adress */ ((uint32 *)si->framebuffer)[0x00000000] = 0x00000000; /* dummyread first RAM adress four times */ - dummy = ((uint32 *)si->framebuffer)[0x00000000]; + dummy = ((volatile uint32 *)si->framebuffer)[0x00000000]; LOG(8,("INFO: (#%d) dummy1 = $%08x, ", cnt, dummy)); - dummy = ((uint32 *)si->framebuffer)[0x00000000]; + dummy = ((volatile uint32 *)si->framebuffer)[0x00000000]; LOG(8,("dummy2 = $%08x, ", dummy)); - dummy = ((uint32 *)si->framebuffer)[0x00000000]; + dummy = ((volatile uint32 *)si->framebuffer)[0x00000000]; LOG(8,("dummy3 = $%08x, ", dummy)); - dummy = ((uint32 *)si->framebuffer)[0x00000000]; + dummy = ((volatile uint32 *)si->framebuffer)[0x00000000]; LOG(8,("dummy4 = $%08x\n", dummy)); /* check testpattern to have survived */ if (((uint32 *)si->framebuffer)[0x01fc0000] == 0x4e564441) stat = B_OK;