Changeset 3abfe9a8 in mainline
- Timestamp:
- 2011-03-29T21:38:40Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d6b81941
- Parents:
- ebebd38 (diff), eaf4c393 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 6 deleted
- 52 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
kernel/Makefile
rebebd38 r3abfe9a8 240 240 generic/src/lib/func.c \ 241 241 generic/src/lib/memstr.c \ 242 generic/src/lib/memfnc.c \ 242 243 generic/src/lib/sort.c \ 243 244 generic/src/lib/str.c \ -
kernel/arch/amd64/Makefile.inc
rebebd38 r3abfe9a8 33 33 34 34 FPU_NO_CFLAGS = -mno-sse -mno-sse2 35 CMN1 = -m64 -mcmodel=large -mno-red-zone -fno-unwind-tables -fno-omit-frame-pointer 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 36 53 GCC_CFLAGS += $(CMN1) 37 54 ICC_CFLAGS += $(CMN1) -
kernel/arch/amd64/_link.ld.in
rebebd38 r3abfe9a8 26 26 .mapped (PA2KA(BOOT_OFFSET)+SIZEOF(.unmapped)) : AT (SIZEOF(.unmapped)) { 27 27 ktext_start = .; 28 *(.text );28 *(.text .text.*); 29 29 ktext_end = .; 30 30 31 31 kdata_start = .; 32 *(.data); /* initialized data */33 *(.rodata *);/* string literals */32 *(.data); /* initialized data */ 33 *(.rodata .rodata.*); /* string literals */ 34 34 hardcoded_load_address = .; 35 35 QUAD(PA2KA(BOOT_OFFSET)); -
kernel/arch/amd64/src/asm.S
rebebd38 r3abfe9a8 37 37 .global read_efer_flag 38 38 .global set_efer_flag 39 .global memsetb40 .global memsetw41 .global memcpy42 39 .global memcpy_from_uspace 43 40 .global memcpy_to_uspace … … 46 43 .global early_putchar 47 44 48 /* Wrapper for generic memsetb */49 memsetb:50 jmp _memsetb51 52 /* Wrapper for generic memsetw */53 memsetw:54 jmp _memsetw55 56 45 #define MEMCPY_DST %rdi 57 46 #define MEMCPY_SRC %rsi … … 74 63 * 75 64 */ 76 memcpy:77 65 memcpy_from_uspace: 78 66 memcpy_to_uspace: -
kernel/arch/arm32/src/asm.S
rebebd38 r3abfe9a8 29 29 .text 30 30 31 .global memsetb32 .global memsetw33 .global memcpy34 31 .global memcpy_from_uspace 35 32 .global memcpy_to_uspace … … 38 35 .global early_putchar 39 36 40 memsetb:41 b _memsetb42 43 memsetw:44 b _memsetw45 46 memcpy:47 37 memcpy_from_uspace: 48 38 memcpy_to_uspace: -
kernel/arch/arm32/src/exception.c
rebebd38 r3abfe9a8 35 35 36 36 #include <arch/exception.h> 37 #include <arch/memstr.h>38 37 #include <arch/regutils.h> 39 38 #include <arch/machine_func.h> -
kernel/arch/ia32/_link.ld.in
rebebd38 r3abfe9a8 25 25 .mapped (PA2KA(BOOT_OFFSET)+SIZEOF(.unmapped)): AT (SIZEOF(.unmapped)) { 26 26 ktext_start = .; 27 *(.text );27 *(.text .text.*); 28 28 ktext_end = .; 29 29 30 30 kdata_start = .; 31 31 *(.data); /* initialized data */ 32 *(.rodata *);/* string literals */32 *(.rodata .rodata.*); /* string literals */ 33 33 *(COMMON); /* global variables */ 34 34 hardcoded_load_address = .; -
kernel/arch/ia32/src/asm.S
rebebd38 r3abfe9a8 38 38 .global paging_on 39 39 .global enable_l_apic_in_msr 40 .global memsetb41 .global memsetw42 .global memcpy43 40 .global memcpy_from_uspace 44 41 .global memcpy_from_uspace_failover_address … … 47 44 .global early_putchar 48 45 49 /* Wrapper for generic memsetb */50 memsetb:51 jmp _memsetb52 53 /* Wrapper for generic memsetw */54 memsetw:55 jmp _memsetw56 57 46 #define MEMCPY_DST 4 58 47 #define MEMCPY_SRC 8 … … 74 63 * 75 64 */ 76 memcpy:77 65 memcpy_from_uspace: 78 66 memcpy_to_uspace: -
kernel/arch/ia32/src/cpu/cpu.c
rebebd38 r3abfe9a8 92 92 void cpu_arch_init(void) 93 93 { 94 cpuid_extended_feature_info efi;95 94 cpu_info_t info; 96 95 uint32_t help = 0; … … 104 103 105 104 CPU->arch.fi.word = info.cpuid_edx; 106 efi.word = info.cpuid_ecx;107 105 108 106 if (CPU->arch.fi.bits.fxsr) -
kernel/arch/ia64/_link.ld.in
rebebd38 r3abfe9a8 16 16 ktext_start = .; 17 17 *(K_TEXT_START); 18 *(.text )18 *(.text .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 50 49 } -
kernel/arch/ia64/src/asm.S
rebebd38 r3abfe9a8 30 30 31 31 .text 32 .global memcpy33 32 .global memcpy_from_uspace 34 33 .global memcpy_to_uspace … … 39 38 * 40 39 * This memcpy() has been taken from the assembler output of 41 * the generic _memcpy() and modified to have the failover part. 40 * a plain C implementation of memcpy() modified to have the 41 * failover part. 42 42 * 43 43 * @param in0 Destination address. … … 46 46 * 47 47 */ 48 memcpy:49 48 memcpy_from_uspace: 50 49 memcpy_to_uspace: … … 141 140 br.ret.sptk.many rp 142 141 143 .global memsetb144 memsetb:145 br _memsetb146 147 .global memsetw148 memsetw:149 br _memsetw150 151 142 .global cpu_halt 152 143 cpu_halt: -
kernel/arch/ia64/src/mm/tlb.c
rebebd38 r3abfe9a8 475 475 void alternate_instruction_tlb_fault(uint64_t vector, istate_t *istate) 476 476 { 477 region_register_t rr;478 rid_t rid;479 477 uintptr_t va; 480 478 pte_t *t; 481 479 482 480 va = istate->cr_ifa; /* faulting address */ 483 rr.word = rr_read(VA2VRN(va));484 rid = rr.map.rid;485 481 486 482 page_table_lock(AS, true); … … 649 645 void data_dirty_bit_fault(uint64_t vector, istate_t *istate) 650 646 { 651 region_register_t rr;652 rid_t rid;653 647 uintptr_t va; 654 648 pte_t *t; 655 649 656 650 va = istate->cr_ifa; /* faulting address */ 657 rr.word = rr_read(VA2VRN(va));658 rid = rr.map.rid;659 651 660 652 page_table_lock(AS, true); … … 686 678 void instruction_access_bit_fault(uint64_t vector, istate_t *istate) 687 679 { 688 region_register_t rr;689 rid_t rid;690 680 uintptr_t va; 691 681 pte_t *t; 692 682 693 683 va = istate->cr_ifa; /* faulting address */ 694 rr.word = rr_read(VA2VRN(va));695 rid = rr.map.rid;696 684 697 685 page_table_lock(AS, true); … … 723 711 void data_access_bit_fault(uint64_t vector, istate_t *istate) 724 712 { 725 region_register_t rr;726 rid_t rid;727 713 uintptr_t va; 728 714 pte_t *t; 729 715 730 716 va = istate->cr_ifa; /* faulting address */ 731 rr.word = rr_read(VA2VRN(va));732 rid = rr.map.rid;733 717 734 718 page_table_lock(AS, true); … … 760 744 void data_access_rights_fault(uint64_t vector, istate_t *istate) 761 745 { 762 region_register_t rr;763 rid_t rid;764 746 uintptr_t va; 765 747 pte_t *t; 766 748 767 749 va = istate->cr_ifa; /* faulting address */ 768 rr.word = rr_read(VA2VRN(va));769 rid = rr.map.rid;770 750 771 751 /* … … 792 772 void page_not_present(uint64_t vector, istate_t *istate) 793 773 { 794 region_register_t rr;795 rid_t rid;796 774 uintptr_t va; 797 775 pte_t *t; 798 776 799 777 va = istate->cr_ifa; /* faulting address */ 800 rr.word = rr_read(VA2VRN(va));801 rid = rr.map.rid;802 778 803 779 page_table_lock(AS, true); -
kernel/arch/mips32/src/asm.S
rebebd38 r3abfe9a8 57 57 nop 58 58 59 .global memsetb60 memsetb:61 j _memsetb62 nop63 64 .global memsetw65 memsetw:66 j _memsetw67 nop68 69 .global memcpy70 59 .global memcpy_from_uspace 71 60 .global memcpy_to_uspace 72 61 .global memcpy_from_uspace_failover_address 73 62 .global memcpy_to_uspace_failover_address 74 memcpy:75 63 memcpy_from_uspace: 76 64 memcpy_to_uspace: -
kernel/arch/ppc32/_link.ld.in
rebebd38 r3abfe9a8 36 36 kdata_start = .; 37 37 *(K_DATA_START); 38 *(.rodata); 39 *(.rodata.*); 38 *(.rodata .rodata.*); 40 39 *(.data); /* initialized data */ 41 40 *(.sdata); -
kernel/arch/ppc32/src/asm.S
rebebd38 r3abfe9a8 35 35 .global iret 36 36 .global iret_syscall 37 .global memsetb38 .global memsetw39 .global memcpy40 37 .global memcpy_from_uspace 41 38 .global memcpy_to_uspace … … 208 205 rfi 209 206 210 memsetb:211 b _memsetb212 213 memsetw:214 b _memsetw215 216 memcpy:217 207 memcpy_from_uspace: 218 208 memcpy_to_uspace: -
kernel/arch/sparc64/_link.ld.in
rebebd38 r3abfe9a8 15 15 ktext_start = .; 16 16 *(K_TEXT_START) 17 *(.text );17 *(.text .text.*); 18 18 ktext_end = .; 19 19 20 20 kdata_start = .; 21 21 *(K_DATA_START) 22 *(.rodata); 23 *(.rodata.*); 22 *(.rodata .rodata.*); 24 23 *(.data); /* initialized data */ 25 24 *(.sdata); -
kernel/arch/sparc64/src/asm.S
rebebd38 r3abfe9a8 34 34 .register %g2, #scratch 35 35 .register %g3, #scratch 36 37 /*38 * This is the assembly language version of our _memcpy() generated by gcc.39 */40 .global memcpy41 memcpy:42 mov %o0, %o3 /* save dst */43 add %o1, 7, %g144 and %g1, -8, %g145 cmp %o1, %g146 be,pn %xcc, 3f47 add %o0, 7, %g148 mov 0, %g349 50 0:51 52 brz,pn %o2, 2f53 mov 0, %g254 55 1:56 57 ldub [%g3 + %o1], %g158 add %g2, 1, %g259 cmp %o2, %g260 stb %g1, [%g3 + %o0]61 bne,pt %xcc, 1b62 mov %g2, %g363 64 2:65 66 jmp %o7 + 8 /* exit point */67 mov %o3, %o068 69 3:70 71 and %g1, -8, %g172 cmp %o0, %g173 bne,pt %xcc, 0b74 mov 0, %g375 srlx %o2, 3, %g476 brz,pn %g4, 5f77 mov 0, %g578 79 4:80 81 sllx %g3, 3, %g282 add %g5, 1, %g383 ldx [%o1 + %g2], %g184 mov %g3, %g585 cmp %g4, %g386 bne,pt %xcc, 4b87 stx %g1, [%o0 + %g2]88 89 5:90 91 and %o2, 7, %o292 brz,pn %o2, 2b93 sllx %g4, 3, %g194 mov 0, %g295 add %g1, %o0, %o096 add %g1, %o1, %g497 mov 0, %g398 99 6:100 101 ldub [%g2 + %g4], %g1102 stb %g1, [%g2 + %o0]103 add %g3, 1, %g2104 cmp %o2, %g2105 bne,pt %xcc, 6b106 mov %g2, %g3107 108 jmp %o7 + 8 /* exit point */109 mov %o3, %o0110 36 111 37 /* … … 264 190 mov %g0, %o0 /* return 0 on failure */ 265 191 266 .global memsetb267 memsetb:268 ba %xcc, _memsetb269 nop270 271 .global memsetw272 memsetw:273 ba %xcc, _memsetw274 nop275 276 192 .global early_putchar 277 193 early_putchar: -
kernel/arch/sparc64/src/mm/sun4u/as.c
rebebd38 r3abfe9a8 43 43 44 44 #include <arch/mm/tsb.h> 45 #include <arch/memstr.h>46 45 #include <arch/asm.h> 47 46 #include <mm/frame.h> -
kernel/arch/sparc64/src/mm/sun4v/as.c
rebebd38 r3abfe9a8 46 46 47 47 #include <arch/mm/tsb.h> 48 #include <arch/memstr.h>49 48 #include <arch/asm.h> 50 49 #include <mm/frame.h> -
kernel/genarch/src/drivers/via-cuda/cuda.c
rebebd38 r3abfe9a8 239 239 cuda_instance_t *instance = irq->instance; 240 240 cuda_t *dev = instance->cuda; 241 uint8_t data,b;242 241 uint8_t b; 242 243 243 b = pio_read_8(&dev->b); 244 data =pio_read_8(&dev->sr);245 244 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
rebebd38 r3abfe9a8 39 39 #include <genarch/ofw/ebus.h> 40 40 #include <genarch/ofw/pci.h> 41 #include <arch/memstr.h>42 41 #include <str.h> 43 42 #include <panic.h> -
kernel/genarch/src/ofw/fhc.c
rebebd38 r3abfe9a8 39 39 #include <genarch/ofw/fhc.h> 40 40 #include <arch/drivers/fhc.h> 41 #include <arch/memstr.h>42 41 #include <str.h> 43 42 #include <panic.h> -
kernel/genarch/src/ofw/ofw_tree.c
rebebd38 r3abfe9a8 37 37 38 38 #include <genarch/ofw/ofw_tree.h> 39 #include <arch/memstr.h>40 39 #include <mm/slab.h> 40 #include <memstr.h> 41 41 #include <str.h> 42 42 #include <panic.h> -
kernel/genarch/src/ofw/pci.c
rebebd38 r3abfe9a8 40 40 #include <arch/drivers/pci.h> 41 41 #include <arch/trap/interrupt.h> 42 #include <arch/memstr.h>43 42 #include <str.h> 44 43 #include <panic.h> -
kernel/genarch/src/ofw/upa.c
rebebd38 r3abfe9a8 38 38 #include <genarch/ofw/ofw_tree.h> 39 39 #include <genarch/ofw/upa.h> 40 #include <arch/memstr.h>41 40 #include <func.h> 42 41 #include <panic.h> -
kernel/generic/include/lib/memfnc.h
rebebd38 r3abfe9a8 1 1 /* 2 * Copyright (c) 20 05 Sergey Bondari2 * Copyright (c) 2011 Martin Decky 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup ia6429 /** @addtogroup generic 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef KERN_ ia64_MEMSTR_H_36 #define KERN_ ia64_MEMSTR_H_35 #ifndef KERN_LIB_MEMFNC_H_ 36 #define KERN_LIB_MEMFNC_H_ 37 37 38 # define memcpy(dst, src, cnt) __builtin_memcpy((dst), (src), (cnt))38 #include <typedefs.h> 39 39 40 extern void memsetw(void *, size_t, uint16_t);41 extern void memsetb(void *, size_t, uint8_t);40 extern void *memset(void *, int, size_t); 41 extern void *memcpy(void *, const void *, size_t); 42 42 43 43 #endif -
kernel/generic/include/memstr.h
rebebd38 r3abfe9a8 37 37 38 38 #include <typedefs.h> 39 #include <arch/memstr.h>40 39 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); 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); 48 46 49 47 #endif -
kernel/generic/src/lib/memfnc.c
rebebd38 r3abfe9a8 1 /*2 * Copyright (c) 20 05 Sergey Bondari1 /* 2 * Copyright (c) 2011 Martin Decky 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup amd6429 /** @addtogroup generic 30 30 * @{ 31 31 */ 32 /** @file 32 33 /** 34 * @file 35 * @brief Memory string functions. 36 * 37 * This file provides architecture independent functions to manipulate blocks 38 * of memory. These functions are optimized as much as generic functions of 39 * this type can be. 33 40 */ 34 41 35 #i fndef KERN_amd64_MEMSTR_H_36 # define KERN_amd64_MEMSTR_H_42 #include <lib/memfnc.h> 43 #include <typedefs.h> 37 44 38 #define memcpy(dst, src, cnt) __builtin_memcpy((dst), (src), (cnt)) 45 /** Fill block of memory. 46 * 47 * Fill cnt bytes at dst address with the value val. 48 * 49 * @param dst Destination address to fill. 50 * @param val Value to fill. 51 * @param cnt Number of bytes to fill. 52 * 53 * @return Destination address. 54 * 55 */ 56 void *memset(void *dst, int val, size_t cnt) 57 { 58 size_t i; 59 uint8_t *ptr = (uint8_t *) dst; 60 61 for (i = 0; i < cnt; i++) 62 ptr[i] = val; 63 64 return dst; 65 } 39 66 40 extern void memsetw(void *, size_t, uint16_t); 41 extern void memsetb(void *, size_t, uint8_t); 42 43 #endif 67 /** Move memory block without overlapping. 68 * 69 * Copy cnt bytes from src address to dst address. The source 70 * and destination memory areas cannot overlap. 71 * 72 * @param dst Destination address to copy to. 73 * @param src Source address to copy from. 74 * @param cnt Number of bytes to copy. 75 * 76 * @return Destination address. 77 * 78 */ 79 void *memcpy(void *dst, const void *src, size_t cnt) 80 { 81 uint8_t *dp = (uint8_t *) dst; 82 const uint8_t *sp = (uint8_t *) src; 83 84 while (cnt-- != 0) 85 *dp++ = *sp++; 86 87 return dst; 88 } 44 89 45 90 /** @} -
kernel/generic/src/lib/memstr.c
rebebd38 r3abfe9a8 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 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. 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. 42 41 */ 43 42 44 43 #include <memstr.h> 45 44 #include <typedefs.h> 46 #include <align.h>47 45 48 /** Copyblock of memory.46 /** Fill block of memory. 49 47 * 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. 48 * Fill cnt bytes at dst address with the value val. 53 49 * 54 * @param src Source address to copy from.55 * @param dst Destination address to copy to.56 * @param cnt Number of bytes to copy.50 * @param dst Destination address to fill. 51 * @param cnt Number of bytes to fill. 52 * @param val Value to fill. 57 53 * 58 * @return Destination address.59 54 */ 60 void *_memcpy(void *dst, const void *src, size_t cnt)55 void memsetb(void *dst, size_t cnt, uint8_t val) 61 56 { 62 unsigned int i, j; 57 memset(dst, val, cnt); 58 } 59 60 /** Fill block of memory. 61 * 62 * Fill cnt words at dst address with the value val. The filling 63 * is done word-by-word. 64 * 65 * @param dst Destination address to fill. 66 * @param cnt Number of words to fill. 67 * @param val Value to fill. 68 * 69 */ 70 void memsetw(void *dst, size_t cnt, uint16_t val) 71 { 72 size_t i; 73 uint16_t *ptr = (uint16_t *) dst; 63 74 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; 75 for (i = 0; i < cnt; i++) 76 ptr[i] = val; 78 77 } 79 78 80 79 /** Move memory block with possible overlapping. 81 80 * 82 * Copy cnt bytes from src address to dst address. The source and destination83 * memory areas may overlap.81 * Copy cnt bytes from src address to dst address. The source 82 * and destination memory areas may overlap. 84 83 * 85 * @param src Source address to copy from.86 * @param dst Destination address to copy to.87 * @param cnt 84 * @param dst Destination address to copy to. 85 * @param src Source address to copy from. 86 * @param cnt Number of bytes to copy. 88 87 * 89 * @return Destination address. 88 * @return Destination address. 89 * 90 90 */ 91 void *memmove(void *dst, const void *src, size_t n)91 void *memmove(void *dst, const void *src, size_t cnt) 92 92 { 93 const uint8_t *sp;94 uint8_t *dp;95 96 93 /* Nothing to do? */ 97 94 if (src == dst) 98 95 return dst; 99 96 100 97 /* Non-overlapping? */ 101 if (dst >= src + n || src >= dst + n) { 102 return memcpy(dst, src, n); 103 } 104 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 105 104 /* Which direction? */ 106 105 if (src > dst) { 107 106 /* Forwards. */ 107 dp = dst; 108 108 sp = src; 109 dp = dst; 110 111 while (n-- != 0) 109 110 while (cnt-- != 0) 112 111 *dp++ = *sp++; 113 112 } else { 114 113 /* Backwards. */ 115 sp = src + (n- 1);116 dp = dst + (n- 1);117 118 while ( n-- != 0)114 dp = dst + (cnt - 1); 115 sp = src + (cnt - 1); 116 117 while (cnt-- != 0) 119 118 *dp-- = *sp--; 120 119 } 121 120 122 121 return dst; 123 }124 125 /** Fill block of memory126 *127 * Fill cnt bytes at dst address with the value x. The filling is done128 * 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.133 *134 */135 void _memsetb(void *dst, size_t cnt, uint8_t x)136 {137 unsigned int i;138 uint8_t *p = (uint8_t *) dst;139 140 for (i = 0; i < cnt; i++)141 p[i] = x;142 }143 144 /** Fill block of memory.145 *146 * Fill cnt words at dst address with the value x. The filling is done147 * word-by-word.148 *149 * @param dst Destination address to fill.150 * @param cnt Number of words to fill.151 * @param x Value to fill.152 *153 */154 void _memsetw(void *dst, size_t cnt, uint16_t x)155 {156 unsigned int i;157 uint16_t *p = (uint16_t *) dst;158 159 for (i = 0; i < cnt; i++)160 p[i] = x;161 122 } 162 123 -
tools/autotool.py
rebebd38 r3abfe9a8 501 501 cross_prefix = os.environ['CROSS_PREFIX'] 502 502 else: 503 cross_prefix = "/usr/local "503 cross_prefix = "/usr/local/cross" 504 504 505 505 # Prefix binutils tools on Solaris -
tools/toolchain.sh
rebebd38 r3abfe9a8 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" 54 63 55 64 # … … 139 148 echo " sparc64 SPARC V9" 140 149 echo " all build all targets" 150 echo " parallel same as 'all', but in parallel" 141 151 echo 142 152 echo "The toolchain will be installed to the directory specified by" 143 153 echo "the CROSS_PREFIX environment variable. If the variable is not" 144 echo "defined, /usr/local will be used by default."154 echo "defined, /usr/local/cross will be used by default." 145 155 echo 146 156 … … 194 204 } 195 205 196 download_ check() {206 download_fetch() { 197 207 SOURCE="$1" 198 208 FILE="$2" … … 208 218 } 209 219 220 source_check() { 221 FILE="$1" 222 223 if [ ! -f "${FILE}" ]; then 224 echo 225 echo "File ${FILE} not found." 226 227 exit 4 228 fi 229 } 230 210 231 cleanup_dir() { 211 232 DIR="$1" … … 241 262 } 242 263 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 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" 264 276 } 265 277 … … 268 280 TARGET="$2" 269 281 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`" 282 WORKDIR="${BASEDIR}/${PLATFORM}" 282 283 BINUTILSDIR="${WORKDIR}/binutils-${BINUTILS_VERSION}" 283 284 GCCDIR="${WORKDIR}/gcc-${GCC_VERSION}" … … 285 286 286 287 if [ -z "${CROSS_PREFIX}" ] ; then 287 CROSS_PREFIX="/usr/local "288 CROSS_PREFIX="/usr/local/cross" 288 289 fi 289 290 … … 291 292 292 293 echo ">>> Downloading tarballs" 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"294 source_check "${BASEDIR}/${BINUTILS}" 295 source_check "${BASEDIR}/${GCC_CORE}" 296 source_check "${BASEDIR}/${GCC_OBJC}" 297 source_check "${BASEDIR}/${GCC_CPP}" 297 298 298 299 echo ">>> Removing previous content" 299 300 cleanup_dir "${PREFIX}" 300 cleanup_dir "${OBJDIR}" 301 cleanup_dir "${BINUTILSDIR}" 302 cleanup_dir "${GCCDIR}" 301 cleanup_dir "${WORKDIR}" 303 302 304 303 create_dir "${PREFIX}" "destination directory" … … 306 305 307 306 echo ">>> Unpacking tarballs" 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++" 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++" 312 314 313 315 echo ">>> Processing binutils (${PLATFORM})" 314 316 cd "${BINUTILSDIR}" 315 317 check_error $? "Change directory failed." 316 patch_binutils "${PLATFORM}"317 318 318 319 change_title "binutils: configure (${PLATFORM})" … … 336 337 check_error $? "Error compiling/installing GCC." 337 338 338 cd "${ WORKDIR}"339 cd "${BASEDIR}" 339 340 check_error $? "Change directory failed." 340 341 341 342 echo ">>> Cleaning up" 342 cleanup_dir "${OBJDIR}" 343 cleanup_dir "${BINUTILSDIR}" 344 cleanup_dir "${GCCDIR}" 343 cleanup_dir "${WORKDIR}" 345 344 346 345 echo … … 352 351 fi 353 352 354 show_dependencies355 check_dependecies356 show_countdown 10357 358 353 case "$1" in 359 354 "amd64") 355 prepare 360 356 build_target "amd64" "amd64-linux-gnu" 361 357 ;; 362 358 "arm32") 359 prepare 363 360 build_target "arm32" "arm-linux-gnu" 364 361 ;; 365 362 "ia32") 363 prepare 366 364 build_target "ia32" "i686-pc-linux-gnu" 367 365 ;; 368 366 "ia64") 367 prepare 369 368 build_target "ia64" "ia64-pc-linux-gnu" 370 369 ;; 371 "ia64")372 build_target "ia64" "ia64-pc-linux-gnu"373 ;;374 370 "mips32") 371 prepare 375 372 build_target "mips32" "mipsel-linux-gnu" 376 373 ;; 377 374 "mips32eb") 375 prepare 378 376 build_target "mips32eb" "mips-linux-gnu" 379 377 ;; 380 378 "mips64") 379 prepare 381 380 build_target "mips64" "mips64el-linux-gnu" 382 381 ;; 383 382 "ppc32") 383 prepare 384 384 build_target "ppc32" "ppc-linux-gnu" 385 385 ;; 386 386 "ppc64") 387 prepare 387 388 build_target "ppc64" "ppc64-linux-gnu" 388 389 ;; 389 390 "sparc64") 391 prepare 390 392 build_target "sparc64" "sparc64-linux-gnu" 391 393 ;; 392 394 "all") 395 prepare 393 396 build_target "amd64" "amd64-linux-gnu" 394 397 build_target "arm32" "arm-linux-gnu" 395 398 build_target "ia32" "i686-pc-linux-gnu" 396 build_target "ia64" "ia64-pc-linux-gnu"397 399 build_target "ia64" "ia64-pc-linux-gnu" 398 400 build_target "mips32" "mipsel-linux-gnu" … … 403 405 build_target "sparc64" "sparc64-linux-gnu" 404 406 ;; 407 "parallel") 408 prepare 409 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 wait 420 ;; 405 421 *) 406 422 show_usage -
uspace/app/bdsh/cmds/modules/cat/cat.c
rebebd38 r3abfe9a8 164 164 { 165 165 int fd, bytes = 0, count = 0, reads = 0; 166 off64_t total = 0;167 166 char *buff = NULL; 168 167 int i; … … 174 173 return 1; 175 174 } 176 177 total = lseek(fd, 0, SEEK_END);178 lseek(fd, 0, SEEK_SET);179 175 180 176 if (NULL == (buff = (char *) malloc(blen + 1))) { -
uspace/app/sbi/src/run_expr.c
rebebd38 r3abfe9a8 2529 2529 if (rc1 == EOK) 2530 2530 rc2 = os_str_get_char(string->value, elem_index, &cval); 2531 else 2532 rc2 = EOK; 2531 2533 2532 2534 if (rc1 != EOK || rc2 != EOK) { -
uspace/app/tester/fault/fault2.c
rebebd38 r3abfe9a8 29 29 30 30 #include "../tester.h" 31 #include <stdio.h> 31 32 32 33 typedef int __attribute__((may_alias)) aliasing_int; … … 38 39 39 40 var1 = *((aliasing_int *) (((char *) (&var)) + 1)); 41 printf("Read %d\n", var1); 40 42 41 43 return "Survived unaligned read"; -
uspace/app/trace/trace.c
rebebd38 r3abfe9a8 872 872 static display_mask_t parse_display_mask(const char *text) 873 873 { 874 display_mask_t dm ;874 display_mask_t dm = 0; 875 875 const char *c = text; 876 876 -
uspace/lib/c/arch/abs32le/_link.ld.in
rebebd38 r3abfe9a8 11 11 12 12 .text : { 13 *(.text );14 *(.rodata *);13 *(.text .text.*); 14 *(.rodata .rodata.*); 15 15 } :text 16 16 -
uspace/lib/c/arch/amd64/_link.ld.in
rebebd38 r3abfe9a8 16 16 17 17 .text : { 18 *(.text );19 *(.rodata *);18 *(.text .text.*); 19 *(.rodata .rodata.*); 20 20 } :text 21 21 -
uspace/lib/c/arch/arm32/_link.ld.in
rebebd38 r3abfe9a8 15 15 16 16 .text : { 17 *(.text );18 *(.rodata *);17 *(.text .text.*); 18 *(.rodata .rodata.*); 19 19 } :text 20 20 -
uspace/lib/c/arch/ia32/_link.ld.in
rebebd38 r3abfe9a8 16 16 17 17 .text : { 18 *(.text );19 *(.rodata *);18 *(.text .text.*); 19 *(.rodata .rodata.*); 20 20 } :text 21 21 -
uspace/lib/c/arch/ia64/_link.ld.in
rebebd38 r3abfe9a8 15 15 16 16 .text : { 17 *(.text );18 *(.rodata *);17 *(.text .text.*); 18 *(.rodata .rodata.*); 19 19 } :text 20 20 … … 23 23 .got : { 24 24 _gp = .; 25 *(.got *);25 *(.got .got.*); 26 26 } :data 27 27 -
uspace/lib/c/arch/mips32/_link.ld.in
rebebd38 r3abfe9a8 15 15 16 16 .text : { 17 *(.text );18 *(.rodata *);17 *(.text .text.*); 18 *(.rodata .rodata.*); 19 19 } :text 20 20 -
uspace/lib/c/arch/ppc32/_link.ld.in
rebebd38 r3abfe9a8 15 15 16 16 .text : { 17 *(.text );18 *(.rodata *);17 *(.text .text.*); 18 *(.rodata .rodata.*); 19 19 } :text 20 20 -
uspace/lib/c/arch/sparc64/_link.ld.in
rebebd38 r3abfe9a8 15 15 16 16 .text : { 17 *(.text );18 *(.rodata *);17 *(.text .text.*); 18 *(.rodata .rodata.*); 19 19 } :text 20 20 -
uspace/lib/c/generic/vfs/vfs.c
rebebd38 r3abfe9a8 756 756 { 757 757 struct stat stat; 758 int rc; 759 760 rc = fstat(fildes, &stat); 761 758 759 int rc = fstat(fildes, &stat); 760 if (rc != 0) 761 return rc; 762 762 763 if (!stat.device) 763 764 return -1; -
uspace/srv/hw/bus/cuda_adb/cuda_adb.c
rebebd38 r3abfe9a8 367 367 static void cuda_irq_rcv_end(void *buf, size_t *len) 368 368 { 369 uint8_t data,b;370 369 uint8_t b; 370 371 371 b = pio_read_8(&dev->b); 372 data =pio_read_8(&dev->sr);373 372 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
rebebd38 r3abfe9a8 21 21 22 22 .text : { 23 *(.text );24 *(.rodata *);23 *(.text .text.*); 24 *(.rodata .rodata.*); 25 25 } :text 26 26 -
uspace/srv/loader/arch/amd64/_link.ld.in
rebebd38 r3abfe9a8 27 27 28 28 .text : { 29 *(.text );30 *(.rodata *);29 *(.text .text.*); 30 *(.rodata .rodata.*); 31 31 } :text 32 32 -
uspace/srv/loader/arch/arm32/_link.ld.in
rebebd38 r3abfe9a8 25 25 26 26 .text : { 27 *(.text );28 *(.rodata *);27 *(.text .text.*); 28 *(.rodata .rodata.*); 29 29 } :text 30 30 -
uspace/srv/loader/arch/ia32/_link.ld.in
rebebd38 r3abfe9a8 26 26 27 27 .text : { 28 *(.text );29 *(.rodata *);28 *(.text .text.*); 29 *(.rodata .rodata.*); 30 30 } :text 31 31 -
uspace/srv/loader/arch/ia64/_link.ld.in
rebebd38 r3abfe9a8 21 21 22 22 .text : { 23 *(.text );24 *(.rodata *);23 *(.text .text.*); 24 *(.rodata .rodata.*); 25 25 } :text 26 26 … … 29 29 .got : { 30 30 _gp = .; 31 *(.got *);31 *(.got .got.*); 32 32 } :data 33 33 -
uspace/srv/loader/arch/mips32/_link.ld.in
rebebd38 r3abfe9a8 25 25 26 26 .text : { 27 *(.text );28 *(.rodata *);27 *(.text .text.*); 28 *(.rodata .rodata.*); 29 29 } :text 30 30 -
uspace/srv/loader/arch/ppc32/_link.ld.in
rebebd38 r3abfe9a8 25 25 26 26 .text : { 27 *(.text );28 *(.rodata *);27 *(.text .text.*); 28 *(.rodata .rodata.*); 29 29 } :text 30 30 -
uspace/srv/loader/arch/sparc64/_link.ld.in
rebebd38 r3abfe9a8 20 20 21 21 .text : { 22 *(.text );23 *(.rodata *);22 *(.text .text.*); 23 *(.rodata .rodata.*); 24 24 } :text 25 25 -
uspace/srv/loader/main.c
rebebd38 r3abfe9a8 407 407 /* Not reached */ 408 408 default: 409 retval = E NOENT;409 retval = EINVAL; 410 410 break; 411 411 } 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 } 412 413 if (IPC_GET_IMETHOD(call) != IPC_M_PHONE_HUNGUP) 414 async_answer_0(callid, retval); 417 415 } 418 416 }
Note:
See TracChangeset
for help on using the changeset viewer.