Changeset 9979acb in mainline
- Timestamp:
- 2009-02-20T17:19:03Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c9b550b
- Parents:
- 5c06c1c
- Location:
- kernel
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/include/mm/tlb.h
r5c06c1c r9979acb 36 36 #define KERN_amd64_TLB_H_ 37 37 38 #define tlb_arch_init()39 #define tlb_print()40 41 38 #endif 42 39 -
kernel/arch/amd64/src/mm/page.c
r5c06c1c r9979acb 35 35 #include <arch/mm/page.h> 36 36 #include <genarch/mm/page_pt.h> 37 #include <genarch/drivers/ega/ega.h> 38 #include <genarch/drivers/legacy/ia32/io.h> 37 39 #include <arch/mm/frame.h> 38 40 #include <mm/page.h> … … 47 49 #include <panic.h> 48 50 #include <align.h> 51 #include <ddi/ddi.h> 52 53 /** Physical memory area for devices. */ 54 static parea_t dev_area; 55 static parea_t ega_area; 49 56 50 57 /* Definitions for identity page mapper */ … … 215 222 } 216 223 217 void hw_area(uintptr_t *physaddr, pfn_t *frames) 218 { 219 *physaddr = end_frame; 220 *frames = ADDR2PFN(0xfffffffffffff - end_frame); 224 void hw_area(void) 225 { 226 dev_area.pbase = end_frame; 227 dev_area.frames = SIZE2FRAMES(0xfffffffffffff - end_frame); 228 ddi_parea_register(&dev_area); 229 230 ega_area.pbase = EGA_VIDEORAM; 231 ega_area.frames = SIZE2FRAMES(EGA_VRAM_SIZE); 232 ddi_parea_register(&ega_area); 221 233 } 222 234 -
kernel/arch/arm32/include/mm/tlb.h
r5c06c1c r9979acb 37 37 #define KERN_arm32_TLB_H_ 38 38 39 #define tlb_arch_init()40 #define tlb_print()41 42 39 #endif 43 40 -
kernel/arch/arm32/src/mm/page.c
r5c06c1c r9979acb 44 44 #include <interrupt.h> 45 45 #include <arch/mm/frame.h> 46 #include <ddi/ddi.h> 47 48 /** Physical memory area for devices. */ 49 static parea_t dev_area; 46 50 47 51 /** Initializes page tables. … … 107 111 } 108 112 109 void hw_area( uintptr_t *physaddr, pfn_t *frames)113 void hw_area(void) 110 114 { 111 *physaddr = end_frame; 112 *frames = ADDR2PFN(0xffffffff - end_frame); 115 dev_area.pbase = end_frame; 116 dev_area.frames = SIZE2FRAMES(0xffffffff - end_frame); 117 ddi_parea_register(&dev_area); 113 118 } 114 119 -
kernel/arch/arm32/src/mm/tlb.c
r5c06c1c r9979acb 90 90 } 91 91 92 void tlb_arch_init(void) 93 { 94 } 95 96 void tlb_print(void) 97 { 98 } 99 92 100 /** @} 93 101 */ -
kernel/arch/ia32/include/mm/tlb.h
r5c06c1c r9979acb 27 27 */ 28 28 29 /** @addtogroup ia32mm 29 /** @addtogroup ia32mm 30 30 * @{ 31 31 */ … … 36 36 #define KERN_ia32_TLB_H_ 37 37 38 #define tlb_arch_init()39 #define tlb_print()40 41 38 #endif 42 39 -
kernel/arch/ia32/src/mm/page.c
r5c06c1c r9979acb 35 35 #include <arch/mm/page.h> 36 36 #include <genarch/mm/page_pt.h> 37 #include <genarch/drivers/ega/ega.h> 38 #include <genarch/drivers/legacy/ia32/io.h> 37 39 #include <arch/mm/frame.h> 38 40 #include <mm/frame.h> … … 49 51 #include <print.h> 50 52 #include <interrupt.h> 53 #include <ddi/ddi.h> 54 55 /** Physical memory area for devices. */ 56 static parea_t dev_area; 57 static parea_t ega_area; 51 58 52 59 void page_arch_init(void) … … 94 101 } 95 102 96 void hw_area( uintptr_t *physaddr, pfn_t *frames)103 void hw_area(void) 97 104 { 98 *physaddr = end_frame; 99 *frames = ADDR2PFN(0xffffffff - end_frame); 105 dev_area.pbase = end_frame; 106 dev_area.frames = SIZE2FRAMES(0xffffffff - end_frame); 107 ddi_parea_register(&dev_area); 108 109 ega_area.pbase = EGA_VIDEORAM; 110 ega_area.frames = SIZE2FRAMES(EGA_VRAM_SIZE); 111 ddi_parea_register(&ega_area); 100 112 } 101 113 -
kernel/arch/ia32/src/mm/tlb.c
r5c06c1c r9979acb 68 68 } 69 69 70 void tlb_arch_init(void) 71 { 72 } 73 74 void tlb_print(void) 75 { 76 } 77 70 78 /** @} 71 79 */ -
kernel/arch/ia64/include/mm/tlb.h
r5c06c1c r9979acb 35 35 #ifndef KERN_ia64_TLB_H_ 36 36 #define KERN_ia64_TLB_H_ 37 38 #define tlb_arch_init()39 #define tlb_print()40 37 41 38 #include <arch/mm/page.h> -
kernel/arch/ia64/src/mm/page.c
r5c06c1c r9979acb 28 28 */ 29 29 30 /** @addtogroup ia64mm 30 /** @addtogroup ia64mm 31 31 * @{ 32 32 */ … … 49 49 #include <memstr.h> 50 50 #include <align.h> 51 #include <ddi/ddi.h> 52 53 /** Physical memory area for devices. */ 54 static parea_t dev_area; 51 55 52 56 static void set_environment(void); … … 275 279 } 276 280 277 void hw_area(uintptr_t *physaddr, pfn_t *frames) 278 { 279 *physaddr = end_frame; 280 *frames = ADDR2PFN(0x7fffffffffffffffUL - end_frame); 281 void hw_area(void) 282 { 283 dev_area.pbase = end_frame; 284 dev_area.frames = SIZE2FRAMES(0x7fffffffffffffffUL - end_frame); 285 ddi_parea_register(&dev_area); 281 286 } 282 287 -
kernel/arch/ia64/src/mm/tlb.c
r5c06c1c r9979acb 750 750 } 751 751 752 void tlb_arch_init(void) 753 { 754 } 755 756 void tlb_print(void) 757 { 758 } 759 752 760 /** @} 753 761 */ -
kernel/arch/mips32/src/mm/page.c
r5c06c1c r9979acb 37 37 #include <mm/page.h> 38 38 #include <mm/frame.h> 39 #include <ddi/ddi.h> 40 41 /** Physical memory area for devices. */ 42 static parea_t dev_area; 39 43 40 44 void page_arch_init(void) … … 52 56 } 53 57 54 void hw_area( uintptr_t *physaddr, pfn_t *frames)58 void hw_area(void) 55 59 { 56 *physaddr = end_frame; 57 *frames = ADDR2PFN(0xffffffff - end_frame); 60 dev_area.pbase = end_frame; 61 dev_area.frames = SIZE2FRAMES(0xffffffff - end_frame); 62 ddi_parea_register(&dev_area); 58 63 } 59 64 -
kernel/arch/ppc32/src/mm/page.c
r5c06c1c r9979acb 38 38 #include <align.h> 39 39 #include <config.h> 40 #include <ddi/ddi.h> 41 42 /** Physical memory area for devices. */ 43 static parea_t dev_area; 40 44 41 45 void page_arch_init(void) … … 64 68 } 65 69 66 void hw_area( uintptr_t *physaddr, pfn_t *frames)70 void hw_area(void) 67 71 { 68 *physaddr = end_frame; 69 *frames = ADDR2PFN(0xffffffff - end_frame); 72 dev_area.pbase = end_frame; 73 dev_area.frames = SIZE2FRAMES(0xffffffff - end_frame); 74 ddi_parea_register(&dev_area); 70 75 } 71 76 -
kernel/arch/sparc64/src/mm/page.c
r5c06c1c r9979acb 27 27 */ 28 28 29 /** @addtogroup sparc64mm 29 /** @addtogroup sparc64mm 30 30 * @{ 31 31 */ … … 42 42 #include <align.h> 43 43 #include <config.h> 44 #include <ddi/ddi.h> 45 46 /** Physical memory area for devices. */ 47 static parea_t dev_area; 44 48 45 49 #ifdef CONFIG_SMP … … 165 169 } 166 170 167 void hw_area( uintptr_t *physaddr, pfn_t *frames)171 void hw_area(void) 168 172 { 169 *physaddr = end_frame; 170 *frames = ADDR2PFN(0x7ffffffffff - end_frame); 173 dev_area.pbase = end_frame; 174 dev_area.frames = SIZE2FRAMES(0x7ffffffffff - end_frame); 175 ddi_parea_register(&dev_area); 171 176 } 172 177 -
kernel/genarch/include/drivers/ega/ega.h
r5c06c1c r9979acb 27 27 */ 28 28 29 /** @addtogroup genarch_drivers 29 /** @addtogroup genarch_drivers 30 30 * @{ 31 31 */ … … 38 38 #include <arch/types.h> 39 39 40 #define ROW 80 41 #define ROWS 25 42 #define SCREEN (ROW * ROWS) 40 #define EGA_COLS 80 41 #define EGA_ROWS 25 42 #define EGA_SCREEN (EGA_COLS * EGA_ROWS) 43 #define EGA_VRAM_SIZE (2 * EGA_SCREEN) 43 44 44 45 /* EGA device registers. */ 45 #define EGA_INDEX_REG 46 #define EGA_DATA_REG 46 #define EGA_INDEX_REG 0 47 #define EGA_DATA_REG 1 47 48 48 49 extern void ega_redraw(void); -
kernel/genarch/include/drivers/legacy/ia32/io.h
r5c06c1c r9979acb 31 31 */ 32 32 /** @file 33 * @brief 34 * ia32 legacy I/O space (i.e. ia32, amd64 and ia64).33 * @brief This file contains definitions used by architectures with the 34 * ia32 legacy I/O space (i.e. ia32, amd64 and ia64). 35 35 */ 36 36 … … 40 40 #include <arch/types.h> 41 41 42 #define I8042_BASE ((ioport8_t *)0x60) 42 #define I8042_BASE ((ioport8_t *) 0x60) 43 #define EGA_BASE ((ioport8_t *) 0x3d4) 44 #define NS16550_BASE ((ioport8_t *) 0x3f8) 43 45 44 #define EGA_VIDEORAM 0xb8000 45 #define EGA_BASE ((ioport8_t *)0x3d4) 46 47 #define NS16550_BASE ((ioport8_t *)0x3f8) 46 #define EGA_VIDEORAM 0xb8000 48 47 49 48 #endif -
kernel/genarch/src/drivers/ega/ega.c
r5c06c1c r9979acb 27 27 */ 28 28 29 /** @addtogroup genarch_drivers 29 /** @addtogroup genarch_drivers 30 30 * @{ 31 31 */ … … 68 68 static void ega_check_cursor(void) 69 69 { 70 if (ega_cursor < SCREEN)70 if (ega_cursor < EGA_SCREEN) 71 71 return; 72 72 73 memmove((void *) videoram, (void *) (videoram + ROW* 2),74 ( SCREEN - ROW) * 2);75 memmove((void *) backbuf, (void *) (backbuf + ROW* 2),76 ( SCREEN - ROW) * 2);77 memsetw(videoram + ( SCREEN - ROW) * 2, ROW, 0x0720);78 memsetw(backbuf + ( SCREEN - ROW) * 2, ROW, 0x0720);79 ega_cursor = ega_cursor - ROW;73 memmove((void *) videoram, (void *) (videoram + EGA_COLS * 2), 74 (EGA_SCREEN - EGA_COLS) * 2); 75 memmove((void *) backbuf, (void *) (backbuf + EGA_COLS * 2), 76 (EGA_SCREEN - EGA_COLS) * 2); 77 memsetw(videoram + (EGA_SCREEN - EGA_COLS) * 2, EGA_COLS, 0x0720); 78 memsetw(backbuf + (EGA_SCREEN - EGA_COLS) * 2, EGA_COLS, 0x0720); 79 ega_cursor = ega_cursor - EGA_COLS; 80 80 } 81 81 … … 85 85 pio_write_8(ega_base + EGA_DATA_REG, (uint8_t) ((ega_cursor >> 8) & 0xff)); 86 86 pio_write_8(ega_base + EGA_INDEX_REG, 0xf); 87 pio_write_8(ega_base + EGA_DATA_REG, (uint8_t) (ega_cursor & 0xff)); 87 pio_write_8(ega_base + EGA_DATA_REG, (uint8_t) (ega_cursor & 0xff)); 88 88 } 89 89 … … 105 105 switch (ch) { 106 106 case '\n': 107 ega_cursor = (ega_cursor + ROW) - ega_cursor % ROW;107 ega_cursor = (ega_cursor + EGA_COLS) - ega_cursor % EGA_COLS; 108 108 break; 109 109 case '\t': … … 111 111 break; 112 112 case '\b': 113 if (ega_cursor % ROW)113 if (ega_cursor % EGA_COLS) 114 114 ega_cursor--; 115 115 break; … … 134 134 void ega_init(ioport8_t *base, uintptr_t videoram_phys) 135 135 { 136 /* Initialize the software structure. */ 136 /* Initialize the software structure. */ 137 137 ega_base = base; 138 138 139 backbuf = (uint8_t *) malloc( SCREEN * 2, 0);139 backbuf = (uint8_t *) malloc(EGA_VRAM_SIZE, 0); 140 140 if (!backbuf) 141 141 panic("Unable to allocate backbuffer."); 142 142 143 videoram = (uint8_t *) hw_map(videoram_phys, SCREEN * 2);143 videoram = (uint8_t *) hw_map(videoram_phys, EGA_VRAM_SIZE); 144 144 145 145 /* Clear the screen and set the cursor position. */ 146 memsetw(videoram, SCREEN, 0x0720);147 memsetw(backbuf, SCREEN, 0x0720);146 memsetw(videoram, EGA_SCREEN, 0x0720); 147 memsetw(backbuf, EGA_SCREEN, 0x0720); 148 148 ega_move_cursor(); 149 149 … … 153 153 sysinfo_set_item_val("fb", NULL, true); 154 154 sysinfo_set_item_val("fb.kind", NULL, 2); 155 sysinfo_set_item_val("fb.width", NULL, ROW);156 sysinfo_set_item_val("fb.height", NULL, ROWS);155 sysinfo_set_item_val("fb.width", NULL, EGA_COLS); 156 sysinfo_set_item_val("fb.height", NULL, EGA_ROWS); 157 157 sysinfo_set_item_val("fb.blinking", NULL, true); 158 158 sysinfo_set_item_val("fb.address.physical", NULL, videoram_phys); … … 161 161 void ega_redraw(void) 162 162 { 163 memcpy(videoram, backbuf, SCREEN * 2);163 memcpy(videoram, backbuf, EGA_VRAM_SIZE); 164 164 ega_move_cursor(); 165 165 } -
kernel/generic/include/mm/page.h
r5c06c1c r9979acb 62 62 63 63 extern uintptr_t hw_map(uintptr_t physaddr, size_t size); 64 extern void hw_area( uintptr_t *physaddr, pfn_t *frames);64 extern void hw_area(void); 65 65 66 66 #endif -
kernel/generic/src/ddi/ddi.c
r5c06c1c r9979acb 59 59 static LIST_INITIALIZE(parea_head); 60 60 61 /** Physical memory area for devices. */62 static parea_t dev_area;63 64 61 /** Initialize DDI. */ 65 62 void ddi_init(void) 66 63 { 67 hw_area(&dev_area.pbase, &dev_area.frames); 68 ddi_parea_register(&dev_area); 64 hw_area(); 69 65 } 70 66
Note:
See TracChangeset
for help on using the changeset viewer.