ioremap.c (33c2b803edd13487518a2c7d5002d84d7e9c878f) ioremap.c (f88a68facd9a15b94f8c195d9d2c0b30c76c595a)
1/*
2 * Re-map IO memory to kernel address space so that we can access it.
3 * This is needed for high PCI addresses that aren't mapped in the
4 * 640k-1MB IO memory area on PC's
5 *
6 * (C) Copyright 1995 1996 Linus Torvalds
7 */
8

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

412void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr)
413{
414 if (page_is_ram(phys >> PAGE_SHIFT))
415 return;
416
417 iounmap((void __iomem *)((unsigned long)addr & PAGE_MASK));
418}
419
1/*
2 * Re-map IO memory to kernel address space so that we can access it.
3 * This is needed for high PCI addresses that aren't mapped in the
4 * 640k-1MB IO memory area on PC's
5 *
6 * (C) Copyright 1995 1996 Linus Torvalds
7 */
8

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

412void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr)
413{
414 if (page_is_ram(phys >> PAGE_SHIFT))
415 return;
416
417 iounmap((void __iomem *)((unsigned long)addr & PAGE_MASK));
418}
419
420#ifdef CONFIG_ARCH_USE_MEMREMAP_PROT
421/* Remap memory with encryption */
422void __init *early_memremap_encrypted(resource_size_t phys_addr,
423 unsigned long size)
424{
425 return early_memremap_prot(phys_addr, size, __PAGE_KERNEL_ENC);
426}
427
428/*
429 * Remap memory with encryption and write-protected - cannot be called
430 * before pat_init() is called
431 */
432void __init *early_memremap_encrypted_wp(resource_size_t phys_addr,
433 unsigned long size)
434{
435 /* Be sure the write-protect PAT entry is set for write-protect */
436 if (__pte2cachemode_tbl[_PAGE_CACHE_MODE_WP] != _PAGE_CACHE_MODE_WP)
437 return NULL;
438
439 return early_memremap_prot(phys_addr, size, __PAGE_KERNEL_ENC_WP);
440}
441
442/* Remap memory without encryption */
443void __init *early_memremap_decrypted(resource_size_t phys_addr,
444 unsigned long size)
445{
446 return early_memremap_prot(phys_addr, size, __PAGE_KERNEL_NOENC);
447}
448
449/*
450 * Remap memory without encryption and write-protected - cannot be called
451 * before pat_init() is called
452 */
453void __init *early_memremap_decrypted_wp(resource_size_t phys_addr,
454 unsigned long size)
455{
456 /* Be sure the write-protect PAT entry is set for write-protect */
457 if (__pte2cachemode_tbl[_PAGE_CACHE_MODE_WP] != _PAGE_CACHE_MODE_WP)
458 return NULL;
459
460 return early_memremap_prot(phys_addr, size, __PAGE_KERNEL_NOENC_WP);
461}
462#endif /* CONFIG_ARCH_USE_MEMREMAP_PROT */
463
420static pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)] __page_aligned_bss;
421
422static inline pmd_t * __init early_ioremap_pmd(unsigned long addr)
423{
424 /* Don't assume we're using swapper_pg_dir at this point */
425 pgd_t *base = __va(read_cr3_pa());
426 pgd_t *pgd = &base[pgd_index(addr)];
427 p4d_t *p4d = p4d_offset(pgd, addr);

--- 73 unchanged lines hidden ---
464static pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)] __page_aligned_bss;
465
466static inline pmd_t * __init early_ioremap_pmd(unsigned long addr)
467{
468 /* Don't assume we're using swapper_pg_dir at this point */
469 pgd_t *base = __va(read_cr3_pa());
470 pgd_t *pgd = &base[pgd_index(addr)];
471 p4d_t *p4d = p4d_offset(pgd, addr);

--- 73 unchanged lines hidden ---