diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2009-09-17 19:28:23 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2009-09-17 19:28:23 +0000 |
commit | d00e143c3a6e9ab84955a0c5615dd9a763f69d0e (patch) | |
tree | 25de0952af37ce6a5809a6a0be7a94cceec68c0d /sys/arch/alpha/tc | |
parent | 0563bf644d37b669c9f366e9c51f4af81d7fa87c (diff) |
Fail bus_space_map() calls if the flags can't be honoured (such as
BUS_SPACE_MAP_LINEAR in i/o space, or noncacheable linear TURBOchannel
mappings).
From NetBSD
Diffstat (limited to 'sys/arch/alpha/tc')
-rw-r--r-- | sys/arch/alpha/tc/tc_bus_mem.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/arch/alpha/tc/tc_bus_mem.c b/sys/arch/alpha/tc/tc_bus_mem.c index af6bfc8b9f6..1904cc0eb9c 100644 --- a/sys/arch/alpha/tc/tc_bus_mem.c +++ b/sys/arch/alpha/tc/tc_bus_mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tc_bus_mem.c,v 1.14 2009/07/26 18:48:54 miod Exp $ */ +/* $OpenBSD: tc_bus_mem.c,v 1.15 2009/09/17 19:28:22 miod Exp $ */ /* $NetBSD: tc_bus_mem.c,v 1.25 2001/09/04 05:31:28 thorpej Exp $ */ /* @@ -238,10 +238,16 @@ tc_mem_map(v, memaddr, memsize, flags, memhp) int flags; bus_space_handle_t *memhp; { + int cacheable = flags & BUS_SPACE_MAP_CACHEABLE; + int linear = flags & BUS_SPACE_MAP_LINEAR; + + /* Requests for linear uncacheable space can't be satisfied. */ + if (linear && !cacheable) + return (EOPNOTSUPP); if (memaddr & 0x7) panic("tc_mem_map needs 8 byte alignment"); - if (flags & BUS_SPACE_MAP_CACHEABLE) + if (cacheable) *memhp = ALPHA_PHYS_TO_K0SEG(memaddr); else *memhp = ALPHA_PHYS_TO_K0SEG(TC_DENSE_TO_SPARSE(memaddr)); |