Changes in / [3abfe9a8:ebebd38] in mainline
- Files:
-
- 8 added
- 2 deleted
- 52 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/Makefile
r3abfe9a8 rebebd38 240 240 generic/src/lib/func.c \ 241 241 generic/src/lib/memstr.c \ 242 generic/src/lib/memfnc.c \243 242 generic/src/lib/sort.c \ 244 243 generic/src/lib/str.c \ -
kernel/arch/amd64/Makefile.inc
r3abfe9a8 rebebd38 33 33 34 34 FPU_NO_CFLAGS = -mno-sse -mno-sse2 35 36 # 37 # FIXME: 38 # 39 # The -fno-optimize-sibling-calls should be removed as soon as a bug 40 # in GCC concerning the "large" memory model and tail call optimization 41 # is fixed. 42 # 43 # If GCC generates a code for tail call, instead of generating .. 44 # 45 # jmp *fnc 46 # 47 # it generates an assembly code with an illegal immediate prefix: 48 # 49 # jmp *$fnc 50 # 51 52 CMN1 = -m64 -mcmodel=large -mno-red-zone -fno-unwind-tables -fno-omit-frame-pointer -fno-optimize-sibling-calls 35 CMN1 = -m64 -mcmodel=large -mno-red-zone -fno-unwind-tables -fno-omit-frame-pointer 53 36 GCC_CFLAGS += $(CMN1) 54 37 ICC_CFLAGS += $(CMN1) -
kernel/arch/amd64/_link.ld.in
r3abfe9a8 rebebd38 26 26 .mapped (PA2KA(BOOT_OFFSET)+SIZEOF(.unmapped)) : AT (SIZEOF(.unmapped)) { 27 27 ktext_start = .; 28 *(.text .text.*);28 *(.text); 29 29 ktext_end = .; 30 30 31 31 kdata_start = .; 32 *(.data); 33 *(.rodata .rodata.*);/* string literals */32 *(.data); /* initialized data */ 33 *(.rodata*); /* string literals */ 34 34 hardcoded_load_address = .; 35 35 QUAD(PA2KA(BOOT_OFFSET)); -
kernel/arch/amd64/src/asm.S
r3abfe9a8 rebebd38 37 37 .global read_efer_flag 38 38 .global set_efer_flag 39 .global memsetb 40 .global memsetw 41 .global memcpy 39 42 .global memcpy_from_uspace 40 43 .global memcpy_to_uspace … … 43 46 .global early_putchar 44 47 48 /* Wrapper for generic memsetb */ 49 memsetb: 50 jmp _memsetb 51 52 /* Wrapper for generic memsetw */ 53 memsetw: 54 jmp _memsetw 55 45 56 #define MEMCPY_DST %rdi 46 57 #define MEMCPY_SRC %rsi … … 63 74 * 64 75 */ 76 memcpy: 65 77 memcpy_from_uspace: 66 78 memcpy_to_uspace: -
kernel/arch/arm32/src/asm.S
r3abfe9a8 rebebd38 29 29 .text 30 30 31 .global memsetb 32 .global memsetw 33 .global memcpy 31 34 .global memcpy_from_uspace 32 35 .global memcpy_to_uspace … … 35 38 .global early_putchar 36 39 40 memsetb: 41 b _memsetb 42 43 memsetw: 44 b _memsetw 45 46 memcpy: 37 47 memcpy_from_uspace: 38 48 memcpy_to_uspace: -
kernel/arch/arm32/src/exception.c
r3abfe9a8 rebebd38 35 35 36 36 #include <arch/exception.h> 37 #include <arch/memstr.h> 37 38 #include <arch/regutils.h> 38 39 #include <arch/machine_func.h> -
kernel/arch/ia32/_link.ld.in
r3abfe9a8 rebebd38 25 25 .mapped (PA2KA(BOOT_OFFSET)+SIZEOF(.unmapped)): AT (SIZEOF(.unmapped)) { 26 26 ktext_start = .; 27 *(.text .text.*);27 *(.text); 28 28 ktext_end = .; 29 29 30 30 kdata_start = .; 31 31 *(.data); /* initialized data */ 32 *(.rodata .rodata.*);/* string literals */32 *(.rodata*); /* string literals */ 33 33 *(COMMON); /* global variables */ 34 34 hardcoded_load_address = .; -
kernel/arch/ia32/src/asm.S
r3abfe9a8 rebebd38 38 38 .global paging_on 39 39 .global enable_l_apic_in_msr 40 .global memsetb 41 .global memsetw 42 .global memcpy 40 43 .global memcpy_from_uspace 41 44 .global memcpy_from_uspace_failover_address … … 44 47 .global early_putchar 45 48 49 /* Wrapper for generic memsetb */ 50 memsetb: 51 jmp _memsetb 52 53 /* Wrapper for generic memsetw */ 54 memsetw: 55 jmp _memsetw 56 46 57 #define MEMCPY_DST 4 47 58 #define MEMCPY_SRC 8 … … 63 74 * 64 75 */ 76 memcpy: 65 77 memcpy_from_uspace: 66 78 memcpy_to_uspace: -
kernel/arch/ia32/src/cpu/cpu.c
r3abfe9a8 rebebd38 92 92 void cpu_arch_init(void) 93 93 { 94 cpuid_extended_feature_info efi; 94 95 cpu_info_t info; 95 96 uint32_t help = 0; … … 103 104 104 105 CPU->arch.fi.word = info.cpuid_edx; 106 efi.word = info.cpuid_ecx; 105 107 106 108 if (CPU->arch.fi.bits.fxsr) -
kernel/arch/ia64/_link.ld.in
r3abfe9a8 rebebd38 16 16 ktext_start = .; 17 17 *(K_TEXT_START); 18 *(.text .text.*)18 *(.text) 19 19 ktext_end = .; 20 20 … … 36 36 *(.bss) 37 37 *(COMMON); 38 38 39 39 . = ALIGN(8); 40 41 42 40 symbol_table = .; 41 *(symtab.*); /* Symbol table, must be LAST symbol!*/ 42 43 43 kdata_end = .; 44 44 } 45 45 46 46 /DISCARD/ : { 47 47 *(*); 48 48 } 49 49 50 } -
kernel/arch/ia64/src/asm.S
r3abfe9a8 rebebd38 30 30 31 31 .text 32 .global memcpy 32 33 .global memcpy_from_uspace 33 34 .global memcpy_to_uspace … … 38 39 * 39 40 * This memcpy() has been taken from the assembler output of 40 * a plain C implementation of memcpy() modified to have the 41 * failover part. 41 * the generic _memcpy() and modified to have the failover part. 42 42 * 43 43 * @param in0 Destination address. … … 46 46 * 47 47 */ 48 memcpy: 48 49 memcpy_from_uspace: 49 50 memcpy_to_uspace: … … 140 141 br.ret.sptk.many rp 141 142 143 .global memsetb 144 memsetb: 145 br _memsetb 146 147 .global memsetw 148 memsetw: 149 br _memsetw 150 142 151 .global cpu_halt 143 152 cpu_halt: -
kernel/arch/ia64/src/mm/tlb.c
r3abfe9a8 rebebd38 475 475 void alternate_instruction_tlb_fault(uint64_t vector, istate_t *istate) 476 476 { 477 region_register_t rr; 478 rid_t rid; 477 479 uintptr_t va; 478 480 pte_t *t; 479 481 480 482 va = istate->cr_ifa; /* faulting address */ 483 rr.word = rr_read(VA2VRN(va)); 484 rid = rr.map.rid; 481 485 482 486 page_table_lock(AS, true); … … 645 649 void data_dirty_bit_fault(uint64_t vector, istate_t *istate) 646 650 { 651 region_register_t rr; 652 rid_t rid; 647 653 uintptr_t va; 648 654 pte_t *t; 649 655 650 656 va = istate->cr_ifa; /* faulting address */ 657 rr.word = rr_read(VA2VRN(va)); 658 rid = rr.map.rid; 651 659 652 660 page_table_lock(AS, true); … … 678 686 void instruction_access_bit_fault(uint64_t vector, istate_t *istate) 679 687 { 688 region_register_t rr; 689 rid_t rid; 680 690 uintptr_t va; 681 691 pte_t *t; 682 692 683 693 va = istate->cr_ifa; /* faulting address */ 694 rr.word = rr_read(VA2VRN(va)); 695 rid = rr.map.rid; 684 696 685 697 page_table_lock(AS, true); … … 711 723 void data_access_bit_fault(uint64_t vector, istate_t *istate) 712 724 { 725 region_register_t rr; 726 rid_t rid; 713 727 uintptr_t va; 714 728 pte_t *t; 715 729 716 730 va = istate->cr_ifa; /* faulting address */ 731 rr.word = rr_read(VA2VRN(va)); 732 rid = rr.map.rid; 717 733 718 734 page_table_lock(AS, true); … … 744 760 void data_access_rights_fault(uint64_t vector, istate_t *istate) 745 761 { 762 region_register_t rr; 763 rid_t rid; 746 764 uintptr_t va; 747 765 pte_t *t; 748 766 749 767 va = istate->cr_ifa; /* faulting address */ 768 rr.word = rr_read(VA2VRN(va)); 769 rid = rr.map.rid; 750 770 751 771 /* … … 772 792 void page_not_present(uint64_t vector, istate_t *istate) 773 793 { 794 region_register_t rr; 795 rid_t rid; 774 796 uintptr_t va; 775 797 pte_t *t; 776 798 777 799 va = istate->cr_ifa; /* faulting address */ 800 rr.word = rr_read(VA2VRN(va)); 801 rid = rr.map.rid; 778 802 779 803 page_table_lock(AS, true); -
kernel/arch/mips32/src/asm.S
r3abfe9a8 rebebd38 57 57 nop 58 58 59 .global memsetb 60 memsetb: 61 j _memsetb 62 nop 63 64 .global memsetw 65 memsetw: 66 j _memsetw 67 nop 68 69 .global memcpy 59 70 .global memcpy_from_uspace 60 71 .global memcpy_to_uspace 61 72 .global memcpy_from_uspace_failover_address 62 73 .global memcpy_to_uspace_failover_address 74 memcpy: 63 75 memcpy_from_uspace: 64 76 memcpy_to_uspace: -
kernel/arch/ppc32/_link.ld.in
r3abfe9a8 rebebd38 36 36 kdata_start = .; 37 37 *(K_DATA_START); 38 *(.rodata .rodata.*); 38 *(.rodata); 39 *(.rodata.*); 39 40 *(.data); /* initialized data */ 40 41 *(.sdata); -
kernel/arch/ppc32/src/asm.S
r3abfe9a8 rebebd38 35 35 .global iret 36 36 .global iret_syscall 37 .global memsetb 38 .global memsetw 39 .global memcpy 37 40 .global memcpy_from_uspace 38 41 .global memcpy_to_uspace … … 205 208 rfi 206 209 210 memsetb: 211 b _memsetb 212 213 memsetw: 214 b _memsetw 215 216 memcpy: 207 217 memcpy_from_uspace: 208 218 memcpy_to_uspace: -
kernel/arch/sparc64/_link.ld.in
r3abfe9a8 rebebd38 15 15 ktext_start = .; 16 16 *(K_TEXT_START) 17 *(.text .text.*);17 *(.text); 18 18 ktext_end = .; 19 19 20 20 kdata_start = .; 21 21 *(K_DATA_START) 22 *(.rodata .rodata.*); 22 *(.rodata); 23 *(.rodata.*); 23 24 *(.data); /* initialized data */ 24 25 *(.sdata); -
kernel/arch/sparc64/src/asm.S
r3abfe9a8 rebebd38 36 36 37 37 /* 38 * This is the assembly language version of our _memcpy() generated by gcc. 39 */ 40 .global memcpy 41 memcpy: 42 mov %o0, %o3 /* save dst */ 43 add %o1, 7, %g1 44 and %g1, -8, %g1 45 cmp %o1, %g1 46 be,pn %xcc, 3f 47 add %o0, 7, %g1 48 mov 0, %g3 49 50 0: 51 52 brz,pn %o2, 2f 53 mov 0, %g2 54 55 1: 56 57 ldub [%g3 + %o1], %g1 58 add %g2, 1, %g2 59 cmp %o2, %g2 60 stb %g1, [%g3 + %o0] 61 bne,pt %xcc, 1b 62 mov %g2, %g3 63 64 2: 65 66 jmp %o7 + 8 /* exit point */ 67 mov %o3, %o0 68 69 3: 70 71 and %g1, -8, %g1 72 cmp %o0, %g1 73 bne,pt %xcc, 0b 74 mov 0, %g3 75 srlx %o2, 3, %g4 76 brz,pn %g4, 5f 77 mov 0, %g5 78 79 4: 80 81 sllx %g3, 3, %g2 82 add %g5, 1, %g3 83 ldx [%o1 + %g2], %g1 84 mov %g3, %g5 85 cmp %g4, %g3 86 bne,pt %xcc, 4b 87 stx %g1, [%o0 + %g2] 88 89 5: 90 91 and %o2, 7, %o2 92 brz,pn %o2, 2b 93 sllx %g4, 3, %g1 94 mov 0, %g2 95 add %g1, %o0, %o0 96 add %g1, %o1, %g4 97 mov 0, %g3 98 99 6: 100 101 ldub [%g2 + %g4], %g1 102 stb %g1, [%g2 + %o0] 103 add %g3, 1, %g2 104 cmp %o2, %g2 105 bne,pt %xcc, 6b 106 mov %g2, %g3 107 108 jmp %o7 + 8 /* exit point */ 109 mov %o3, %o0 110 111 /* 38 112 * Almost the same as memcpy() except the loads are from userspace. 39 113 */ … … 190 264 mov %g0, %o0 /* return 0 on failure */ 191 265 266 .global memsetb 267 memsetb: 268 ba %xcc, _memsetb 269 nop 270 271 .global memsetw 272 memsetw: 273 ba %xcc, _memsetw 274 nop 275 192 276 .global early_putchar 193 277 early_putchar: -
kernel/arch/sparc64/src/mm/sun4u/as.c
r3abfe9a8 rebebd38 43 43 44 44 #include <arch/mm/tsb.h> 45 #include <arch/memstr.h> 45 46 #include <arch/asm.h> 46 47 #include <mm/frame.h> -
kernel/arch/sparc64/src/mm/sun4v/as.c
r3abfe9a8 rebebd38 46 46 47 47 #include <arch/mm/tsb.h> 48 #include <arch/memstr.h> 48 49 #include <arch/asm.h> 49 50 #include <mm/frame.h> -
kernel/genarch/src/drivers/via-cuda/cuda.c
r3abfe9a8 rebebd38 239 239 cuda_instance_t *instance = irq->instance; 240 240 cuda_t *dev = instance->cuda; 241 uint8_t b;242 241 uint8_t data, b; 242 243 243 b = pio_read_8(&dev->b); 244 pio_read_8(&dev->sr);245 244 data = pio_read_8(&dev->sr); 245 246 246 if ((b & TREQ) == 0) { 247 247 instance->xstate = cx_receive; … … 251 251 cuda_send_start(instance); 252 252 } 253 254 255 253 254 memcpy(buf, instance->rcv_buf, instance->bidx); 255 *len = instance->bidx; 256 256 instance->bidx = 0; 257 257 } -
kernel/genarch/src/ofw/ebus.c
r3abfe9a8 rebebd38 39 39 #include <genarch/ofw/ebus.h> 40 40 #include <genarch/ofw/pci.h> 41 #include <arch/memstr.h> 41 42 #include <str.h> 42 43 #include <panic.h> -
kernel/genarch/src/ofw/fhc.c
r3abfe9a8 rebebd38 39 39 #include <genarch/ofw/fhc.h> 40 40 #include <arch/drivers/fhc.h> 41 #include <arch/memstr.h> 41 42 #include <str.h> 42 43 #include <panic.h> -
kernel/genarch/src/ofw/ofw_tree.c
r3abfe9a8 rebebd38 37 37 38 38 #include <genarch/ofw/ofw_tree.h> 39 #include <arch/memstr.h> 39 40 #include <mm/slab.h> 40 #include <memstr.h>41 41 #include <str.h> 42 42 #include <panic.h> -
kernel/genarch/src/ofw/pci.c
r3abfe9a8 rebebd38 40 40 #include <arch/drivers/pci.h> 41 41 #include <arch/trap/interrupt.h> 42 #include <arch/memstr.h> 42 43 #include <str.h> 43 44 #include <panic.h> -
kernel/genarch/src/ofw/upa.c
r3abfe9a8 rebebd38 38 38 #include <genarch/ofw/ofw_tree.h> 39 39 #include <genarch/ofw/upa.h> 40 #include <arch/memstr.h> 40 41 #include <func.h> 41 42 #include <panic.h> -
kernel/generic/include/memstr.h
r3abfe9a8 rebebd38 37 37 38 38 #include <typedefs.h> 39 #include <arch/memstr.h> 39 40 40 #define memset(dst, val, cnt) __builtin_memset((dst), (val), (cnt)) 41 #define memcpy(dst, src, cnt) __builtin_memcpy((dst), (src), (cnt)) 42 43 extern void memsetb(void *, size_t, uint8_t); 44 extern void memsetw(void *, size_t, uint16_t); 45 extern void *memmove(void *, const void *, size_t); 41 /* 42 * Architecture independent variants. 43 */ 44 extern void *_memcpy(void *dst, const void *src, size_t cnt); 45 extern void _memsetb(void *dst, size_t cnt, uint8_t x); 46 extern void _memsetw(void *dst, size_t cnt, uint16_t x); 47 extern void *memmove(void *dst, const void *src, size_t cnt); 46 48 47 49 #endif -
kernel/generic/src/lib/memstr.c
r3abfe9a8 rebebd38 28 28 */ 29 29 30 /** @addtogroup generic 30 /** @addtogroup generic 31 31 * @{ 32 32 */ … … 34 34 /** 35 35 * @file 36 * @brief 36 * @brief Memory string operations. 37 37 * 38 * This file provides architecture independent functions to manipulate blocks 39 * of memory. These functions are optimized as much as generic functions of 40 * this type can be. 38 * This file provides architecture independent functions to manipulate blocks of 39 * memory. These functions are optimized as much as generic functions of this 40 * type can be. However, architectures are free to provide even more optimized 41 * versions of these functions. 41 42 */ 42 43 43 44 #include <memstr.h> 44 45 #include <typedefs.h> 46 #include <align.h> 45 47 46 /** Fillblock of memory.48 /** Copy block of memory. 47 49 * 48 * Fill cnt bytes at dst address with the value val. 50 * Copy cnt bytes from src address to dst address. The copying is done 51 * word-by-word and then byte-by-byte. The source and destination memory areas 52 * cannot overlap. 49 53 * 50 * @param dst Destination address to fill. 51 * @param cnt Number of bytes to fill. 52 * @param val Value to fill. 54 * @param src Source address to copy from. 55 * @param dst Destination address to copy to. 56 * @param cnt Number of bytes to copy. 57 * 58 * @return Destination address. 59 */ 60 void *_memcpy(void *dst, const void *src, size_t cnt) 61 { 62 unsigned int i, j; 63 64 if (ALIGN_UP((uintptr_t) src, sizeof(sysarg_t)) != (uintptr_t) src || 65 ALIGN_UP((uintptr_t) dst, sizeof(sysarg_t)) != (uintptr_t) dst) { 66 for (i = 0; i < cnt; i++) 67 ((uint8_t *) dst)[i] = ((uint8_t *) src)[i]; 68 } else { 69 for (i = 0; i < cnt / sizeof(sysarg_t); i++) 70 ((sysarg_t *) dst)[i] = ((sysarg_t *) src)[i]; 71 72 for (j = 0; j < cnt % sizeof(sysarg_t); j++) 73 ((uint8_t *)(((sysarg_t *) dst) + i))[j] = 74 ((uint8_t *)(((sysarg_t *) src) + i))[j]; 75 } 76 77 return (char *) dst; 78 } 79 80 /** Move memory block with possible overlapping. 81 * 82 * Copy cnt bytes from src address to dst address. The source and destination 83 * memory areas may overlap. 84 * 85 * @param src Source address to copy from. 86 * @param dst Destination address to copy to. 87 * @param cnt Number of bytes to copy. 88 * 89 * @return Destination address. 90 */ 91 void *memmove(void *dst, const void *src, size_t n) 92 { 93 const uint8_t *sp; 94 uint8_t *dp; 95 96 /* Nothing to do? */ 97 if (src == dst) 98 return dst; 99 100 /* Non-overlapping? */ 101 if (dst >= src + n || src >= dst + n) { 102 return memcpy(dst, src, n); 103 } 104 105 /* Which direction? */ 106 if (src > dst) { 107 /* Forwards. */ 108 sp = src; 109 dp = dst; 110 111 while (n-- != 0) 112 *dp++ = *sp++; 113 } else { 114 /* Backwards. */ 115 sp = src + (n - 1); 116 dp = dst + (n - 1); 117 118 while (n-- != 0) 119 *dp-- = *sp--; 120 } 121 122 return dst; 123 } 124 125 /** Fill block of memory 126 * 127 * Fill cnt bytes at dst address with the value x. The filling is done 128 * byte-by-byte. 129 * 130 * @param dst Destination address to fill. 131 * @param cnt Number of bytes to fill. 132 * @param x Value to fill. 53 133 * 54 134 */ 55 void memsetb(void *dst, size_t cnt, uint8_t val)135 void _memsetb(void *dst, size_t cnt, uint8_t x) 56 136 { 57 memset(dst, val, cnt); 137 unsigned int i; 138 uint8_t *p = (uint8_t *) dst; 139 140 for (i = 0; i < cnt; i++) 141 p[i] = x; 58 142 } 59 143 60 144 /** Fill block of memory. 61 145 * 62 * Fill cnt words at dst address with the value val. The filling63 * is doneword-by-word.146 * Fill cnt words at dst address with the value x. The filling is done 147 * word-by-word. 64 148 * 65 * @param dst 66 * @param cnt 67 * @param valValue to fill.149 * @param dst Destination address to fill. 150 * @param cnt Number of words to fill. 151 * @param x Value to fill. 68 152 * 69 153 */ 70 void memsetw(void *dst, size_t cnt, uint16_t val)154 void _memsetw(void *dst, size_t cnt, uint16_t x) 71 155 { 72 size_t i;73 uint16_t *p tr= (uint16_t *) dst;156 unsigned int i; 157 uint16_t *p = (uint16_t *) dst; 74 158 75 159 for (i = 0; i < cnt; i++) 76 ptr[i] = val; 77 } 78 79 /** Move memory block with possible overlapping. 80 * 81 * Copy cnt bytes from src address to dst address. The source 82 * and destination memory areas may overlap. 83 * 84 * @param dst Destination address to copy to. 85 * @param src Source address to copy from. 86 * @param cnt Number of bytes to copy. 87 * 88 * @return Destination address. 89 * 90 */ 91 void *memmove(void *dst, const void *src, size_t cnt) 92 { 93 /* Nothing to do? */ 94 if (src == dst) 95 return dst; 96 97 /* Non-overlapping? */ 98 if ((dst >= src + cnt) || (src >= dst + cnt)) 99 return memcpy(dst, src, cnt); 100 101 uint8_t *dp; 102 const uint8_t *sp; 103 104 /* Which direction? */ 105 if (src > dst) { 106 /* Forwards. */ 107 dp = dst; 108 sp = src; 109 110 while (cnt-- != 0) 111 *dp++ = *sp++; 112 } else { 113 /* Backwards. */ 114 dp = dst + (cnt - 1); 115 sp = src + (cnt - 1); 116 117 while (cnt-- != 0) 118 *dp-- = *sp--; 119 } 120 121 return dst; 160 p[i] = x; 122 161 } 123 162 -
tools/autotool.py
r3abfe9a8 rebebd38 501 501 cross_prefix = os.environ['CROSS_PREFIX'] 502 502 else: 503 cross_prefix = "/usr/local /cross"503 cross_prefix = "/usr/local" 504 504 505 505 # Prefix binutils tools on Solaris -
tools/toolchain.sh
r3abfe9a8 rebebd38 52 52 #endif 53 53 EOF 54 55 BINUTILS_VERSION="2.21"56 GCC_VERSION="4.6.0"57 58 BASEDIR="`pwd`"59 BINUTILS="binutils-${BINUTILS_VERSION}.tar.bz2"60 GCC_CORE="gcc-core-${GCC_VERSION}.tar.bz2"61 GCC_OBJC="gcc-objc-${GCC_VERSION}.tar.bz2"62 GCC_CPP="gcc-g++-${GCC_VERSION}.tar.bz2"63 54 64 55 # … … 148 139 echo " sparc64 SPARC V9" 149 140 echo " all build all targets" 150 echo " parallel same as 'all', but in parallel"151 141 echo 152 142 echo "The toolchain will be installed to the directory specified by" 153 143 echo "the CROSS_PREFIX environment variable. If the variable is not" 154 echo "defined, /usr/local /crosswill be used by default."144 echo "defined, /usr/local will be used by default." 155 145 echo 156 146 … … 204 194 } 205 195 206 download_ fetch() {196 download_check() { 207 197 SOURCE="$1" 208 198 FILE="$2" … … 218 208 } 219 209 220 source_check() {221 FILE="$1"222 223 if [ ! -f "${FILE}" ]; then224 echo225 echo "File ${FILE} not found."226 227 exit 4228 fi229 }230 231 210 cleanup_dir() { 232 211 DIR="$1" … … 262 241 } 263 242 264 prepare() { 265 show_dependencies 266 check_dependecies 267 show_countdown 10 268 269 BINUTILS_SOURCE="ftp://ftp.gnu.org/gnu/binutils/" 270 GCC_SOURCE="ftp://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/" 271 272 download_fetch "${BINUTILS_SOURCE}" "${BINUTILS}" "c84c5acc9d266f1a7044b51c85a823f5" 273 download_fetch "${GCC_SOURCE}" "${GCC_CORE}" "b1957f3209080b2f55bc3756d3a62b7c" 274 download_fetch "${GCC_SOURCE}" "${GCC_OBJC}" "120d4675366ee82ea52f9ed65b57da04" 275 download_fetch "${GCC_SOURCE}" "${GCC_CPP}" "a30090fa655d0db4c970740d353c81f1" 243 patch_binutils() { 244 PLATFORM="$1" 245 246 if [ "${PLATFORM}" == "arm32" ] ; then 247 patch -p1 <<EOF 248 diff -Naur binutils-2.20.orig/gas/config/tc-arm.c binutils-2.20/gas/config/tc-arm.c 249 --- binutils-2.20.orig/gas/config/tc-arm.c 2009-08-30 00:10:59.000000000 +0200 250 +++ binutils-2.20/gas/config/tc-arm.c 2009-11-02 14:25:11.000000000 +0100 251 @@ -2485,8 +2485,9 @@ 252 know (frag->tc_frag_data.first_map == NULL); 253 frag->tc_frag_data.first_map = symbolP; 254 } 255 - if (frag->tc_frag_data.last_map != NULL) 256 + if (frag->tc_frag_data.last_map != NULL) { 257 know (S_GET_VALUE (frag->tc_frag_data.last_map) < S_GET_VALUE (symbolP)); 258 + } 259 frag->tc_frag_data.last_map = symbolP; 260 } 261 EOF 262 check_error $? "Error patching binutils" 263 fi 276 264 } 277 265 … … 280 268 TARGET="$2" 281 269 282 WORKDIR="${BASEDIR}/${PLATFORM}" 270 BINUTILS_VERSION="2.20" 271 GCC_VERSION="4.5.1" 272 273 BINUTILS="binutils-${BINUTILS_VERSION}.tar.bz2" 274 GCC_CORE="gcc-core-${GCC_VERSION}.tar.bz2" 275 GCC_OBJC="gcc-objc-${GCC_VERSION}.tar.bz2" 276 GCC_CPP="gcc-g++-${GCC_VERSION}.tar.bz2" 277 278 BINUTILS_SOURCE="ftp://ftp.gnu.org/gnu/binutils/" 279 GCC_SOURCE="ftp://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/" 280 281 WORKDIR="`pwd`" 283 282 BINUTILSDIR="${WORKDIR}/binutils-${BINUTILS_VERSION}" 284 283 GCCDIR="${WORKDIR}/gcc-${GCC_VERSION}" … … 286 285 287 286 if [ -z "${CROSS_PREFIX}" ] ; then 288 CROSS_PREFIX="/usr/local /cross"287 CROSS_PREFIX="/usr/local" 289 288 fi 290 289 … … 292 291 293 292 echo ">>> Downloading tarballs" 294 source_check "${BASEDIR}/${BINUTILS}"295 source_check "${BASEDIR}/${GCC_CORE}"296 source_check "${BASEDIR}/${GCC_OBJC}"297 source_check "${BASEDIR}/${GCC_CPP}"293 download_check "${BINUTILS_SOURCE}" "${BINUTILS}" "ee2d3e996e9a2d669808713360fa96f8" 294 download_check "${GCC_SOURCE}" "${GCC_CORE}" "dc8959e31b01a65ce10d269614815054" 295 download_check "${GCC_SOURCE}" "${GCC_OBJC}" "3c11b7037896e967eddf8178af2ddd98" 296 download_check "${GCC_SOURCE}" "${GCC_CPP}" "b294953ff0bb2f20c7acb2bf005d832a" 298 297 299 298 echo ">>> Removing previous content" 300 299 cleanup_dir "${PREFIX}" 301 cleanup_dir "${WORKDIR}" 300 cleanup_dir "${OBJDIR}" 301 cleanup_dir "${BINUTILSDIR}" 302 cleanup_dir "${GCCDIR}" 302 303 303 304 create_dir "${PREFIX}" "destination directory" … … 305 306 306 307 echo ">>> Unpacking tarballs" 307 cd "${WORKDIR}" 308 check_error $? "Change directory failed." 309 310 unpack_tarball "${BASEDIR}/${BINUTILS}" "binutils" 311 unpack_tarball "${BASEDIR}/${GCC_CORE}" "GCC Core" 312 unpack_tarball "${BASEDIR}/${GCC_OBJC}" "Objective C" 313 unpack_tarball "${BASEDIR}/${GCC_CPP}" "C++" 308 unpack_tarball "${BINUTILS}" "binutils" 309 unpack_tarball "${GCC_CORE}" "GCC Core" 310 unpack_tarball "${GCC_OBJC}" "Objective C" 311 unpack_tarball "${GCC_CPP}" "C++" 314 312 315 313 echo ">>> Processing binutils (${PLATFORM})" 316 314 cd "${BINUTILSDIR}" 317 315 check_error $? "Change directory failed." 316 patch_binutils "${PLATFORM}" 318 317 319 318 change_title "binutils: configure (${PLATFORM})" … … 337 336 check_error $? "Error compiling/installing GCC." 338 337 339 cd "${ BASEDIR}"338 cd "${WORKDIR}" 340 339 check_error $? "Change directory failed." 341 340 342 341 echo ">>> Cleaning up" 343 cleanup_dir "${WORKDIR}" 342 cleanup_dir "${OBJDIR}" 343 cleanup_dir "${BINUTILSDIR}" 344 cleanup_dir "${GCCDIR}" 344 345 345 346 echo … … 351 352 fi 352 353 354 show_dependencies 355 check_dependecies 356 show_countdown 10 357 353 358 case "$1" in 354 359 "amd64") 355 prepare356 360 build_target "amd64" "amd64-linux-gnu" 357 361 ;; 358 362 "arm32") 359 prepare360 363 build_target "arm32" "arm-linux-gnu" 361 364 ;; 362 365 "ia32") 363 prepare364 366 build_target "ia32" "i686-pc-linux-gnu" 365 367 ;; 366 368 "ia64") 367 prepare368 369 build_target "ia64" "ia64-pc-linux-gnu" 369 370 ;; 371 "ia64") 372 build_target "ia64" "ia64-pc-linux-gnu" 373 ;; 370 374 "mips32") 371 prepare372 375 build_target "mips32" "mipsel-linux-gnu" 373 376 ;; 374 377 "mips32eb") 375 prepare376 378 build_target "mips32eb" "mips-linux-gnu" 377 379 ;; 378 380 "mips64") 379 prepare380 381 build_target "mips64" "mips64el-linux-gnu" 381 382 ;; 382 383 "ppc32") 383 prepare384 384 build_target "ppc32" "ppc-linux-gnu" 385 385 ;; 386 386 "ppc64") 387 prepare388 387 build_target "ppc64" "ppc64-linux-gnu" 389 388 ;; 390 389 "sparc64") 391 prepare392 390 build_target "sparc64" "sparc64-linux-gnu" 393 391 ;; 394 392 "all") 395 prepare396 393 build_target "amd64" "amd64-linux-gnu" 397 394 build_target "arm32" "arm-linux-gnu" 398 395 build_target "ia32" "i686-pc-linux-gnu" 396 build_target "ia64" "ia64-pc-linux-gnu" 399 397 build_target "ia64" "ia64-pc-linux-gnu" 400 398 build_target "mips32" "mipsel-linux-gnu" … … 405 403 build_target "sparc64" "sparc64-linux-gnu" 406 404 ;; 407 "parallel")408 prepare409 build_target "amd64" "amd64-linux-gnu" &410 build_target "arm32" "arm-linux-gnu" &411 build_target "ia32" "i686-pc-linux-gnu" &412 build_target "ia64" "ia64-pc-linux-gnu" &413 build_target "mips32" "mipsel-linux-gnu" &414 build_target "mips32eb" "mips-linux-gnu" &415 build_target "mips64" "mips64el-linux-gnu" &416 build_target "ppc32" "ppc-linux-gnu" &417 build_target "ppc64" "ppc64-linux-gnu" &418 build_target "sparc64" "sparc64-linux-gnu" &419 wait420 ;;421 405 *) 422 406 show_usage -
uspace/app/bdsh/cmds/modules/cat/cat.c
r3abfe9a8 rebebd38 164 164 { 165 165 int fd, bytes = 0, count = 0, reads = 0; 166 off64_t total = 0; 166 167 char *buff = NULL; 167 168 int i; … … 173 174 return 1; 174 175 } 176 177 total = lseek(fd, 0, SEEK_END); 178 lseek(fd, 0, SEEK_SET); 175 179 176 180 if (NULL == (buff = (char *) malloc(blen + 1))) { -
uspace/app/sbi/src/run_expr.c
r3abfe9a8 rebebd38 2529 2529 if (rc1 == EOK) 2530 2530 rc2 = os_str_get_char(string->value, elem_index, &cval); 2531 else2532 rc2 = EOK;2533 2531 2534 2532 if (rc1 != EOK || rc2 != EOK) { -
uspace/app/tester/fault/fault2.c
r3abfe9a8 rebebd38 29 29 30 30 #include "../tester.h" 31 #include <stdio.h>32 31 33 32 typedef int __attribute__((may_alias)) aliasing_int; … … 39 38 40 39 var1 = *((aliasing_int *) (((char *) (&var)) + 1)); 41 printf("Read %d\n", var1);42 40 43 41 return "Survived unaligned read"; -
uspace/app/trace/trace.c
r3abfe9a8 rebebd38 872 872 static display_mask_t parse_display_mask(const char *text) 873 873 { 874 display_mask_t dm = 0;874 display_mask_t dm; 875 875 const char *c = text; 876 876 -
uspace/lib/c/arch/abs32le/_link.ld.in
r3abfe9a8 rebebd38 11 11 12 12 .text : { 13 *(.text .text.*);14 *(.rodata .rodata.*);13 *(.text); 14 *(.rodata*); 15 15 } :text 16 16 -
uspace/lib/c/arch/amd64/_link.ld.in
r3abfe9a8 rebebd38 16 16 17 17 .text : { 18 *(.text .text.*);19 *(.rodata .rodata.*);18 *(.text); 19 *(.rodata*); 20 20 } :text 21 21 -
uspace/lib/c/arch/arm32/_link.ld.in
r3abfe9a8 rebebd38 15 15 16 16 .text : { 17 *(.text .text.*);18 *(.rodata .rodata.*);17 *(.text); 18 *(.rodata*); 19 19 } :text 20 20 -
uspace/lib/c/arch/ia32/_link.ld.in
r3abfe9a8 rebebd38 16 16 17 17 .text : { 18 *(.text .text.*);19 *(.rodata .rodata.*);18 *(.text); 19 *(.rodata*); 20 20 } :text 21 21 -
uspace/lib/c/arch/ia64/_link.ld.in
r3abfe9a8 rebebd38 15 15 16 16 .text : { 17 *(.text .text.*);18 *(.rodata .rodata.*);17 *(.text); 18 *(.rodata*); 19 19 } :text 20 20 … … 23 23 .got : { 24 24 _gp = .; 25 *(.got .got.*);25 *(.got*); 26 26 } :data 27 27 -
uspace/lib/c/arch/mips32/_link.ld.in
r3abfe9a8 rebebd38 15 15 16 16 .text : { 17 *(.text .text.*);18 *(.rodata .rodata.*);17 *(.text); 18 *(.rodata*); 19 19 } :text 20 20 -
uspace/lib/c/arch/ppc32/_link.ld.in
r3abfe9a8 rebebd38 15 15 16 16 .text : { 17 *(.text .text.*);18 *(.rodata .rodata.*);17 *(.text); 18 *(.rodata*); 19 19 } :text 20 20 -
uspace/lib/c/arch/sparc64/_link.ld.in
r3abfe9a8 rebebd38 15 15 16 16 .text : { 17 *(.text .text.*);18 *(.rodata .rodata.*);17 *(.text); 18 *(.rodata*); 19 19 } :text 20 20 -
uspace/lib/c/generic/vfs/vfs.c
r3abfe9a8 rebebd38 756 756 { 757 757 struct stat stat; 758 759 int rc = fstat(fildes, &stat); 760 if (rc != 0) 761 return rc; 762 758 int rc; 759 760 rc = fstat(fildes, &stat); 761 763 762 if (!stat.device) 764 763 return -1; -
uspace/srv/hw/bus/cuda_adb/cuda_adb.c
r3abfe9a8 rebebd38 367 367 static void cuda_irq_rcv_end(void *buf, size_t *len) 368 368 { 369 uint8_t b;370 369 uint8_t data, b; 370 371 371 b = pio_read_8(&dev->b); 372 pio_read_8(&dev->sr);373 372 data = pio_read_8(&dev->sr); 373 374 374 if ((b & TREQ) == 0) { 375 375 instance->xstate = cx_receive; … … 379 379 cuda_send_start(); 380 380 } 381 382 383 381 382 memcpy(buf, instance->rcv_buf, instance->bidx); 383 *len = instance->bidx; 384 384 instance->bidx = 0; 385 385 } -
uspace/srv/loader/arch/abs32le/_link.ld.in
r3abfe9a8 rebebd38 21 21 22 22 .text : { 23 *(.text .text.*);24 *(.rodata .rodata.*);23 *(.text); 24 *(.rodata*); 25 25 } :text 26 26 -
uspace/srv/loader/arch/amd64/_link.ld.in
r3abfe9a8 rebebd38 27 27 28 28 .text : { 29 *(.text .text.*);30 *(.rodata .rodata.*);29 *(.text); 30 *(.rodata*); 31 31 } :text 32 32 -
uspace/srv/loader/arch/arm32/_link.ld.in
r3abfe9a8 rebebd38 25 25 26 26 .text : { 27 *(.text .text.*);28 *(.rodata .rodata.*);27 *(.text); 28 *(.rodata*); 29 29 } :text 30 30 -
uspace/srv/loader/arch/ia32/_link.ld.in
r3abfe9a8 rebebd38 26 26 27 27 .text : { 28 *(.text .text.*);29 *(.rodata .rodata.*);28 *(.text); 29 *(.rodata*); 30 30 } :text 31 31 -
uspace/srv/loader/arch/ia64/_link.ld.in
r3abfe9a8 rebebd38 21 21 22 22 .text : { 23 *(.text .text.*);24 *(.rodata .rodata.*);23 *(.text); 24 *(.rodata*); 25 25 } :text 26 26 … … 29 29 .got : { 30 30 _gp = .; 31 *(.got .got.*);31 *(.got*); 32 32 } :data 33 33 -
uspace/srv/loader/arch/mips32/_link.ld.in
r3abfe9a8 rebebd38 25 25 26 26 .text : { 27 *(.text .text.*);28 *(.rodata .rodata.*);27 *(.text); 28 *(.rodata*); 29 29 } :text 30 30 -
uspace/srv/loader/arch/ppc32/_link.ld.in
r3abfe9a8 rebebd38 25 25 26 26 .text : { 27 *(.text .text.*);28 *(.rodata .rodata.*);27 *(.text); 28 *(.rodata*); 29 29 } :text 30 30 -
uspace/srv/loader/arch/sparc64/_link.ld.in
r3abfe9a8 rebebd38 20 20 21 21 .text : { 22 *(.text .text.*);23 *(.rodata .rodata.*);22 *(.text); 23 *(.rodata*); 24 24 } :text 25 25 -
uspace/srv/loader/main.c
r3abfe9a8 rebebd38 407 407 /* Not reached */ 408 408 default: 409 retval = E INVAL;409 retval = ENOENT; 410 410 break; 411 411 } 412 413 if (IPC_GET_IMETHOD(call) != IPC_M_PHONE_HUNGUP) 414 async_answer_0(callid, retval); 412 if (IPC_GET_IMETHOD(call) != IPC_M_PHONE_HUNGUP) { 413 DPRINTF("Responding EINVAL to method %d.\n", 414 IPC_GET_IMETHOD(call)); 415 async_answer_0(callid, EINVAL); 416 } 415 417 } 416 418 }
Note:
See TracChangeset
for help on using the changeset viewer.