Deleted Added
full compact
ofw_machdep.c (174599) ofw_machdep.c (174782)
1/*-
2 * Copyright (C) 1996 Wolfgang Solfrank.
3 * Copyright (C) 1996 TooLs GmbH.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 18 unchanged lines hidden (view full) ---

27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
28 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
29 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
31 * $NetBSD: ofw_machdep.c,v 1.5 2000/05/23 13:25:43 tsubai Exp $
32 */
33
34#include <sys/cdefs.h>
1/*-
2 * Copyright (C) 1996 Wolfgang Solfrank.
3 * Copyright (C) 1996 TooLs GmbH.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 18 unchanged lines hidden (view full) ---

27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
28 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
29 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
31 * $NetBSD: ofw_machdep.c,v 1.5 2000/05/23 13:25:43 tsubai Exp $
32 */
33
34#include <sys/cdefs.h>
35__FBSDID("$FreeBSD: head/sys/powerpc/aim/ofw_machdep.c 165151 2006-12-13 06:11:22Z marcel $");
35__FBSDID("$FreeBSD: head/sys/powerpc/aim/ofw_machdep.c 174782 2007-12-19 18:00:50Z marcel $");
36
37#include <sys/param.h>
38#include <sys/bus.h>
39#include <sys/systm.h>
40#include <sys/conf.h>
41#include <sys/disk.h>
42#include <sys/fcntl.h>
43#include <sys/malloc.h>

--- 366 unchanged lines hidden (view full) ---

410 }
411
412 next:
413 bridge = parent;
414 parent = OF_parent(bridge);
415 OF_get_addr_props(bridge, &naddr, &nsize, &pci);
416 }
417
36
37#include <sys/param.h>
38#include <sys/bus.h>
39#include <sys/systm.h>
40#include <sys/conf.h>
41#include <sys/disk.h>
42#include <sys/fcntl.h>
43#include <sys/malloc.h>

--- 366 unchanged lines hidden (view full) ---

410 }
411
412 next:
413 bridge = parent;
414 parent = OF_parent(bridge);
415 OF_get_addr_props(bridge, &naddr, &nsize, &pci);
416 }
417
418 /* Default to memory mapped I/O. */
419 *tag = PPC_BUS_SPACE_MEM;
420 if (spc == OFW_PCI_PHYS_HI_SPACE_IO)
421 *tag = PPC_BUS_SPACE_IO;
418 *tag = &bs_le_tag;
422 return (bus_space_map(*tag, addr, size, 0, handle));
423}
424
425int
426mem_valid(vm_offset_t addr, int len)
427{
428 int i;
429
430 for (i = 0; i < OFMEM_REGIONS; i++)
431 if ((addr >= OFmem[i].mr_start)
432 && (addr + len < OFmem[i].mr_start + OFmem[i].mr_size))
433 return (0);
434
435 return (EFAULT);
436}
419 return (bus_space_map(*tag, addr, size, 0, handle));
420}
421
422int
423mem_valid(vm_offset_t addr, int len)
424{
425 int i;
426
427 for (i = 0; i < OFMEM_REGIONS; i++)
428 if ((addr >= OFmem[i].mr_start)
429 && (addr + len < OFmem[i].mr_start + OFmem[i].mr_size))
430 return (0);
431
432 return (EFAULT);
433}