- Timestamp:
- 2012-04-12T14:21:46Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bb8f69d
- Parents:
- 751cabc (diff), d11a181 (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. - Location:
- boot
- Files:
-
- 1 added
- 10 edited
-
Makefile.build (modified) (1 diff)
-
arch/arm32/Makefile.inc (modified) (2 diffs)
-
arch/arm32/src/asm.S (modified) (1 diff)
-
arch/arm32/src/eabi.S (added)
-
arch/ia64/src/main.c (modified) (1 diff)
-
genarch/include/division.h (modified) (1 diff)
-
genarch/src/division.c (modified) (5 diffs)
-
generic/include/memstr.h (modified) (1 diff)
-
generic/src/memstr.c (modified) (1 diff)
-
generic/src/str.c (modified) (4 diffs)
-
generic/src/version.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
boot/Makefile.build
r751cabc r85f2064 34 34 OPTIMIZATION = 3 35 35 36 DEFS = -DRELEASE=$(RELEASE) "-D NAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__36 DEFS = -DRELEASE=$(RELEASE) "-DCOPYRIGHT=$(COPYRIGHT)" "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__ 37 37 38 38 GCC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \ -
boot/arch/arm32/Makefile.inc
r751cabc r85f2064 39 39 BITS = 32 40 40 ENDIANESS = LE 41 EXTRA_CFLAGS = -march=armv4 41 42 42 43 RD_SRVS_ESSENTIAL += \ … … 49 50 SOURCES = \ 50 51 arch/$(BARCH)/src/asm.S \ 52 arch/$(BARCH)/src/eabi.S \ 51 53 arch/$(BARCH)/src/main.c \ 52 54 arch/$(BARCH)/src/mm.c \ -
boot/arch/arm32/src/asm.S
r751cabc r85f2064 60 60 # before passing control to the copied code. 61 61 # 62 bxr062 mov pc, r0 -
boot/arch/ia64/src/main.c
r751cabc r85f2064 189 189 printf("\nInflating components ... "); 190 190 191 /* 192 * We will use the next available address for a copy of each component to 193 * make sure that inflate() works with disjunctive memory regions. 194 */ 195 top = ALIGN_UP(top, PAGE_SIZE); 196 191 197 for (i = cnt; i > 0; i--) { 192 198 printf("%s ", components[i - 1].name); 193 199 194 int err = inflate(components[i - 1].start, components[i - 1].size, 200 /* 201 * Copy the component to a location which is guaranteed not to 202 * overlap with the destination for inflate(). 203 */ 204 memmove((void *) top, components[i - 1].start, components[i - 1].size); 205 206 int err = inflate((void *) top, components[i - 1].size, 195 207 dest[i - 1], components[i - 1].inflated); 196 208 -
boot/genarch/include/division.h
r751cabc r85f2064 33 33 #define BOOT_DIVISION_H_ 34 34 35 /* 32bit integer division */36 35 extern int __divsi3(int, int); 37 38 /* 64bit integer division */39 36 extern long long __divdi3(long long, long long); 40 37 41 /* 32bit unsigned integer division */42 38 extern unsigned int __udivsi3(unsigned int, unsigned int); 43 44 /* 64bit unsigned integer division */45 39 extern unsigned long long __udivdi3(unsigned long long, unsigned long long); 46 40 47 /* 32bit remainder of the signed division */48 41 extern int __modsi3(int, int); 49 50 /* 64bit remainder of the signed division */51 42 extern long long __moddi3(long long, long long); 52 43 53 /* 32bit remainder of the unsigned division */54 44 extern unsigned int __umodsi3(unsigned int, unsigned int); 55 56 /* 64bit remainder of the unsigned division */57 45 extern unsigned long long __umoddi3(unsigned long long, unsigned long long); 58 46 47 extern int __divmodsi3(int, int, int *); 48 extern unsigned int __udivmodsi3(unsigned int, unsigned int, unsigned int *); 49 50 extern long long __divmoddi3(long long, long long, long long *); 59 51 extern unsigned long long __udivmoddi3(unsigned long long, unsigned long long, 60 52 unsigned long long *); -
boot/genarch/src/division.c
r751cabc r85f2064 73 73 { 74 74 unsigned long long result; 75 int steps = sizeof(unsigned long long) * 8; 75 int steps = sizeof(unsigned long long) * 8; 76 76 77 77 *remainder = 0; … … 104 104 105 105 /* 32bit integer division */ 106 int __divsi3(int a, int b) 106 int __divsi3(int a, int b) 107 107 { 108 108 unsigned int rem; … … 116 116 117 117 /* 64bit integer division */ 118 long long __divdi3(long long a, long long b) 118 long long __divdi3(long long a, long long b) 119 119 { 120 120 unsigned long long rem; … … 155 155 156 156 /* 64bit remainder of the signed division */ 157 long long __moddi3(long long a, longlong b)157 long long __moddi3(long long a, long long b) 158 158 { 159 159 unsigned long long rem; … … 183 183 } 184 184 185 int __divmodsi3(int a, int b, int *c) 186 { 187 unsigned int rem; 188 int result = (int) divandmod32(ABSVAL(a), ABSVAL(b), &rem); 189 190 if (SGN(a) == SGN(b)) { 191 *c = rem; 192 return result; 193 } 194 195 *c = -rem; 196 return -result; 197 } 198 199 unsigned int __udivmodsi3(unsigned int a, unsigned int b, 200 unsigned int *c) 201 { 202 return divandmod32(a, b, c); 203 } 204 205 long long __divmoddi3(long long a, long long b, long long *c) 206 { 207 unsigned long long rem; 208 long long result = (int) divandmod64(ABSVAL(a), ABSVAL(b), &rem); 209 210 if (SGN(a) == SGN(b)) { 211 *c = rem; 212 return result; 213 } 214 215 *c = -rem; 216 return -result; 217 } 218 185 219 unsigned long long __udivmoddi3(unsigned long long a, unsigned long long b, 186 220 unsigned long long *c) -
boot/generic/include/memstr.h
r751cabc r85f2064 36 36 37 37 extern void *memcpy(void *, const void *, size_t); 38 extern void *memmove(void *, const void *, size_t); 38 39 39 40 #endif -
boot/generic/src/memstr.c
r751cabc r85f2064 51 51 } 52 52 53 /** Move memory block with possible overlapping. 54 * 55 * Copy cnt bytes from src address to dst address. The source 56 * and destination memory areas may overlap. 57 * 58 * @param dst Destination address to copy to. 59 * @param src Source address to copy from. 60 * @param cnt Number of bytes to copy. 61 * 62 * @return Destination address. 63 * 64 */ 65 void *memmove(void *dst, const void *src, size_t cnt) 66 { 67 /* Nothing to do? */ 68 if (src == dst) 69 return dst; 70 71 /* Non-overlapping? */ 72 if ((dst >= src + cnt) || (src >= dst + cnt)) 73 return memcpy(dst, src, cnt); 74 75 uint8_t *dp; 76 const uint8_t *sp; 77 78 /* Which direction? */ 79 if (src > dst) { 80 /* Forwards. */ 81 dp = dst; 82 sp = src; 83 84 while (cnt-- != 0) 85 *dp++ = *sp++; 86 } else { 87 /* Backwards. */ 88 dp = dst + (cnt - 1); 89 sp = src + (cnt - 1); 90 91 while (cnt-- != 0) 92 *dp-- = *sp--; 93 } 94 95 return dst; 96 } 97 53 98 /** @} 54 99 */ -
boot/generic/src/str.c
r751cabc r85f2064 100 100 #include <str.h> 101 101 #include <errno.h> 102 103 /** Check the condition if wchar_t is signed */ 104 #ifdef WCHAR_IS_UNSIGNED 105 #define WCHAR_SIGNED_CHECK(cond) (true) 106 #else 107 #define WCHAR_SIGNED_CHECK(cond) (cond) 108 #endif 102 109 103 110 /** Byte mask consisting of lowest @n bits (out of 8) */ … … 198 205 * code was invalid. 199 206 */ 200 int chr_encode( wchar_t ch, char *str, size_t *offset, size_t size)207 int chr_encode(const wchar_t ch, char *str, size_t *offset, size_t size) 201 208 { 202 209 if (*offset >= size) … … 325 332 bool ascii_check(wchar_t ch) 326 333 { 327 if ( (ch >= 0) && (ch <= 127))334 if (WCHAR_SIGNED_CHECK(ch >= 0) && (ch <= 127)) 328 335 return true; 329 336 … … 338 345 bool chr_check(wchar_t ch) 339 346 { 340 if ( (ch >= 0) && (ch <= 1114111))347 if (WCHAR_SIGNED_CHECK(ch >= 0) && (ch <= 1114111)) 341 348 return true; 342 349 -
boot/generic/src/version.c
r751cabc r85f2064 32 32 33 33 static const char *project = "HelenOS bootloader"; 34 static const char *copyright = "Copyright (c) 2001-2011 HelenOS project";34 static const char *copyright = STRING(COPYRIGHT); 35 35 static const char *release = STRING(RELEASE); 36 36 static const char *name = STRING(NAME);
Note:
See TracChangeset
for help on using the changeset viewer.
