diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1998-03-17 22:05:47 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1998-03-17 22:05:47 +0000 |
commit | 27cfca1ec98e91261b1a5355d10a8996464b63af (patch) | |
tree | 8e895a53e372fa682b4c0a585b9377d67ed70d0e /include/asm-arm/arch-rpc/mmap.h | |
parent | 6a76fb7214c477ccf6582bd79c5b4ccc4f9c41b1 (diff) |
Look Ma' what I found on my harddisk ...
o New faster syscalls for 2.1.x, too
o Upgrade to 2.1.89.
Don't try to run this. It's flaky as hell. But feel free to debug ...
Diffstat (limited to 'include/asm-arm/arch-rpc/mmap.h')
-rw-r--r-- | include/asm-arm/arch-rpc/mmap.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/include/asm-arm/arch-rpc/mmap.h b/include/asm-arm/arch-rpc/mmap.h new file mode 100644 index 000000000..4a1cdeab9 --- /dev/null +++ b/include/asm-arm/arch-rpc/mmap.h @@ -0,0 +1,48 @@ +/* + * linux/include/asm-arm/arch-rpc/mmap.h + * + * Copyright (C) 1996 Russell King + */ + +#define HAVE_MAP_VID_MEM +#define SAFE_ADDR 0x00000000 /* ROM */ + +unsigned long map_screen_mem(unsigned long log_start, unsigned long kmem, int update) +{ + static int updated = 0; + unsigned long address; + pgd_t *pgd; + + if (updated) + return 0; + updated = update; + + address = SCREEN_START | PMD_TYPE_SECT | PMD_DOMAIN(DOMAIN_KERNEL) | PMD_SECT_AP_WRITE; + pgd = swapper_pg_dir + (SCREEN2_BASE >> PGDIR_SHIFT); + pgd_val(pgd[0]) = address; + pgd_val(pgd[1]) = address + (1 << PGDIR_SHIFT); + + if (update) { + unsigned long pgtable = PAGE_ALIGN(kmem), *p; + int i; + + memzero ((void *)pgtable, 4096); + + pgd_val(pgd[-2]) = virt_to_phys(pgtable) | PMD_TYPE_TABLE | PMD_DOMAIN(DOMAIN_KERNEL); + pgd_val(pgd[-1]) = virt_to_phys(pgtable + PTRS_PER_PTE*4) | PMD_TYPE_TABLE | PMD_DOMAIN(DOMAIN_KERNEL); + p = (unsigned long *)pgtable; + + i = PTRS_PER_PTE * 2 - ((SCREEN1_END - log_start) >> PAGE_SHIFT); + address = SCREEN_START | PTE_TYPE_SMALL | PTE_AP_WRITE; + + while (i < PTRS_PER_PTE * 2) { + p[i++] = address; + address += PAGE_SIZE; + } + + flush_page_to_ram(pgtable); + + kmem = pgtable + PAGE_SIZE; + } + return kmem; +} |