- Timestamp:
- 2011-04-29T19:56:07Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2874547
- Parents:
- 6b40ea7 (diff), afdcc60e (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:
- uspace
- Files:
-
- 3 added
- 39 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/Makefile.common
r6b40ea7 r30c4005 187 187 188 188 $(BINARY): $(LINKER_SCRIPT) $(OBJECTS) $(LIBS) $(BASE_LIBS) 189 $(LD) - N$(LFLAGS) -T $(LINKER_SCRIPT) -M -Map $(BINARY).map -o $(BINARY) $(OBJECTS) $(LIBS) $(BASE_LIBS)189 $(LD) -n $(LFLAGS) -T $(LINKER_SCRIPT) -M -Map $(BINARY).map -o $(BINARY) $(OBJECTS) $(LIBS) $(BASE_LIBS) 190 190 ifeq ($(CONFIG_STRIP_BINARIES),y) 191 191 $(STRIP) $(BINARY) -
uspace/app/klog/klog.c
r6b40ea7 r30c4005 118 118 } 119 119 120 /* 121 * Mode "a" would be definitively much better here, but it is 122 * not well supported by the FAT driver. 123 */ 124 log = fopen(LOG_FNAME, "w"); 120 log = fopen(LOG_FNAME, "a"); 125 121 if (log == NULL) 126 122 printf("%s: Unable to create log file %s (%s)\n", NAME, LOG_FNAME, -
uspace/app/stats/stats.c
r6b40ea7 r30c4005 69 69 size_t i; 70 70 for (i = 0; i < count; i++) { 71 uint64_t resmem, virtmem, ucycles, kcycles; 72 char resmem_suffix, virtmem_suffix, usuffix, ksuffix; 73 74 order_suffix(stats_tasks[i].resmem, &resmem, &resmem_suffix); 75 order_suffix(stats_tasks[i].virtmem, &virtmem, &virtmem_suffix); 71 uint64_t resmem; 72 uint64_t virtmem; 73 uint64_t ucycles; 74 uint64_t kcycles; 75 const char *resmem_suffix; 76 const char *virtmem_suffix; 77 char usuffix; 78 char ksuffix; 79 80 bin_order_suffix(stats_tasks[i].resmem, &resmem, &resmem_suffix, true); 81 bin_order_suffix(stats_tasks[i].virtmem, &virtmem, &virtmem_suffix, true); 76 82 order_suffix(stats_tasks[i].ucycles, &ucycles, &usuffix); 77 83 order_suffix(stats_tasks[i].kcycles, &kcycles, &ksuffix); 78 84 79 printf("%-8" PRIu64 " %7zu % 9" PRIu64 "%c %8" PRIu64 "%c"85 printf("%-8" PRIu64 " %7zu %7" PRIu64 "%s %6" PRIu64 "%s" 80 86 " %8" PRIu64 "%c %8" PRIu64 "%c %s\n", 81 87 stats_tasks[i].task_id, stats_tasks[i].threads, -
uspace/app/tester/Makefile
r6b40ea7 r30c4005 49 49 loop/loop1.c \ 50 50 mm/malloc1.c \ 51 mm/malloc2.c \ 51 52 devs/devman1.c \ 52 53 hw/misc/virtchar1.c \ -
uspace/app/tester/tester.c
r6b40ea7 r30c4005 62 62 #include "loop/loop1.def" 63 63 #include "mm/malloc1.def" 64 #include "mm/malloc2.def" 64 65 #include "hw/serial/serial1.def" 65 66 #include "hw/misc/virtchar1.def" -
uspace/app/tester/tester.h
r6b40ea7 r30c4005 78 78 extern const char *test_loop1(void); 79 79 extern const char *test_malloc1(void); 80 extern const char *test_malloc2(void); 80 81 extern const char *test_serial1(void); 81 82 extern const char *test_virtchar1(void); -
uspace/app/top/screen.c
r6b40ea7 r30c4005 254 254 uint64_t used; 255 255 uint64_t free; 256 c hartotal_suffix;257 c harunavail_suffix;258 c harused_suffix;259 c harfree_suffix;260 261 order_suffix(data->physmem->total, &total, &total_suffix);262 order_suffix(data->physmem->unavail, &unavail, &unavail_suffix);263 order_suffix(data->physmem->used, &used, &used_suffix);264 order_suffix(data->physmem->free, &free, &free_suffix);265 266 printf("memory: %" PRIu64 "% c total, %" PRIu64 "%cunavail, %"267 PRIu64 "% c used, %" PRIu64 "%cfree", total, total_suffix,256 const char *total_suffix; 257 const char *unavail_suffix; 258 const char *used_suffix; 259 const char *free_suffix; 260 261 bin_order_suffix(data->physmem->total, &total, &total_suffix, false); 262 bin_order_suffix(data->physmem->unavail, &unavail, &unavail_suffix, false); 263 bin_order_suffix(data->physmem->used, &used, &used_suffix, false); 264 bin_order_suffix(data->physmem->free, &free, &free_suffix, false); 265 266 printf("memory: %" PRIu64 "%s total, %" PRIu64 "%s unavail, %" 267 PRIu64 "%s used, %" PRIu64 "%s free", total, total_suffix, 268 268 unavail, unavail_suffix, used, used_suffix, free, free_suffix); 269 269 screen_newline(); … … 295 295 296 296 uint64_t resmem; 297 c harresmem_suffix;298 order_suffix(task->resmem, &resmem, &resmem_suffix);297 const char *resmem_suffix; 298 bin_order_suffix(task->resmem, &resmem, &resmem_suffix, true); 299 299 300 300 uint64_t virtmem; 301 c harvirtmem_suffix;302 order_suffix(task->virtmem, &virtmem, &virtmem_suffix);303 304 printf("%-8" PRIu64 " %7zu % 9" PRIu64 "%c",301 const char *virtmem_suffix; 302 bin_order_suffix(task->virtmem, &virtmem, &virtmem_suffix, true); 303 304 printf("%-8" PRIu64 " %7zu %7" PRIu64 "%s ", 305 305 task->task_id, task->threads, resmem, resmem_suffix); 306 306 print_percent(perc->resmem, 2); 307 printf(" % 8" PRIu64 "%c", virtmem, virtmem_suffix);307 printf(" %6" PRIu64 "%s ", virtmem, virtmem_suffix); 308 308 print_percent(perc->virtmem, 2); 309 309 puts(" "); -
uspace/lib/block/libblock.c
r6b40ea7 r30c4005 51 51 #include <macros.h> 52 52 #include <mem.h> 53 #include <malloc.h> 54 #include <stdio.h> 53 55 #include <sys/typefmt.h> 54 56 #include <stacktrace.h> -
uspace/lib/c/Makefile
r6b40ea7 r30c4005 113 113 generic/arg_parse.c \ 114 114 generic/sort.c \ 115 generic/stats.c 115 generic/stats.c \ 116 generic/assert.c \ 116 117 117 118 SOURCES = \ -
uspace/lib/c/arch/ia32/include/config.h
r6b40ea7 r30c4005 36 36 #define LIBC_ia32_CONFIG_H_ 37 37 38 #define PAGE_WIDTH 12 39 #define PAGE_SIZE (1 << PAGE_WIDTH) 38 #define PAGE_WIDTH 12 39 #define PAGE_SIZE (1 << PAGE_WIDTH) 40 41 #define USER_ADDRESS_SPACE_START_ARCH UINT32_C(0x00000000) 42 #define USER_ADDRESS_SPACE_END_ARCH UINT32_C(0x7fffffff) 40 43 41 44 #endif -
uspace/lib/c/arch/ia32/include/ddi.h
r6b40ea7 r30c4005 37 37 #include <libarch/types.h> 38 38 39 #define IO_SPACE_BOUNDARY 39 #define IO_SPACE_BOUNDARY ((void *) (64 * 1024)) 40 40 41 41 static inline uint8_t pio_read_8(ioport8_t *port) -
uspace/lib/c/arch/ia32/include/faddr.h
r6b40ea7 r30c4005 38 38 #include <libarch/types.h> 39 39 40 #define FADDR(fptr) 40 #define FADDR(fptr) ((uintptr_t) (fptr)) 41 41 42 42 #endif -
uspace/lib/c/arch/ia32/include/fibril.h
r6b40ea7 r30c4005 42 42 * panic sooner or later 43 43 */ 44 #define SP_DELTA (12)44 #define SP_DELTA 12 45 45 46 46 #define context_set(c, _pc, stack, size, ptls) \ … … 51 51 (c)->ebp = 0; \ 52 52 } while (0) 53 54 /* We include only registers that must be preserved 53 54 /* 55 * We include only registers that must be preserved 55 56 * during function call 56 57 */ -
uspace/lib/c/arch/ia32/src/stacktrace.c
r6b40ea7 r30c4005 35 35 */ 36 36 37 #include <libarch/config.h> 37 38 #include <sys/types.h> 38 39 #include <bool.h> 39 40 40 #include <stacktrace.h> 41 41 42 #define FRAME_OFFSET_FP_PREV 43 #define FRAME_OFFSET_RA 42 #define FRAME_OFFSET_FP_PREV 0 43 #define FRAME_OFFSET_RA 4 44 44 45 45 bool stacktrace_fp_valid(stacktrace_t *st, uintptr_t fp) 46 46 { 47 47 (void) st; 48 return fp != 0;48 return (fp != 0) && (fp <= USER_ADDRESS_SPACE_END_ARCH); 49 49 } 50 50 -
uspace/lib/c/arch/ia64/_link.ld.in
r6b40ea7 r30c4005 22 22 23 23 .got : { 24 _gp = .; 24 /* Tell the linker where we expect GP to point. */ 25 __gp = .; 25 26 *(.got .got.*); 26 27 } :data -
uspace/lib/c/arch/ia64/src/entry.s
r6b40ea7 r30c4005 39 39 __entry: 40 40 alloc loc0 = ar.pfs, 0, 1, 2, 0 41 movl gp = _ gp41 movl gp = __gp 42 42 43 43 # Pass PCB pointer as the first argument to __main -
uspace/lib/c/arch/ia64/src/thread_entry.s
r6b40ea7 r30c4005 37 37 alloc loc0 = ar.pfs, 0, 1, 1, 0 38 38 39 movl gp = _ gp39 movl gp = __gp 40 40 41 41 # -
uspace/lib/c/generic/async.c
r6b40ea7 r30c4005 102 102 #include <arch/barrier.h> 103 103 #include <bool.h> 104 #include <stdlib.h> 105 #include <malloc.h> 104 106 #include "private/async.h" 105 107 -
uspace/lib/c/generic/async_sess.c
r6b40ea7 r30c4005 105 105 #include <errno.h> 106 106 #include <assert.h> 107 #include <async.h> 107 108 #include "private/async_sess.h" 108 109 -
uspace/lib/c/generic/errno.c
r6b40ea7 r30c4005 36 36 #include <fibril.h> 37 37 38 int _errno; 38 static fibril_local int fibril_errno; 39 40 int *__errno(void) 41 { 42 return &fibril_errno; 43 } 39 44 40 45 /** @} -
uspace/lib/c/generic/fibril_synch.c
r6b40ea7 r30c4005 43 43 #include <stacktrace.h> 44 44 #include <stdlib.h> 45 #include <stdio.h> 45 46 #include "private/async.h" 46 47 -
uspace/lib/c/generic/io/io.c
r6b40ea7 r30c4005 173 173 } 174 174 *flags = (O_APPEND | O_CREAT) | (plus ? O_RDWR : O_WRONLY); 175 break; 175 176 default: 176 177 errno = EINVAL; -
uspace/lib/c/generic/malloc.c
r6b40ea7 r30c4005 44 44 #include <mem.h> 45 45 #include <futex.h> 46 #include <stdlib.h> 46 47 #include <adt/gcdlcm.h> 47 48 #include "private/malloc.h" -
uspace/lib/c/generic/stacktrace.c
r6b40ea7 r30c4005 61 61 stacktrace_prepare(); 62 62 stacktrace_print_fp_pc(stacktrace_fp_get(), stacktrace_pc_get()); 63 63 64 /* 64 65 * Prevent the tail call optimization of the previous call by 65 66 * making it a non-tail call. 66 67 */ 67 (void) stacktrace_fp_get(); 68 69 printf("-- end of stack trace --\n"); 68 70 } 69 71 -
uspace/lib/c/generic/str.c
r6b40ea7 r30c4005 1215 1215 void order_suffix(const uint64_t val, uint64_t *rv, char *suffix) 1216 1216 { 1217 if (val > 10000000000000000000ULL) {1218 *rv = val / 1000000000000000000ULL;1217 if (val > UINT64_C(10000000000000000000)) { 1218 *rv = val / UINT64_C(1000000000000000000); 1219 1219 *suffix = 'Z'; 1220 } else if (val > 1000000000000000000ULL) {1221 *rv = val / 1000000000000000ULL;1220 } else if (val > UINT64_C(1000000000000000000)) { 1221 *rv = val / UINT64_C(1000000000000000); 1222 1222 *suffix = 'E'; 1223 } else if (val > 1000000000000000ULL) {1224 *rv = val / 1000000000000ULL;1223 } else if (val > UINT64_C(1000000000000000)) { 1224 *rv = val / UINT64_C(1000000000000); 1225 1225 *suffix = 'T'; 1226 } else if (val > 1000000000000ULL) {1227 *rv = val / 1000000000ULL;1226 } else if (val > UINT64_C(1000000000000)) { 1227 *rv = val / UINT64_C(1000000000); 1228 1228 *suffix = 'G'; 1229 } else if (val > 1000000000ULL) {1230 *rv = val / 1000000ULL;1229 } else if (val > UINT64_C(1000000000)) { 1230 *rv = val / UINT64_C(1000000); 1231 1231 *suffix = 'M'; 1232 } else if (val > 1000000ULL) {1233 *rv = val / 1000ULL;1232 } else if (val > UINT64_C(1000000)) { 1233 *rv = val / UINT64_C(1000); 1234 1234 *suffix = 'k'; 1235 1235 } else { … … 1239 1239 } 1240 1240 1241 void bin_order_suffix(const uint64_t val, uint64_t *rv, const char **suffix, 1242 bool fixed) 1243 { 1244 if (val > UINT64_C(1152921504606846976)) { 1245 *rv = val / UINT64_C(1125899906842624); 1246 *suffix = "EiB"; 1247 } else if (val > UINT64_C(1125899906842624)) { 1248 *rv = val / UINT64_C(1099511627776); 1249 *suffix = "TiB"; 1250 } else if (val > UINT64_C(1099511627776)) { 1251 *rv = val / UINT64_C(1073741824); 1252 *suffix = "GiB"; 1253 } else if (val > UINT64_C(1073741824)) { 1254 *rv = val / UINT64_C(1048576); 1255 *suffix = "MiB"; 1256 } else if (val > UINT64_C(1048576)) { 1257 *rv = val / UINT64_C(1024); 1258 *suffix = "KiB"; 1259 } else { 1260 *rv = val; 1261 if (fixed) 1262 *suffix = "B "; 1263 else 1264 *suffix = "B"; 1265 } 1266 } 1267 1241 1268 /** @} 1242 1269 */ -
uspace/lib/c/include/assert.h
r6b40ea7 r30c4005 40 40 * 41 41 * If NDEBUG is not set, the assert() macro 42 * evaluates expr and if it is false prints 42 * evaluates expr and if it is false prints 43 43 * error message and terminate program. 44 44 * … … 47 47 */ 48 48 49 #include <stdio.h>50 #include <stdlib.h>51 52 49 #ifndef NDEBUG 53 50 54 51 #define assert(expr) \ 55 52 do { \ 56 if (!(expr)) { \ 57 printf("Assertion failed (%s) at file '%s', " \ 58 "line %d.\n", #expr, __FILE__, __LINE__); \ 59 abort(); \ 60 } \ 53 if (!(expr)) \ 54 assert_abort(#expr, __FILE__, __LINE__); \ 61 55 } while (0) 62 56 … … 67 61 #endif /* NDEBUG */ 68 62 63 extern void assert_abort(const char *, const char *, unsigned int) 64 __attribute__((noreturn)); 65 69 66 #endif 70 67 -
uspace/lib/c/include/errno.h
r6b40ea7 r30c4005 39 39 #include <fibril.h> 40 40 41 #define errno _errno41 #define errno (*(__errno())) 42 42 43 extern int _errno;43 extern int *__errno(void) __attribute__((const)); 44 44 45 45 #define EMFILE (-18) -
uspace/lib/c/include/fibril_synch.h
r6b40ea7 r30c4005 36 36 #define LIBC_FIBRIL_SYNCH_H_ 37 37 38 #include <async.h>39 38 #include <fibril.h> 40 39 #include <adt/list.h> 41 40 #include <libarch/tls.h> 42 41 #include <sys/time.h> 42 #include <bool.h> 43 43 44 44 typedef struct { 45 fibril_owner_info_t oi; /*Keep this the first thing. */45 fibril_owner_info_t oi; /**< Keep this the first thing. */ 46 46 int counter; 47 47 link_t waiters; … … 64 64 65 65 typedef struct { 66 fibril_owner_info_t oi; /*Keep this the first thing. */66 fibril_owner_info_t oi; /**< Keep this the first thing. */ 67 67 unsigned writers; 68 68 unsigned readers; -
uspace/lib/c/include/macros.h
r6b40ea7 r30c4005 39 39 #define max(a, b) ((a) > (b) ? (a) : (b)) 40 40 41 #define SIZE2KB(size) ((size) >> 10) 42 #define SIZE2MB(size) ((size) >> 20) 43 44 #define KB2SIZE(kb) ((kb) << 10) 45 #define MB2SIZE(mb) ((mb) << 20) 41 #define KiB2SIZE(kb) ((kb) << 10) 42 #define MiB2SIZE(mb) ((mb) << 20) 46 43 47 44 #define STRING(arg) STRING_ARG(arg) -
uspace/lib/c/include/str.h
r6b40ea7 r30c4005 89 89 extern int str_size_t(const char *, char **, unsigned int, bool, size_t *); 90 90 91 extern void order_suffix(const uint64_t val, uint64_t *rv, char *suffix); 91 extern void order_suffix(const uint64_t, uint64_t *, char *); 92 extern void bin_order_suffix(const uint64_t, uint64_t *, const char **, bool); 92 93 93 94 /* -
uspace/srv/devman/devman.c
r6b40ea7 r30c4005 39 39 #include <devmap.h> 40 40 #include <str_error.h> 41 #include <stdio.h> 41 42 42 43 #include "devman.h" -
uspace/srv/fs/fat/fat_fat.c
r6b40ea7 r30c4005 47 47 #include <assert.h> 48 48 #include <fibril_synch.h> 49 #include <malloc.h> 49 50 #include <mem.h> 50 51 -
uspace/srv/fs/fat/fat_idx.c
r6b40ea7 r30c4005 44 44 #include <assert.h> 45 45 #include <fibril_synch.h> 46 #include <malloc.h> 46 47 47 48 /** Each instance of this type describes one interval of freed VFS indices. */ -
uspace/srv/fs/fat/fat_ops.c
r6b40ea7 r30c4005 55 55 #include <sys/mman.h> 56 56 #include <align.h> 57 #include <malloc.h> 57 58 58 59 #define FAT_NODE(node) ((node) ? (fat_node_t *) (node)->data : NULL) -
uspace/srv/hw/netif/ne2000/dp8390.c
r6b40ea7 r30c4005 53 53 #include <byteorder.h> 54 54 #include <errno.h> 55 #include <stdio.h> 55 56 #include <libarch/ddi.h> 56 57 #include <net/packet.h> -
uspace/srv/loader/arch/ia64/_link.ld.in
r6b40ea7 r30c4005 28 28 29 29 .got : { 30 _gp = .; 30 /* Tell the linker where we expect GP to point. */ 31 __gp = .; 31 32 *(.got .got.*); 32 33 } :data -
uspace/srv/ns/clonable.c
r6b40ea7 r30c4005 78 78 if (list_empty(&cs_req)) { 79 79 /* There was no pending connection request. */ 80 printf( NAME ": Unexpected clonable server.\n");80 printf("%s: Unexpected clonable server.\n", NAME); 81 81 ipc_answer_0(callid, EBUSY); 82 82 return; -
uspace/srv/ns/service.c
r6b40ea7 r30c4005 35 35 #include <assert.h> 36 36 #include <errno.h> 37 #include <stdio.h> 38 #include <malloc.h> 37 39 #include "service.h" 38 40 #include "ns.h" -
uspace/srv/ns/task.c
r6b40ea7 r30c4005 39 39 #include <stdio.h> 40 40 #include <macros.h> 41 #include <malloc.h> 41 42 #include "task.h" 42 43 #include "ns.h"
Note:
See TracChangeset
for help on using the changeset viewer.