Changeset adec5b45 in mainline
- Timestamp:
- 2012-01-27T22:19:12Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1ccd0aa
- Parents:
- d4673296
- Location:
- kernel
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/arm32/src/mach/gta02/gta02.c
rd4673296 radec5b45 102 102 s3c24xx_irqc_regs_t *irqc_regs; 103 103 104 gta02_timer = (void *) hw_map(S3C24XX_TIMER_ADDRESS, PAGE_SIZE); 105 irqc_regs = (void *) hw_map(S3C24XX_IRQC_ADDRESS, PAGE_SIZE); 104 gta02_timer = (void *) km_map(S3C24XX_TIMER_ADDRESS, PAGE_SIZE, 105 PAGE_NOT_CACHEABLE); 106 irqc_regs = (void *) km_map(S3C24XX_IRQC_ADDRESS, PAGE_SIZE, 107 PAGE_NOT_CACHEABLE); 106 108 107 109 /* Initialize interrupt controller. */ -
kernel/arch/arm32/src/mach/integratorcp/integratorcp.c
rd4673296 radec5b45 129 129 void icp_init(void) 130 130 { 131 icp_hw_map.uart = hw_map(ICP_UART, PAGE_SIZE); 132 icp_hw_map.kbd_ctrl = hw_map(ICP_KBD, PAGE_SIZE); 131 icp_hw_map.uart = km_map(ICP_UART, PAGE_SIZE, 132 PAGE_WRITE | PAGE_NOT_CACHEABLE); 133 icp_hw_map.kbd_ctrl = km_map(ICP_KBD, PAGE_SIZE, PAGE_NOT_CACHEABLE); 133 134 icp_hw_map.kbd_stat = icp_hw_map.kbd_ctrl + ICP_KBD_STAT; 134 135 icp_hw_map.kbd_data = icp_hw_map.kbd_ctrl + ICP_KBD_DATA; 135 136 icp_hw_map.kbd_intstat = icp_hw_map.kbd_ctrl + ICP_KBD_INTR_STAT; 136 icp_hw_map.rtc = hw_map(ICP_RTC, PAGE_SIZE); 137 icp_hw_map.rtc = km_map(ICP_RTC, PAGE_SIZE, 138 PAGE_WRITE | PAGE_NOT_CACHEABLE); 137 139 icp_hw_map.rtc1_load = icp_hw_map.rtc + ICP_RTC1_LOAD_OFFSET; 138 140 icp_hw_map.rtc1_read = icp_hw_map.rtc + ICP_RTC1_READ_OFFSET; … … 142 144 icp_hw_map.rtc1_intrstat = icp_hw_map.rtc + ICP_RTC1_INTRSTAT_OFFSET; 143 145 144 icp_hw_map.irqc = hw_map(ICP_IRQC, PAGE_SIZE); 146 icp_hw_map.irqc = km_map(ICP_IRQC, PAGE_SIZE, 147 PAGE_WRITE | PAGE_NOT_CACHEABLE); 145 148 icp_hw_map.irqc_mask = icp_hw_map.irqc + ICP_IRQC_MASK_OFFSET; 146 149 icp_hw_map.irqc_unmask = icp_hw_map.irqc + ICP_IRQC_UNMASK_OFFSET; 147 icp_hw_map.cmcr = hw_map(ICP_CMCR, PAGE_SIZE); 150 icp_hw_map.cmcr = km_map(ICP_CMCR, PAGE_SIZE, 151 PAGE_WRITE | PAGE_NOT_CACHEABLE); 148 152 icp_hw_map.sdramcr = icp_hw_map.cmcr + ICP_SDRAMCR_OFFSET; 149 icp_hw_map.vga = hw_map(ICP_VGA, PAGE_SIZE); 153 icp_hw_map.vga = km_map(ICP_VGA, PAGE_SIZE, 154 PAGE_WRITE | PAGE_NOT_CACHEABLE); 150 155 151 156 hw_map_init_called = true; -
kernel/arch/arm32/src/mach/testarm/testarm.c
rd4673296 radec5b45 72 72 void gxemul_init(void) 73 73 { 74 gxemul_kbd = (void *) hw_map(GXEMUL_KBD_ADDRESS, PAGE_SIZE); 75 gxemul_rtc = (void *) hw_map(GXEMUL_RTC_ADDRESS, PAGE_SIZE); 76 gxemul_irqc = (void *) hw_map(GXEMUL_IRQC_ADDRESS, PAGE_SIZE); 74 gxemul_kbd = (void *) km_map(GXEMUL_KBD_ADDRESS, PAGE_SIZE, 75 PAGE_WRITE | PAGE_NOT_CACHEABLE); 76 gxemul_rtc = (void *) km_map(GXEMUL_RTC_ADDRESS, PAGE_SIZE, 77 PAGE_WRITE | PAGE_NOT_CACHEABLE); 78 gxemul_irqc = (void *) km_map(GXEMUL_IRQC_ADDRESS, PAGE_SIZE, 79 PAGE_WRITE | PAGE_NOT_CACHEABLE); 77 80 } 78 81 -
kernel/arch/ia32/src/smp/smp.c
rd4673296 radec5b45 73 73 74 74 if (config.cpu_count > 1) { 75 l_apic = (uint32_t *) hw_map((uintptr_t) l_apic, PAGE_SIZE); 76 io_apic = (uint32_t *) hw_map((uintptr_t) io_apic, PAGE_SIZE); 75 l_apic = (uint32_t *) km_map((uintptr_t) l_apic, PAGE_SIZE, 76 PAGE_WRITE | PAGE_NOT_CACHEABLE); 77 io_apic = (uint32_t *) km_map((uintptr_t) io_apic, PAGE_SIZE, 78 PAGE_WRITE | PAGE_NOT_CACHEABLE); 77 79 } 78 80 } -
kernel/arch/ia64/src/ia64.c
rd4673296 radec5b45 89 89 static void iosapic_init(void) 90 90 { 91 uintptr_t IOSAPIC = hw_map(iosapic_base, PAGE_SIZE); 91 uintptr_t IOSAPIC = km_map(iosapic_base, PAGE_SIZE, 92 PAGE_WRITE | PAGE_NOT_CACHEABLE); 92 93 int i; 93 94 … … 117 118 if (config.cpu_active == 1) { 118 119 /* Map the page with legacy I/O. */ 119 legacyio_virt_base = hw_map(LEGACYIO_PHYS_BASE, LEGACYIO_SIZE); 120 legacyio_virt_base = km_map(LEGACYIO_PHYS_BASE, LEGACYIO_SIZE, 121 PAGE_WRITE | PAGE_NOT_CACHEABLE); 120 122 121 123 iosapic_init(); -
kernel/arch/ppc32/src/drivers/pic.c
rd4673296 radec5b45 42 42 void pic_init(uintptr_t base, size_t size, cir_t *cir, void **cir_arg) 43 43 { 44 pic = (uint32_t *) hw_map(base, size);44 pic = (uint32_t *) km_map(base, size, PAGE_WRITE | PAGE_NOT_CACHEABLE); 45 45 *cir = pic_ack_interrupt; 46 46 *cir_arg = NULL; -
kernel/arch/ppc32/src/ppc32.c
rd4673296 radec5b45 209 209 size_t size = 2 * PAGE_SIZE; 210 210 211 cuda_t *cuda = (cuda_t *) 212 (hw_map(aligned_addr, offset + size) + offset);211 cuda_t *cuda = (cuda_t *) (km_map(aligned_addr, offset + size, 212 PAGE_WRITE | PAGE_NOT_CACHEABLE) + offset); 213 213 214 214 /* Initialize I/O controller */ -
kernel/arch/sparc64/src/drivers/kbd.c
rd4673296 radec5b45 114 114 size_t offset = pa - aligned_addr; 115 115 116 ns16550_t *ns16550 = (ns16550_t *) 117 (hw_map(aligned_addr, offset + size) + offset);116 ns16550_t *ns16550 = (ns16550_t *) (km_map(aligned_addr, offset + size, 117 PAGE_WRITE | PAGE_NOT_CACHEABLE) + offset); 118 118 119 119 ns16550_instance_t *ns16550_instance = ns16550_init(ns16550, inr, cir, cir_arg); -
kernel/arch/sparc64/src/drivers/pci.c
rd4673296 radec5b45 109 109 pci->model = PCI_SABRE; 110 110 pci->op = &pci_sabre_ops; 111 pci->reg = (uint64_t *) hw_map(paddr, reg[SABRE_INTERNAL_REG].size); 111 pci->reg = (uint64_t *) km_map(paddr, reg[SABRE_INTERNAL_REG].size, 112 PAGE_WRITE | PAGE_NOT_CACHEABLE); 112 113 113 114 /* … … 156 157 pci->model = PCI_PSYCHO; 157 158 pci->op = &pci_psycho_ops; 158 pci->reg = (uint64_t *) hw_map(paddr, reg[PSYCHO_INTERNAL_REG].size); 159 pci->reg = (uint64_t *) km_map(paddr, reg[PSYCHO_INTERNAL_REG].size, 160 PAGE_WRITE | PAGE_NOT_CACHEABLE); 159 161 160 162 /* -
kernel/genarch/src/drivers/ega/ega.c
rd4673296 radec5b45 597 597 598 598 instance->base = base; 599 instance->addr = (uint8_t *) hw_map(addr, EGA_VRAM_SIZE); 599 instance->addr = (uint8_t *) km_map(addr, EGA_VRAM_SIZE, 600 PAGE_WRITE | PAGE_NOT_CACHEABLE); 600 601 if (!instance->addr) { 601 602 LOG("Unable to EGA video memory."); -
kernel/genarch/src/drivers/s3c24xx_uart/s3c24xx_uart.c
rd4673296 radec5b45 114 114 uart_dev->data = uart; 115 115 116 uart->io = (s3c24xx_uart_io_t *) hw_map(paddr, PAGE_SIZE); 116 uart->io = (s3c24xx_uart_io_t *) km_map(paddr, PAGE_SIZE, 117 PAGE_WRITE | PAGE_NOT_CACHEABLE); 117 118 uart->indev = NULL; 118 119 -
kernel/genarch/src/fb/fb.c
rd4673296 radec5b45 587 587 size_t glyphsize = FONT_GLYPHS * instance->glyphbytes; 588 588 589 instance->addr = (uint8_t *) hw_map((uintptr_t) props->addr, fbsize); 589 instance->addr = (uint8_t *) km_map((uintptr_t) props->addr, fbsize, 590 PAGE_WRITE | PAGE_NOT_CACHEABLE); 590 591 if (!instance->addr) { 591 592 LOG("Unable to map framebuffer."); -
kernel/generic/include/mm/km.h
rd4673296 radec5b45 49 49 extern bool km_is_non_identity(uintptr_t); 50 50 51 extern uintptr_t hw_map(uintptr_t, size_t);51 extern uintptr_t km_map(uintptr_t, size_t, unsigned int); 52 52 53 53 extern uintptr_t km_temporary_page_get(uintptr_t *, frame_flags_t); -
kernel/generic/src/mm/km.c
rd4673296 radec5b45 124 124 } 125 125 126 uintptr_t hw_map(uintptr_t physaddr, size_t size)127 { 128 uintptr_t v irtaddr;126 uintptr_t km_map(uintptr_t paddr, size_t size, unsigned int flags) 127 { 128 uintptr_t vaddr; 129 129 size_t asize; 130 130 size_t align; 131 pfn_t i;131 uintptr_t offs; 132 132 133 133 asize = ALIGN_UP(size, PAGE_SIZE); 134 134 align = ispwr2(size) ? size : (1U << (fnzb(size) + 1)); 135 v irtaddr = km_page_alloc(asize, max(PAGE_SIZE, align));135 vaddr = km_page_alloc(asize, max(PAGE_SIZE, align)); 136 136 137 137 page_table_lock(AS_KERNEL, true); 138 for (i = 0; i < ADDR2PFN(asize); i++) { 139 uintptr_t addr = PFN2ADDR(i); 140 page_mapping_insert(AS_KERNEL, virtaddr + addr, physaddr + addr, 141 PAGE_NOT_CACHEABLE | PAGE_WRITE); 138 for (offs = 0; offs < asize; offs += PAGE_SIZE) { 139 page_mapping_insert(AS_KERNEL, vaddr + offs, paddr + offs, 140 flags); 142 141 } 143 142 page_table_unlock(AS_KERNEL, true); 144 143 145 return v irtaddr;144 return vaddr; 146 145 } 147 146
Note:
See TracChangeset
for help on using the changeset viewer.