Changeset 46321fb in mainline
- Timestamp:
- 2008-11-25T20:22:04Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 83d9712
- Parents:
- 14c331a
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia64/include/mm/page.h
r14c331a r46321fb 49 49 #define FW_PAGE_WIDTH 28 /* 256M */ 50 50 51 /** Staticly mapped IO spaces */ 51 #define USPACE_IO_PAGE_WIDTH 12 /* 4K */ 52 53 54 55 /** Staticly mapped IO spaces - offsets to 0xe...00 of virtual adresses 56 becauce of "minimal virtual bits implemented is 51" 57 it is possible to have here values up to 0x0007000000000000 58 */ 52 59 53 60 /* Firmware area (bellow 4GB in phys mem) */ -
kernel/arch/ia64/include/mm/tlb.h
r14c331a r46321fb 47 47 #define DTR_KERNEL 0 48 48 #define ITR_KERNEL 0 49 #define DTR_KSTACK1 150 #define DTR_KSTACK2 249 #define DTR_KSTACK1 4 50 #define DTR_KSTACK2 5 51 51 52 52 /** Portion of TLB insertion format data structure. */ -
kernel/arch/ia64/include/proc/task.h
r14c331a r46321fb 32 32 /** @file 33 33 */ 34 #include <proc/task.h> 34 35 35 36 #ifndef KERN_ia64_TASK_H_ 36 37 #define KERN_ia64_TASK_H_ 37 38 39 #include <adt/bitmap.h> 40 38 41 typedef struct { 42 bitmap_t *iomap; 39 43 } task_arch_t; 40 44 41 #define task_create_arch(t) 45 46 #define task_create_arch(t) {(t)->arch.iomap=NULL;} 42 47 #define task_destroy_arch(t) 43 48 -
kernel/arch/ia64/src/ddi/ddi.c
r14c331a r46321fb 1 1 /* 2 * Copyright (c) 2006 Jakub Jermar 2 * Copyright (c) 2006 Jakub Jermar, Jakub vana 3 3 * All rights reserved. 4 4 * … … 36 36 #include <proc/task.h> 37 37 #include <arch/types.h> 38 #include <mm/slab.h> 39 #include <errno.h> 40 41 #define IO_MEMMAP_PAGES 16384 42 #define PORTS_PER_PAGE 4 38 43 39 44 /** Enable I/O space range for task. … … 49 54 int ddi_iospace_enable_arch(task_t *task, uintptr_t ioaddr, size_t size) 50 55 { 56 57 if(!task->arch.iomap) 58 { 59 uint8_t *map; 60 task->arch.iomap=malloc(sizeof(bitmap_t),0); 61 map=malloc(BITS2BYTES(IO_MEMMAP_PAGES),0); 62 if(!map) 63 return ENOMEM; 64 bitmap_initialize(task->arch.iomap,map,IO_MEMMAP_PAGES); 65 bitmap_clear_range(task->arch.iomap,0,IO_MEMMAP_PAGES); 66 } 67 68 uintptr_t iopage = ioaddr / PORTS_PER_PAGE; 69 size = ALIGN_UP (size+ioaddr-4*iopage,PORTS_PER_PAGE); 70 bitmap_set_range(task->arch.iomap,iopage,size/4); 71 72 51 73 return 0; 52 74 } -
kernel/arch/ia64/src/drivers/ega.c
r14c331a r46321fb 47 47 #include <sysinfo/sysinfo.h> 48 48 #include <arch/drivers/ega.h> 49 #include <ddi/ddi.h> 50 49 51 50 52 /* … … 52 54 * Simple and short. Function for displaying characters and "scrolling". 53 55 */ 56 57 58 static parea_t ega_parea; /**< Physical memory area for EGA video RAM. */ 59 54 60 55 61 SPINLOCK_INITIALIZE(egalock); … … 76 82 chardev_initialize("ega_out", &ega_console, &ega_ops); 77 83 stdout = &ega_console; 84 85 86 ega_parea.pbase = VIDEORAM & 0xffffffff; 87 ega_parea.vbase = (uintptr_t) videoram; 88 ega_parea.frames = 1; 89 ega_parea.cacheable = false; 90 ddi_parea_register(&ega_parea); 91 78 92 79 93 sysinfo_set_item_val("fb", NULL, true); … … 81 95 sysinfo_set_item_val("fb.width", NULL, ROW); 82 96 sysinfo_set_item_val("fb.height", NULL, ROWS); 83 sysinfo_set_item_val("fb.address.physical", NULL, VIDEORAM );97 sysinfo_set_item_val("fb.address.physical", NULL, VIDEORAM & 0xffffffff); 84 98 85 99 #ifndef CONFIG_FB -
kernel/arch/ia64/src/ia64.c
r14c331a r46321fb 61 61 #include <panic.h> 62 62 #include <print.h> 63 #include <sysinfo/sysinfo.h> 63 64 64 65 /*NS16550 as a COM 1*/ … … 183 184 184 185 } 186 187 sysinfo_set_item_val("ia64_iospace", NULL, true); 188 sysinfo_set_item_val("ia64_iospace.address", NULL, true); 189 sysinfo_set_item_val("ia64_iospace.address.virtual", NULL, IO_OFFSET); 190 185 191 } 186 192 -
kernel/arch/ia64/src/mm/tlb.c
r14c331a r46321fb 476 476 } 477 477 478 479 480 static int is_io_page_accessible(int page) 481 { 482 if(TASK->arch.iomap) return bitmap_get(TASK->arch.iomap,page); 483 else return 0; 484 } 485 486 #define IO_FRAME_BASE 0xFFFFC000000 487 488 /** There is special handling of memmaped lagacy io, because 489 * of 4KB sized access 490 * only for userspace 491 * 492 * @param va virtual address of page fault 493 * @param istate Structure with saved interruption state. 494 * 495 * 496 * @return 1 on success, 0 on fail 497 */ 498 static int try_memmap_io_insertion(uintptr_t va, istate_t *istate) 499 { 500 if((va >= IO_OFFSET ) && (va < IO_OFFSET + (1<<IO_PAGE_WIDTH))) 501 if(TASK){ 502 503 uint64_t io_page=(va & ((1<<IO_PAGE_WIDTH)-1)) >> (USPACE_IO_PAGE_WIDTH); 504 if(is_io_page_accessible(io_page)){ 505 //printf("Insert %llX\n",va); 506 507 uint64_t page,frame; 508 509 page = IO_OFFSET + (1 << USPACE_IO_PAGE_WIDTH) * io_page; 510 frame = IO_FRAME_BASE + (1 << USPACE_IO_PAGE_WIDTH) * io_page; 511 512 513 tlb_entry_t entry; 514 515 entry.word[0] = 0; 516 entry.word[1] = 0; 517 518 entry.p = true; /* present */ 519 entry.ma = MA_UNCACHEABLE; 520 entry.a = true; /* already accessed */ 521 entry.d = true; /* already dirty */ 522 entry.pl = PL_USER; 523 entry.ar = AR_READ | AR_WRITE; 524 entry.ppn = frame >> PPN_SHIFT; //MUSIM spocitat frame 525 entry.ps = USPACE_IO_PAGE_WIDTH; 526 527 dtc_mapping_insert(page, TASK->as->asid, entry); //Musim zjistit ASID 528 return 1; 529 }else { 530 fault_if_from_uspace(istate,"IO access fault at %p",va); 531 return 0; 532 } 533 } else 534 return 0; 535 else 536 return 0; 537 538 return 0; 539 540 } 541 542 543 544 478 545 /** Data TLB fault handler for faults with VHPT turned off. 479 546 * … … 512 579 page_table_unlock(AS, true); 513 580 } else { 581 page_table_unlock(AS, true); 582 if (try_memmap_io_insertion(va,istate)) return; 514 583 /* 515 584 * Forward the page fault to the address space page fault handler. 516 585 */ 517 page_table_unlock(AS, true);518 586 if (as_page_fault(va, PF_ACCESS_READ, istate) == AS_PF_FAULT) { 519 587 fault_if_from_uspace(istate,"Page fault at %p",va); -
kernel/generic/include/adt/bitmap.h
r14c331a r46321fb 50 50 extern void bitmap_copy(bitmap_t *dst, bitmap_t *src, count_t bits); 51 51 52 static inline int bitmap_get(bitmap_t *bitmap,index_t bit) 53 { 54 if(bit >= bitmap->bits) 55 return 0; 56 return !! ((bitmap->map)[bit/8] & (1 << (bit & 7))); 57 } 58 59 52 60 #endif 53 61 -
uspace/lib/libc/arch/ia64/Makefile.inc
r14c331a r46321fb 42 42 ARCH_SOURCES += arch/$(ARCH)/src/syscall.S \ 43 43 arch/$(ARCH)/src/fibril.S \ 44 arch/$(ARCH)/src/tls.c 44 arch/$(ARCH)/src/tls.c\ 45 arch/$(ARCH)/src/ddi.c 45 46 46 47 BFD_NAME = elf64-ia64-little -
uspace/srv/fb/Makefile
r14c331a r46321fb 48 48 ppm.c 49 49 50 ifneq ($(ARCH), ia64) 51 SOURCES += fb.c \ 52 font-8x16.c 53 CFLAGS += -DFB_ENABLED 50 #ifneq ($(ARCH), ia64) 51 # SOURCES += fb.c \ 52 # font-8x16.c 53 # CFLAGS += -DFB_ENABLED 54 #endif 55 ifeq ($(ARCH), ia32) 56 SOURCES += ega.c 57 CFLAGS += -DEGA_ENABLED 54 58 endif 55 ifeq ($(ARCH), ia 32)59 ifeq ($(ARCH), ia64) 56 60 SOURCES += ega.c 57 61 CFLAGS += -DEGA_ENABLED
Note:
See TracChangeset
for help on using the changeset viewer.