LOCAL STATUS cacheLsn2eInvalidate ( CACHE_TYPE cache, /* Cache to Invalidate */ void * pVirtAdrs, /* Virtual Address */ size_t bytes /* Number of Bytes to Invalidate */ ) { if (IS_KSEG1(pVirtAdrs)) return(OK); switch (cache) { case DATA_CACHE: if (bytes == ENTIRE_CACHE) cacheLsn2eDCInvalidateAll (); else cacheLsn2eDCInvalidate (pVirtAdrs, bytes); break; case INSTRUCTION_CACHE: if (bytes == ENTIRE_CACHE) cacheLsn2eICInvalidateAll (); else cacheLsn2eICInvalidate (pVirtAdrs, bytes); break; default: errno = S_cacheLib_INVALID_CACHE; return (ERROR); break; } return (OK); }
void __iounmap(const volatile void __iomem *addr) { struct vm_struct *p; if (IS_KSEG1(addr)) return; p = remove_vm_area((void *) (PAGE_MASK & (unsigned long __force) addr)); if (!p) printk(KERN_ERR "iounmap: bad address %p\n", addr); kfree(p); }
LOCAL STATUS cacheLsn2eTextUpdate ( void * address, /* Physical address */ size_t bytes /* bytes to invalidate */ ) { if ((bytes != ENTIRE_CACHE) && ((address == NULL) || (bytes == 0) || IS_KSEG1(address))) return (OK); if (cacheLsn2eFlush (DATA_CACHE, address, bytes) != OK) return (ERROR); return (cacheLsn2eInvalidate (INSTRUCTION_CACHE, address, bytes)); }
void __iounmap(void *addr) { struct vm_struct *p; if (IS_KSEG1(addr)) return; vfree((void *) (PAGE_MASK & (unsigned long) addr)); p = remove_vm_area((void *) (PAGE_MASK & (unsigned long) addr)); if (!p) { printk(KERN_ERR "iounmap: bad address %p\n", addr); return; } kfree(p); }
void __iounmap(const volatile void __iomem *addr) { struct vm_struct *p; if (IS_KSEG1(addr)) return; if (in_interrupt()) { kunmap_atomic((void *)addr, KM_PCIE); return; } p = remove_vm_area((void *) (PAGE_MASK & (unsigned long __force) addr)); if (!p) printk(KERN_ERR "iounmap: bad address %p\n", addr); kfree(p); }
LOCAL STATUS cacheLsn2eFree ( void * pBuf ) { void * pCacheBuffer; #ifdef IS_KSEGM BLOCK_HDR * pHdr; /* pointer to block header */ STATUS status = OK; /* return value */ /* Check for unmapped case */ if (IS_KSEG1(pBuf)) { #endif /* IS_KSEGM */ pCacheBuffer = (void *)K1_TO_K0(pBuf); pCacheBuffer = (void *)((int)pCacheBuffer - sizeof (void *)); free (*(void **)pCacheBuffer); #ifdef IS_KSEGM } else { if (vmLibInfo.vmLibInstalled) { pHdr = BLOCK_TO_HDR (pBuf); /* * XXX - cache mode is set back to the default one. This may be * a problem since we do not know if the original cache mode was either * COPY_BACK or WRITETHROUGH. */ status = VM_STATE_SET (NULL, pBuf, BLOCK_SIZE (pHdr), MMU_ATTR_CACHE_MSK, MMU_ATTR_CACHE_DEFAULT); } IOBUF_FREE (pBuf); /* free buffer after modified */ return (status); } #endif /* IS_KSEGM */ return (OK); }
void iounmap(volatile void __iomem *addr) { if (!IS_KSEG1(addr)) vfree((void *) (PAGE_MASK & (unsigned long) addr)); }
void __iounmap(volatile void __iomem *addr) { struct vm_struct *p; if (IS_KSEG1(addr)) return; #ifdef CONFIG_MIPS_BRCM97XXX #ifndef CONFIG_DISCONTIGMEM #if defined( CONFIG_MIPS_BCM7038A0 ) if ( (((unsigned long)addr >= 0xd0000000) && ((unsigned long)addr <= 0xe060000b))) return; #elif defined( CONFIG_MIPS_BCM7038B0 ) || defined( CONFIG_MIPS_BCM7038C0 ) \ || defined( CONFIG_MIPS_BCM7400 ) if ( (((unsigned long)addr >= 0xd0000000) && ((unsigned long)addr <= 0xf060000b))) return; #elif defined( CONFIG_MIPS_BCM3560 ) \ || defined( CONFIG_MIPS_BCM7401 ) || defined( CONFIG_MIPS_BCM7402 ) \ || defined( CONFIG_MIPS_BCM7118 ) || defined( CONFIG_MIPS_BCM7403 ) \ || defined( CONFIG_MIPS_BCM7452 ) if (((((unsigned long) (addr)) >= 0xd0000000) && (((unsigned long) (addr)) <= 0xf060000b)) || (((unsigned long) (addr)) >= 0xff400000)) return; #else if ((unsigned long)addr >= 0xffe00000) return; #endif #else #if defined(CONFIG_MIPS_BCM97438 ) if ((((unsigned long)addr >= 0xd0000000) && ((unsigned long)addr < 0xe0000000)) || (((unsigned long)addr >= 0xf0000000) && ((unsigned long)addr <= 0xf060000b))) return; /* else upper ram area is handled just like lower ram, handled below */ #elif defined ( CONFIG_MIPS_BCM7440 ) if (((unsigned long)addr >= 0xd0000000) && ((unsigned long)addr < 0xd8000000)) /* 128 MB of PCI-MEM */ return; if (((unsigned long)addr >= 0xf8000000) && ((unsigned long)addr < 0xfa000000)) /* 32 MB of PCI-IO */ return; #else #error "Unsupported discontigmem platform" #endif #endif #endif p = remove_vm_area((void *) (PAGE_MASK & (unsigned long __force) addr)); if (!p) { printk(KERN_ERR "iounmap: bad address %p\n", addr); return; } kfree(p); }
void iounmap(void *addr) { if (!IS_KSEG1(addr)) return vfree((void *) (PAGE_MASK & (unsigned long) addr)); }