Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/mac68k Fixes for volatile problems
details: https://anonhg.NetBSD.org/src/rev/972d3c006f4b
branches: trunk
changeset: 582106:972d3c006f4b
user: jmc <jmc%NetBSD.org@localhost>
date: Thu Jun 16 22:43:36 2005 +0000
description:
Fixes for volatile problems
diffstat:
sys/arch/mac68k/dev/adb.c | 8 ++++----
sys/arch/mac68k/dev/adb_direct.c | 18 +++++++++---------
sys/arch/mac68k/dev/mac68k5380.c | 16 ++++++++--------
sys/arch/mac68k/dev/sbc.c | 6 +++---
sys/arch/mac68k/dev/zs.c | 6 +++---
sys/arch/mac68k/obio/esp.c | 18 +++++++++---------
6 files changed, 36 insertions(+), 36 deletions(-)
diffs (truncated from 303 to 300 lines):
diff -r 6006e43752f4 -r 972d3c006f4b sys/arch/mac68k/dev/adb.c
--- a/sys/arch/mac68k/dev/adb.c Thu Jun 16 22:04:24 2005 +0000
+++ b/sys/arch/mac68k/dev/adb.c Thu Jun 16 22:43:36 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: adb.c,v 1.46 2005/01/15 16:00:59 chs Exp $ */
+/* $NetBSD: adb.c,v 1.47 2005/06/16 22:43:36 jmc Exp $ */
/*
* Copyright (C) 1994 Bradley A. Grantham
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: adb.c,v 1.46 2005/01/15 16:00:59 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adb.c,v 1.47 2005/06/16 22:43:36 jmc Exp $");
#include "opt_adb.h"
@@ -271,8 +271,8 @@
int result;
volatile int flag = 0;
- result = ADBOp(buffer, (void *)adb_op_comprout,
- (void *)&flag, command); /* send command */
+ result = ADBOp(buffer, (void *)adb_op_comprout, __UNVOLATILE(&flag),
+ command); /* send command */
if (result == 0) { /* send ok? */
/*
* Total time to wait is calculated as follows:
diff -r 6006e43752f4 -r 972d3c006f4b sys/arch/mac68k/dev/adb_direct.c
--- a/sys/arch/mac68k/dev/adb_direct.c Thu Jun 16 22:04:24 2005 +0000
+++ b/sys/arch/mac68k/dev/adb_direct.c Thu Jun 16 22:43:36 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: adb_direct.c,v 1.50 2005/01/15 16:00:59 chs Exp $ */
+/* $NetBSD: adb_direct.c,v 1.51 2005/06/16 22:43:36 jmc Exp $ */
/* From: adb_direct.c 2.02 4/18/97 jpw */
@@ -62,7 +62,7 @@
#ifdef __NetBSD__
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: adb_direct.c,v 1.50 2005/01/15 16:00:59 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adb_direct.c,v 1.51 2005/06/16 22:43:36 jmc Exp $");
#include "opt_adb.h"
@@ -213,7 +213,7 @@
/*
* Text representations of each hardware class
*/
-char *adbHardwareDescr[MAX_ADB_HW + 1] = {
+const char *adbHardwareDescr[MAX_ADB_HW + 1] = {
"unknown",
"II series",
"IIsi series",
@@ -2724,7 +2724,7 @@
output[1] = 0x01; /* to pram/rtc device */
output[2] = 0x03; /* read date/time */
result = send_adb_IIsi((u_char *)output, (u_char *)output,
- (void *)adb_op_comprout, (int *)&flag, (int)0);
+ (void *)adb_op_comprout, __UNVOLATILE(&flag), (int)0);
if (result != 0) /* exit if not sent */
return -1;
@@ -2742,7 +2742,7 @@
output[1] = 0x01; /* to pram/rtc device */
output[2] = 0x03; /* read date/time */
result = send_adb_cuda((u_char *)output, (u_char *)output,
- (void *)adb_op_comprout, (void *)&flag, (int)0);
+ (void *)adb_op_comprout, __UNVOLATILE(&flag), (int)0);
if (result != 0) /* exit if not sent */
return -1;
@@ -2783,7 +2783,7 @@
output[5] = (u_char)(time >> 8);
output[6] = (u_char)(time);
result = send_adb_IIsi((u_char *)output, (u_char *)0,
- (void *)adb_op_comprout, (void *)&flag, (int)0);
+ (void *)adb_op_comprout, __UNVOLATILE(&flag), (int)0);
if (result != 0) /* exit if not sent */
return -1;
@@ -2804,7 +2804,7 @@
output[5] = (u_char)(time >> 8);
output[6] = (u_char)(time);
result = send_adb_cuda((u_char *)output, (u_char *)0,
- (void *)adb_op_comprout, (void *)&flag, (int)0);
+ (void *)adb_op_comprout, __UNVOLATILE(&flag), (int)0);
if (result != 0) /* exit if not sent */
return -1;
@@ -2883,7 +2883,7 @@
output[2] = 0x1c; /* prog. switch control */
output[3] = 0x01; /* enable */
result = send_adb_IIsi((u_char *)output, (u_char *)0,
- (void *)adb_op_comprout, (void *)&flag, (int)0);
+ (void *)adb_op_comprout, __UNVOLATILE(&flag), (int)0);
if (result != 0) /* exit if not sent */
return -1;
@@ -2918,7 +2918,7 @@
output[2] = 0x1c; /* prog. switch control */
output[3] = 0x01; /* disable */
result = send_adb_IIsi((u_char *)output, (u_char *)0,
- (void *)adb_op_comprout, (void *)&flag, (int)0);
+ (void *)adb_op_comprout, __UNVOLATILE(&flag), (int)0);
if (result != 0) /* exit if not sent */
return -1;
diff -r 6006e43752f4 -r 972d3c006f4b sys/arch/mac68k/dev/mac68k5380.c
--- a/sys/arch/mac68k/dev/mac68k5380.c Thu Jun 16 22:04:24 2005 +0000
+++ b/sys/arch/mac68k/dev/mac68k5380.c Thu Jun 16 22:43:36 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mac68k5380.c,v 1.41 2005/01/15 16:00:59 chs Exp $ */
+/* $NetBSD: mac68k5380.c,v 1.42 2005/06/16 22:43:36 jmc Exp $ */
/*
* Copyright (c) 1995 Allen Briggs
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mac68k5380.c,v 1.41 2005/01/15 16:00:59 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mac68k5380.c,v 1.42 2005/06/16 22:43:36 jmc Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -95,7 +95,7 @@
#endif
#ifdef DBG_PID
/* static char *last_hit = NULL, *olast_hit = NULL; */
- static char *last_hit[DBG_PID];
+ static const char *last_hit[DBG_PID];
# define PID(a) \
{ int i; \
for (i = 0; i < DBG_PID - 1; i++) \
@@ -130,7 +130,7 @@
static volatile u_char *ncr_5380_with_drq = (volatile u_char *) 0x6000;
static volatile u_char *ncr_5380_without_drq = (volatile u_char *) 0x12000;
-#define SCSI_5380 ((struct scsi_5380 *) ncr)
+#define SCSI_5380 ((volatile struct scsi_5380 *) ncr)
#define GET_5380_REG(rnum) SCSI_5380->scsi_5380[((rnum)<<4)]
#define SET_5380_REG(rnum,val) (SCSI_5380->scsi_5380[((rnum)<<4)] = (val))
@@ -408,7 +408,7 @@
4 - (((int) pending_5380_data) & 0x3));
if (count && (count < 4)) {
data = (u_int8_t *) pending_5380_data;
- drq = (u_int8_t *) ncr_5380_with_drq;
+ drq = (volatile u_int8_t *) ncr_5380_with_drq;
while (count) {
#define R1 *data++ = *drq++
R1; count--;
@@ -439,7 +439,7 @@
}
#undef R4
data = (u_int8_t *) long_data;
- drq = (u_int8_t *) long_drq;
+ drq = (volatile u_int8_t *) long_drq;
while (count) {
#define R1 *data++ = *drq++
R1; count--;
@@ -458,7 +458,7 @@
4 - (((int) pending_5380_data) & 0x3));
if (count && (count < 4)) {
data = (u_int8_t *) pending_5380_data;
- drq = (u_int8_t *) ncr_5380_with_drq;
+ drq = (volatile u_int8_t *) ncr_5380_with_drq;
while (count) {
#define W1 *drq++ = *data++
W1; count--;
@@ -490,7 +490,7 @@
}
#undef W4
data = (u_int8_t *) long_data;
- drq = (u_int8_t *) long_drq;
+ drq = (volatile u_int8_t *) long_drq;
while (count) {
#define W1 *drq++ = *data++
W1; count--;
diff -r 6006e43752f4 -r 972d3c006f4b sys/arch/mac68k/dev/sbc.c
--- a/sys/arch/mac68k/dev/sbc.c Thu Jun 16 22:04:24 2005 +0000
+++ b/sys/arch/mac68k/dev/sbc.c Thu Jun 16 22:43:36 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sbc.c,v 1.45 2005/01/15 16:00:59 chs Exp $ */
+/* $NetBSD: sbc.c,v 1.46 2005/06/16 22:43:36 jmc Exp $ */
/*
* Copyright (C) 1996 Scott Reynolds. All rights reserved.
@@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sbc.c,v 1.45 2005/01/15 16:00:59 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbc.c,v 1.46 2005/06/16 22:43:36 jmc Exp $");
#include "opt_ddb.h"
@@ -506,7 +506,7 @@
}
#undef W4
data = (u_int8_t *)long_data;
- drq = (u_int8_t *)long_drq;
+ drq = (volatile u_int8_t *)long_drq;
#define W1 *drq++ = *data++
while (count) {
diff -r 6006e43752f4 -r 972d3c006f4b sys/arch/mac68k/dev/zs.c
--- a/sys/arch/mac68k/dev/zs.c Thu Jun 16 22:04:24 2005 +0000
+++ b/sys/arch/mac68k/dev/zs.c Thu Jun 16 22:43:36 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: zs.c,v 1.47 2005/01/16 00:32:59 chs Exp $ */
+/* $NetBSD: zs.c,v 1.48 2005/06/16 22:43:36 jmc Exp $ */
/*
* Copyright (c) 1996-1998 Bill Studenmund
@@ -54,7 +54,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.47 2005/01/16 00:32:59 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.48 2005/06/16 22:43:36 jmc Exp $");
#include "opt_ddb.h"
#include "opt_mac68k.h"
@@ -177,7 +177,7 @@
char *addr;
struct zschan *zc;
- addr = (char *)sccA;
+ addr = (char *)__UNVOLATILE(sccA);
if (channel == 0) {
zc = (struct zschan *)(addr + 2);
/* handle the fact the ports are intertwined. */
diff -r 6006e43752f4 -r 972d3c006f4b sys/arch/mac68k/obio/esp.c
--- a/sys/arch/mac68k/obio/esp.c Thu Jun 16 22:04:24 2005 +0000
+++ b/sys/arch/mac68k/obio/esp.c Thu Jun 16 22:43:36 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: esp.c,v 1.39 2005/03/05 17:40:56 chs Exp $ */
+/* $NetBSD: esp.c,v 1.40 2005/06/16 22:43:36 jmc Exp $ */
/*
* Copyright (c) 1997 Jason R. Thorpe.
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: esp.c,v 1.39 2005/03/05 17:40:56 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: esp.c,v 1.40 2005/06/16 22:43:36 jmc Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -731,7 +731,7 @@
len &= ~1;
statreg = esc->sc_reg + NCR_STAT * 16;
- pdma = (u_int16_t *) (esc->sc_reg + 0x100);
+ pdma = (volatile u_int16_t *) (esc->sc_reg + 0x100);
/*
* These loops are unrolled into assembly for two reasons:
@@ -773,8 +773,8 @@
: "0" (addr), "g" (pdma), "g" (cnt32), "g" (cnt2)
: "a2", "a3", "d2");
if (esc->sc_pad) {
- unsigned char *c;
- c = (unsigned char *) addr;
+ volatile unsigned char *c;
+ c = (volatile unsigned char *) addr;
/* Wait for DREQ */
while (!esp_have_dreq(esc)) {
if (*statreg & 0x80) {
@@ -782,7 +782,7 @@
goto gotintr;
}
}
- *(unsigned char *)pdma = *c;
+ *(volatile unsigned char *)pdma = *c;
}
} else {
/* while (cnt32--) { 16 instances of *addr++ = *pdma; } */
@@ -816,8 +816,8 @@
: "0" (addr), "g" (pdma), "g" (cnt32), "g" (cnt2)
: "a2", "a3", "d2");
if (esc->sc_pad) {
- unsigned char *c;
- c = (unsigned char *) addr;
+ volatile unsigned char *c;
+ c = (volatile unsigned char *) addr;
/* Wait for DREQ */
while (!esp_have_dreq(esc)) {
if (*statreg & 0x80) {
@@ -825,7 +825,7 @@
goto gotintr;
}
}
- *c = *(unsigned char *)pdma;
+ *c = *(volatile unsigned char *)pdma;
Home |
Main Index |
Thread Index |
Old Index