From fc9a64f311bb07b3e288416decf4ddb8960c86a2 Mon Sep 17 00:00:00 2001 From: oga Date: Wed, 9 Jul 2008 23:33:07 +0000 Subject: [PATCH] Fixup AGP_MODE{GET,SET}_RATE() macros. the agp 2.0 spec defines that the lowest three bits are for the current agp rate. not the lowest two. Otherwise we preclude agp 4x mode. It's a bit different for agp 3.0, but we don't have the bits for that yet. Tested by several as part of a larger diff. --- sys/sys/agpio.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/sys/agpio.h b/sys/sys/agpio.h index c5f6567412c..350a68ca6d6 100644 --- a/sys/sys/agpio.h +++ b/sys/sys/agpio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: agpio.h,v 1.2 2007/11/25 17:44:58 oga Exp $ */ +/* $OpenBSD: agpio.h,v 1.3 2008/07/09 23:33:07 oga Exp $ */ /*- * Copyright (c) 2000 Doug Rabson @@ -47,13 +47,13 @@ #define AGP_MODE_GET_AGP(x) (((x) & 0x00000100U) >> 8) #define AGP_MODE_GET_4G(x) (((x) & 0x00000020U) >> 5) #define AGP_MODE_GET_FW(x) (((x) & 0x00000010U) >> 4) -#define AGP_MODE_GET_RATE(x) ((x) & 0x00000003U) +#define AGP_MODE_GET_RATE(x) ((x) & 0x00000007U) #define AGP_MODE_SET_RQ(x,v) (((x) & ~0xff000000U) | ((v) << 24)) #define AGP_MODE_SET_SBA(x,v) (((x) & ~0x00000200U) | ((v) << 9)) #define AGP_MODE_SET_AGP(x,v) (((x) & ~0x00000100U) | ((v) << 8)) #define AGP_MODE_SET_4G(x,v) (((x) & ~0x00000020U) | ((v) << 5)) #define AGP_MODE_SET_FW(x,v) (((x) & ~0x00000010U) | ((v) << 4)) -#define AGP_MODE_SET_RATE(x,v) (((x) & ~0x00000003U) | (v)) +#define AGP_MODE_SET_RATE(x,v) (((x) & ~0x00000007U) | (v)) #define AGP_MODE_RATE_1x 0x00000001 #define AGP_MODE_RATE_2x 0x00000002 #define AGP_MODE_RATE_4x 0x00000004 -- 2.20.1