summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/pci/pccbb.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/sys/dev/pci/pccbb.c b/sys/dev/pci/pccbb.c
index d5801ac2a34..2ad3132f4d3 100644
--- a/sys/dev/pci/pccbb.c
+++ b/sys/dev/pci/pccbb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pccbb.c,v 1.68 2009/08/28 15:54:52 kettenis Exp $ */
+/* $OpenBSD: pccbb.c,v 1.69 2010/01/11 04:31:40 kettenis Exp $ */
/* $NetBSD: pccbb.c,v 1.96 2004/03/28 09:49:31 nakayama Exp $ */
/*
@@ -2602,30 +2602,19 @@ pccbb_rbus_cb_space_alloc(cardbus_chipset_tag_t ct, rbus_tag_t rb,
("pccbb_rbus_cb_space_alloc: adr %lx, size %lx, mask %lx, align %lx\n",
addr, size, mask, align));
- if (align == 0) {
- align = size;
+ align = max(align, 4);
+ mask = max(mask, (4 - 1));
+ if (rb->rb_bt == sc->sc_memt) {
+ align = max(align, 0x1000);
+ mask = max(mask, (0x1000 - 1));
}
- if (rb->rb_bt == sc->sc_memt) {
- if (align < 16) {
- return 1;
- }
- } else if (rb->rb_bt == sc->sc_iot) {
- if (align < 4) {
- return 1;
- }
+ if (rb->rb_bt == sc->sc_iot) {
/* XXX: hack for avoiding ISA image */
if (mask < 0x0100) {
mask = 0x3ff;
addr = 0x300;
}
-
- } else {
- DPRINTF(
- ("pccbb_rbus_cb_space_alloc: Bus space tag %x is NOT used.\n",
- rb->rb_bt));
- return 1;
- /* XXX: panic here? */
}
if (rbus_space_alloc(rb, addr, size, mask, align, flags, addrp, bshp)) {