summaryrefslogtreecommitdiffstats
path: root/sys/pc98/pc98
diff options
context:
space:
mode:
authornyan <nyan@FreeBSD.org>2008-07-05 16:31:58 +0000
committernyan <nyan@FreeBSD.org>2008-07-05 16:31:58 +0000
commitb8ebcde152d873c59bf3e8e4e7900ca1a71604ed (patch)
treecadd0216923c8565ddb7aff4e4dba44d20526f41 /sys/pc98/pc98
parent54ef085aeeb1c1e11f58d72d96a630352b1b26e9 (diff)
downloadFreeBSD-src-b8ebcde152d873c59bf3e8e4e7900ca1a71604ed.zip
FreeBSD-src-b8ebcde152d873c59bf3e8e4e7900ca1a71604ed.tar.gz
Add i386_memio_compare() to compare two resources.
It's used by uart(4) in the future.
Diffstat (limited to 'sys/pc98/pc98')
-rw-r--r--sys/pc98/pc98/busiosubr.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/sys/pc98/pc98/busiosubr.c b/sys/pc98/pc98/busiosubr.c
index 8776d3f..79b06ce 100644
--- a/sys/pc98/pc98/busiosubr.c
+++ b/sys/pc98/pc98/busiosubr.c
@@ -279,3 +279,28 @@ i386_memio_subregion(bus_space_tag_t t, bus_space_handle_t pbsh,
*tbshp = bsh;
return error;
}
+
+int
+i386_memio_compare(bus_space_tag_t t1, bus_space_handle_t bsh1,
+ bus_space_tag_t t2, bus_space_handle_t bsh2)
+{
+ int i;
+
+ if (t1->bs_tag != t2->bs_tag)
+ return (1);
+ if (bsh1->bsh_base != bsh2->bsh_base)
+ return (1);
+ if (bsh1->bsh_sz != bsh2->bsh_sz)
+ return (1);
+ if (bsh1->bsh_bam.bs_read_1 != bsh2->bsh_bam.bs_read_1) /* XXX */
+ return (1);
+
+ if (bsh1->bsh_iatsz != bsh2->bsh_iatsz)
+ return (1);
+ for (i = 0; i < bsh1->bsh_iatsz; i++) {
+ if (bsh1->bsh_iat[i] != bsh2->bsh_iat[i])
+ return (1);
+ }
+
+ return (0);
+}
OpenPOWER on IntegriCloud