kernel/5004: LP64 friendly atop and ptoa macro definition

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

kernel/5004: LP64 friendly atop and ptoa macro definition

Takashi-4
>Number:         5004
>Category:       kernel
>Synopsis:       LP64 friendly atop and ptoa macro definition
>Confidential:   yes
>Severity:       critical
>Priority:       high
>Responsible:    bugs
>State:          open
>Quarter:        
>Keywords:      
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 03 03:00:02 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     KUDO Takashi
>Release:        3.9
>Organization:
net
>Environment:
        System      : OpenBSD 3.9
        Architecture: OpenBSD.alpha
        Machine     : alpha
>Description:
        on my alpha XP1000, Xorg does not start.
>How-To-Repeat:
        on alpha with any supported vga card, start Xorg.
>Fix:
I've tested this patch with Synergy and Radeon 7500 with XP1000.
It's seems to work ok.

Index: ./sys/uvm/uvm_param.h
===================================================================
RCS file: /pub/cvs/openbsd/src/sys/uvm/uvm_param.h,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 uvm_param.h
--- ./sys/uvm/uvm_param.h 29 Jan 2006 18:24:13 -0000 1.1.1.2
+++ ./sys/uvm/uvm_param.h 3 Feb 2006 01:43:02 -0000
@@ -153,8 +153,8 @@
  * No rounding is used.
  */
 #ifdef _KERNEL
-#define atop(x) ((x) >> PAGE_SHIFT)
-#define ptoa(x) ((x) << PAGE_SHIFT)
+#define atop(x) ((unsigned long)(x) >> PAGE_SHIFT)
+#define ptoa(x) ((unsigned long)(x) << PAGE_SHIFT)
 
 /*
  * Round off or truncate to the nearest page.  These will work


>Release-Note:
>Audit-Trail:
>Unformatted: