OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [arch/] [sparc/] [prom/] [devmap.c] - Blame information for rev 1777

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1624 jcastillo
/* $Id: devmap.c,v 1.1 2005-12-20 09:49:32 jcastillo Exp $
2
 * promdevmap.c:  Map device/IO areas to virtual addresses.
3
 *
4
 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
5
 */
6
 
7
#include <asm/openprom.h>
8
#include <asm/oplib.h>
9
 
10
/* Just like the routines in palloc.c, these should not be used
11
 * by the kernel at all.  Bootloader facility mainly.  And again,
12
 * this is only available on V2 proms and above.
13
 */
14
 
15
/* Map physical device address 'paddr' in IO space 'ios' of size
16
 * 'num_bytes' to a virtual address, with 'vhint' being a hint to
17
 * the prom as to where you would prefer the mapping.  We return
18
 * where the prom actually mapped it.
19
 */
20
char *
21
prom_mapio(char *vhint, int ios, unsigned int paddr, unsigned int num_bytes)
22
{
23
        if((num_bytes == 0) || (paddr == 0)) return (char *) 0x0;
24
        return (*(romvec->pv_v2devops.v2_dumb_mmap))(vhint, ios, paddr,
25
                                                     num_bytes);
26
}
27
 
28
/* Unmap an IO/device area that was mapped using the above routine. */
29
void
30
prom_unmapio(char *vaddr, unsigned int num_bytes)
31
{
32
        if(num_bytes == 0x0) return;
33
        (*(romvec->pv_v2devops.v2_dumb_munmap))(vaddr, num_bytes);
34
        return;
35
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.