Changeset 0f81ceb7 in mainline
- Timestamp:
- 2009-02-12T20:03:07Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 95b9963
- Parents:
- 8a72a9a
- Location:
- kernel/generic
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/arch.h
r8a72a9a r0f81ceb7 80 80 extern void reboot(void); 81 81 extern void arch_reboot(void); 82 extern void *arch_construct_function(fncptr_t *fptr, void *addr, void *caller); 82 83 83 84 #endif -
kernel/generic/include/ddi/irq.h
r8a72a9a r0f81ceb7 47 47 CMD_PORT_READ_1, 48 48 CMD_PORT_WRITE_1, 49 CMD_IA64_GETCHAR,50 CMD_PPC32_GETCHAR,51 49 CMD_LAST 52 50 } irq_cmd_type; -
kernel/generic/include/fpu_context.h
r8a72a9a r0f81ceb7 38 38 #include <arch/fpu_context.h> 39 39 40 #if defined(CONFIG_FPU_LAZY) && !defined(ARCH_HAS_FPU)41 # error "CONFIG_FPU_LAZY defined, but no ARCH_HAS_FPU"42 #endif43 44 40 extern void fpu_context_save(fpu_context_t *); 45 41 extern void fpu_context_restore(fpu_context_t *); -
kernel/generic/src/console/cmd.c
r8a72a9a r0f81ceb7 617 617 uintptr_t symaddr; 618 618 char *symbol; 619 unative_t (*f)(void); 620 #ifdef ia64 621 struct { 622 unative_t f; 623 unative_t gp; 624 } fptr; 625 #endif 626 619 unative_t (*fnc)(void); 620 fncptr_t fptr; 621 627 622 symaddr = get_symbol_addr((char *) argv->buffer); 628 623 if (!symaddr) … … 633 628 } else { 634 629 symbol = get_symtab_entry(symaddr); 630 fnc = (unative_t (*)(void)) arch_construct_function(&fptr, (void *) symaddr, (void *) cmd_call0); 635 631 printf("Calling %s() (%p)\n", symbol, symaddr); 636 #ifdef ia64 637 fptr.f = symaddr; 638 fptr.gp = ((unative_t *)cmd_call2)[1]; 639 f = (unative_t (*)(void)) &fptr; 640 #else 641 f = (unative_t (*)(void)) symaddr; 642 #endif 643 printf("Result: %#" PRIxn "\n", f()); 632 printf("Result: %#" PRIxn "\n", fnc()); 644 633 } 645 634 … … 681 670 uintptr_t symaddr; 682 671 char *symbol; 683 unative_t (*f )(unative_t,...);672 unative_t (*fnc)(unative_t, ...); 684 673 unative_t arg1 = argv[1].intval; 685 #ifdef ia64 686 struct { 687 unative_t f; 688 unative_t gp; 689 } fptr; 690 #endif 691 674 fncptr_t fptr; 675 692 676 symaddr = get_symbol_addr((char *) argv->buffer); 693 677 if (!symaddr) … … 698 682 } else { 699 683 symbol = get_symtab_entry(symaddr); 700 684 fnc = (unative_t (*)(unative_t, ...)) arch_construct_function(&fptr, (void *) symaddr, (void *) cmd_call1); 701 685 printf("Calling f(%#" PRIxn "): %p: %s\n", arg1, symaddr, symbol); 702 #ifdef ia64 703 fptr.f = symaddr; 704 fptr.gp = ((unative_t *)cmd_call2)[1]; 705 f = (unative_t (*)(unative_t,...)) &fptr; 706 #else 707 f = (unative_t (*)(unative_t,...)) symaddr; 708 #endif 709 printf("Result: %#" PRIxn "\n", f(arg1)); 686 printf("Result: %#" PRIxn "\n", fnc(arg1)); 710 687 } 711 688 … … 718 695 uintptr_t symaddr; 719 696 char *symbol; 720 unative_t (*f )(unative_t,unative_t,...);697 unative_t (*fnc)(unative_t, unative_t, ...); 721 698 unative_t arg1 = argv[1].intval; 722 699 unative_t arg2 = argv[2].intval; 723 #ifdef ia64 724 struct { 725 unative_t f; 726 unative_t gp; 727 }fptr; 728 #endif 729 700 fncptr_t fptr; 701 730 702 symaddr = get_symbol_addr((char *) argv->buffer); 731 703 if (!symaddr) … … 736 708 } else { 737 709 symbol = get_symtab_entry(symaddr); 710 fnc = (unative_t (*)(unative_t, unative_t, ...)) arch_construct_function(&fptr, (void *) symaddr, (void *) cmd_call2); 738 711 printf("Calling f(%#" PRIxn ", %#" PRIxn "): %p: %s\n", 739 712 arg1, arg2, symaddr, symbol); 740 #ifdef ia64 741 fptr.f = symaddr; 742 fptr.gp = ((unative_t *)cmd_call2)[1]; 743 f = (unative_t (*)(unative_t,unative_t,...)) &fptr; 744 #else 745 f = (unative_t (*)(unative_t,unative_t,...)) symaddr; 746 #endif 747 printf("Result: %#" PRIxn "\n", f(arg1, arg2)); 713 printf("Result: %#" PRIxn "\n", fnc(arg1, arg2)); 748 714 } 749 715 … … 756 722 uintptr_t symaddr; 757 723 char *symbol; 758 unative_t (*f )(unative_t,unative_t,unative_t,...);724 unative_t (*fnc)(unative_t, unative_t, unative_t, ...); 759 725 unative_t arg1 = argv[1].intval; 760 726 unative_t arg2 = argv[2].intval; 761 727 unative_t arg3 = argv[3].intval; 762 #ifdef ia64 763 struct { 764 unative_t f; 765 unative_t gp; 766 }fptr; 767 #endif 768 728 fncptr_t fptr; 729 769 730 symaddr = get_symbol_addr((char *) argv->buffer); 770 731 if (!symaddr) … … 775 736 } else { 776 737 symbol = get_symtab_entry(symaddr); 738 fnc = (unative_t (*)(unative_t, unative_t, unative_t, ...)) arch_construct_function(&fptr, (void *) symaddr, (void *) cmd_call3); 777 739 printf("Calling f(%#" PRIxn ",%#" PRIxn ", %#" PRIxn "): %p: %s\n", 778 740 arg1, arg2, arg3, symaddr, symbol); 779 #ifdef ia64 780 fptr.f = symaddr; 781 fptr.gp = ((unative_t *)cmd_call2)[1]; 782 f = (unative_t (*)(unative_t,unative_t,unative_t,...)) &fptr; 783 #else 784 f = (unative_t (*)(unative_t,unative_t,unative_t,...)) symaddr; 785 #endif 786 printf("Result: %#" PRIxn "\n", f(arg1, arg2, arg3)); 741 printf("Result: %#" PRIxn "\n", fnc(arg1, arg2, arg3)); 787 742 } 788 743 … … 997 952 998 953 for (test = tests; test->name != NULL; test++) 999 printf("% s\t\t%s%s\n", test->name, test->desc, (test->safe ? "" : " (unsafe)"));1000 1001 printf(" *\t\tRun all safe tests\n");954 printf("%-10s %s%s\n", test->name, test->desc, (test->safe ? "" : " (unsafe)")); 955 956 printf("%-10s Run all safe tests\n", "*"); 1002 957 return 1; 1003 958 } -
kernel/generic/src/ipc/irq.c
r8a72a9a r0f81ceb7 101 101 code->cmds[i].value; 102 102 break; 103 #if defined(ia32) || defined(amd64) || defined(ia64)104 103 case CMD_PORT_READ_1: 105 104 dstval = inb((long) code->cmds[i].addr); … … 108 107 outb((long) code->cmds[i].addr, code->cmds[i].value); 109 108 break; 110 #endif111 #if defined(ia64) && defined(SKI)112 case CMD_IA64_GETCHAR:113 dstval = _getc(&ski_uconsole);114 break;115 #endif116 #if defined(ppc32)117 case CMD_PPC32_GETCHAR:118 dstval = cuda_get_scancode();119 break;120 #endif121 109 default: 122 110 break; -
kernel/generic/src/main/version.c
r8a72a9a r0f81ceb7 35 35 #include <main/version.h> 36 36 #include <print.h> 37 #include <macros.h> 37 38 38 39 char *project = "SPARTAN kernel"; 39 char *copyright = "Copyright (c) 2001-200 8HelenOS project";40 char *release = RELEASE;41 char *name = NAME;42 char *arch = ARCH;40 char *copyright = "Copyright (c) 2001-2009 HelenOS project"; 41 char *release = STRING(RELEASE); 42 char *name = STRING(NAME); 43 char *arch = STRING(KARCH); 43 44 44 45 #ifdef REVISION 45 char *revision = ", revision " REVISION;46 char *revision = ", revision " STRING(REVISION); 46 47 #else 47 48 char *revision = ""; … … 49 50 50 51 #ifdef TIMESTAMP 51 char *timestamp = " on " TIMESTAMP;52 char *timestamp = " on " STRING(TIMESTAMP); 52 53 #else 53 54 char *timestamp = ""; -
kernel/generic/src/proc/thread.c
r8a72a9a r0f81ceb7 103 103 104 104 static slab_cache_t *thread_slab; 105 #ifdef ARCH_HAS_FPU105 #ifdef CONFIG_FPU 106 106 slab_cache_t *fpu_context_slab; 107 107 #endif … … 162 162 thr_constructor_arch(t); 163 163 164 #ifdef ARCH_HAS_FPU164 #ifdef CONFIG_FPU 165 165 #ifdef CONFIG_FPU_LAZY 166 166 t->saved_fpu_context = NULL; … … 170 170 return -1; 171 171 #endif 172 #endif 172 #endif 173 173 174 174 t->kstack = (uint8_t *) frame_alloc(STACK_FRAMES, FRAME_KA | kmflags); 175 175 if (!t->kstack) { 176 #ifdef ARCH_HAS_FPU176 #ifdef CONFIG_FPU 177 177 if (t->saved_fpu_context) 178 178 slab_free(fpu_context_slab, t->saved_fpu_context); … … 197 197 198 198 frame_free(KA2PA(t->kstack)); 199 #ifdef ARCH_HAS_FPU199 #ifdef CONFIG_FPU 200 200 if (t->saved_fpu_context) 201 201 slab_free(fpu_context_slab, t->saved_fpu_context); … … 216 216 thr_constructor, thr_destructor, 0); 217 217 218 #ifdef ARCH_HAS_FPU218 #ifdef CONFIG_FPU 219 219 fpu_context_slab = slab_cache_create("fpu_slab", sizeof(fpu_context_t), 220 220 FPU_CONTEXT_ALIGN, NULL, NULL, 0);
Note:
See TracChangeset
for help on using the changeset viewer.