Module Name:    src
Committed By:   riastradh
Date:           Sat Aug 27 20:39:54 UTC 2022

Modified Files:
        src/sys/arch/x86/x86: db_memrw.c

Log Message:
x86/db_memrw.c: Use uint64_t, not long, for 8-byte r/w.

This is shared with amd64 and i386, and while long works on amd64,
not so much on i386.

While here, use uint32_t intead of int and uint16_t instead of short
for clarity.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/x86/x86/db_memrw.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/x86/db_memrw.c
diff -u src/sys/arch/x86/x86/db_memrw.c:1.14 src/sys/arch/x86/x86/db_memrw.c:1.15
--- src/sys/arch/x86/x86/db_memrw.c:1.14	Sat Aug 20 23:48:51 2022
+++ src/sys/arch/x86/x86/db_memrw.c	Sat Aug 27 20:39:54 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_memrw.c,v 1.14 2022/08/20 23:48:51 riastradh Exp $	*/
+/*	$NetBSD: db_memrw.c,v 1.15 2022/08/27 20:39:54 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1996, 2000 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_memrw.c,v 1.14 2022/08/20 23:48:51 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_memrw.c,v 1.15 2022/08/27 20:39:54 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -100,17 +100,17 @@ db_read_bytes(vaddr_t addr, size_t size,
 	}
 
 	if (size == 8) {
-		*((long *)data) = *((long *)src);
+		*((uint64_t *)data) = *((uint64_t *)src);
 		return;
 	}
 
 	if (size == 4) {
-		*((int *)data) = *((int *)src);
+		*((uint32_t *)data) = *((uint32_t *)src);
 		return;
 	}
 
 	if (size == 2) {
-		*((short *)data) = *((short *)src);
+		*((uint16_t *)data) = *((uint16_t *)src);
 		return;
 	}
 
@@ -230,17 +230,17 @@ db_write_bytes(vaddr_t addr, size_t size
 	dst = (char *)addr;
 
 	if (size == 8) {
-		*((long *)dst) = *((const long *)data);
+		*((uint64_t *)dst) = *((const uint64_t *)data);
 		return;
 	}
 
 	if (size == 4) {
-		*((int *)dst) = *((const int *)data);
+		*((uint32_t *)dst) = *((const uint32_t *)data);
 		return;
 	}
 
 	if (size == 2) {
-		*((short *)dst) = *((const short *)data);
+		*((uint16_t *)dst) = *((const uint16_t *)data);
 		return;
 	}
 

Reply via email to