Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Protect against bugs by using __strict_weak_alias()...
details: https://anonhg.NetBSD.org/src/rev/09fb88b31837
branches: trunk
changeset: 768440:09fb88b31837
user: dyoung <dyoung%NetBSD.org@localhost>
date: Tue Aug 16 23:32:15 2011 +0000
description:
Protect against bugs by using __strict_weak_alias() for
bus_space_is_equal() and bus_space_handle_is_equal().
diffstat:
sys/kern/kern_stub.c | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diffs (50 lines):
diff -r c20760550cb7 -r 09fb88b31837 sys/kern/kern_stub.c
--- a/sys/kern/kern_stub.c Tue Aug 16 23:30:24 2011 +0000
+++ b/sys/kern/kern_stub.c Tue Aug 16 23:32:15 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_stub.c,v 1.34 2011/07/06 18:24:26 dyoung Exp $ */
+/* $NetBSD: kern_stub.c,v 1.35 2011/08/16 23:32:15 dyoung Exp $ */
/*-
* Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_stub.c,v 1.34 2011/07/06 18:24:26 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_stub.c,v 1.35 2011/08/16 23:32:15 dyoung Exp $");
#include "opt_ptrace.h"
#include "opt_ktrace.h"
@@ -82,7 +82,8 @@
#include <sys/userconf.h>
bool default_bus_space_is_equal(bus_space_tag_t, bus_space_tag_t);
-bool default_bus_space_handle_is_equal(bus_space_handle_t, bus_space_handle_t);
+bool default_bus_space_handle_is_equal(bus_space_tag_t, bus_space_handle_t,
+ bus_space_handle_t);
/*
* Nonexistent system call-- signal process (may want to handle it). Flag
@@ -137,8 +138,9 @@
__weak_alias(bus_space_reservation_unmap, voidop);
__weak_alias(bus_space_tag_create, eopnotsupp);
__weak_alias(bus_space_tag_destroy, voidop);
-__weak_alias(bus_space_is_equal, default_bus_space_is_equal);
-__weak_alias(bus_space_handle_is_equal, default_bus_space_handle_is_equal);
+__strict_weak_alias(bus_space_is_equal, default_bus_space_is_equal);
+__strict_weak_alias(bus_space_handle_is_equal,
+ default_bus_space_handle_is_equal);
__weak_alias(userconf_bootinfo, voidop);
__weak_alias(userconf_init, voidop);
__weak_alias(userconf_prompt, voidop);
@@ -277,7 +279,8 @@
}
bool
-default_bus_space_handle_is_equal(bus_space_handle_t h1, bus_space_handle_t h2)
+default_bus_space_handle_is_equal(bus_space_tag_t t,
+ bus_space_handle_t h1, bus_space_handle_t h2)
{
return memcmp(&h1, &h2, sizeof(h1)) == 0;
Home |
Main Index |
Thread Index |
Old Index