Changeset 8e7c9fe in mainline for uspace/app
- Timestamp:
- 2014-09-12T03:45:25Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c53b58e
- Parents:
- 3eb0c85 (diff), 105d8d6 (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/app
- Files:
-
- 7 added
- 226 deleted
- 30 edited
- 2 moved
-
bdsh/compl.c (modified) (2 diffs)
-
bdsh/exec.c (modified) (3 diffs)
-
binutils/Makefile (deleted)
-
binutils/intrusive.sh (deleted)
-
binutils/toolchain.sh (deleted)
-
blkdump/Makefile (modified) (1 diff)
-
blkdump/blkdump.c (modified) (3 diffs)
-
cc (deleted)
-
ccom (deleted)
-
cpp (deleted)
-
fontviewer/Makefile (added)
-
fontviewer/fontviewer.c (added)
-
getterm/getterm.c (modified) (4 diffs)
-
init/init.c (modified) (10 diffs)
-
kio/kio.c (modified) (7 diffs)
-
logset/main.c (modified) (1 diff)
-
mixerctl/mixerctl.c (modified) (4 diffs)
-
msim/Makefile (deleted)
-
msim/arch_helenos/helenos.h (deleted)
-
msim/arch_helenos/input.c (deleted)
-
msim/arch_helenos/misc.c (deleted)
-
msim/config.h.msim (deleted)
-
nic/Makefile (added)
-
nic/nic.c (added)
-
pcc/DATESTAMP (deleted)
-
pcc/Makefile.in (deleted)
-
pcc/arch/amd64/code.c (deleted)
-
pcc/arch/amd64/local.c (deleted)
-
pcc/arch/amd64/local2.c (deleted)
-
pcc/arch/amd64/macdefs.h (deleted)
-
pcc/arch/amd64/order.c (deleted)
-
pcc/arch/amd64/table.c (deleted)
-
pcc/arch/arm/code.c (deleted)
-
pcc/arch/arm/local.c (deleted)
-
pcc/arch/arm/local2.c (deleted)
-
pcc/arch/arm/macdefs.h (deleted)
-
pcc/arch/arm/order.c (deleted)
-
pcc/arch/arm/table.c (deleted)
-
pcc/arch/arm32 (deleted)
-
pcc/arch/hppa/code.c (deleted)
-
pcc/arch/hppa/local.c (deleted)
-
pcc/arch/hppa/local2.c (deleted)
-
pcc/arch/hppa/macdefs.h (deleted)
-
pcc/arch/hppa/order.c (deleted)
-
pcc/arch/hppa/table.c (deleted)
-
pcc/arch/i386/code.c (deleted)
-
pcc/arch/i386/flocal.c (deleted)
-
pcc/arch/i386/local.c (deleted)
-
pcc/arch/i386/local2.c (deleted)
-
pcc/arch/i386/macdefs.h (deleted)
-
pcc/arch/i386/order.c (deleted)
-
pcc/arch/i386/table.c (deleted)
-
pcc/arch/ia32 (deleted)
-
pcc/arch/m16c/TODO (deleted)
-
pcc/arch/m16c/code.c (deleted)
-
pcc/arch/m16c/local.c (deleted)
-
pcc/arch/m16c/local2.c (deleted)
-
pcc/arch/m16c/macdefs.h (deleted)
-
pcc/arch/m16c/order.c (deleted)
-
pcc/arch/m16c/table.c (deleted)
-
pcc/arch/mips/TODO (deleted)
-
pcc/arch/mips/code.c (deleted)
-
pcc/arch/mips/local.c (deleted)
-
pcc/arch/mips/local2.c (deleted)
-
pcc/arch/mips/macdefs.h (deleted)
-
pcc/arch/mips/order.c (deleted)
-
pcc/arch/mips/table.c (deleted)
-
pcc/arch/mips32 (deleted)
-
pcc/arch/nova/README (deleted)
-
pcc/arch/nova/code.c (deleted)
-
pcc/arch/nova/local.c (deleted)
-
pcc/arch/nova/local2.c (deleted)
-
pcc/arch/nova/macdefs.h (deleted)
-
pcc/arch/nova/order.c (deleted)
-
pcc/arch/nova/table.c (deleted)
-
pcc/arch/pdp10/README (deleted)
-
pcc/arch/pdp10/code.c (deleted)
-
pcc/arch/pdp10/local.c (deleted)
-
pcc/arch/pdp10/local2.c (deleted)
-
pcc/arch/pdp10/macdefs.h (deleted)
-
pcc/arch/pdp10/order.c (deleted)
-
pcc/arch/pdp10/table.c (deleted)
-
pcc/arch/pdp11/code.c (deleted)
-
pcc/arch/pdp11/local.c (deleted)
-
pcc/arch/pdp11/local2.c (deleted)
-
pcc/arch/pdp11/macdefs.h (deleted)
-
pcc/arch/pdp11/order.c (deleted)
-
pcc/arch/pdp11/table.c (deleted)
-
pcc/arch/powerpc/README (deleted)
-
pcc/arch/powerpc/code.c (deleted)
-
pcc/arch/powerpc/local.c (deleted)
-
pcc/arch/powerpc/local2.c (deleted)
-
pcc/arch/powerpc/macdefs.h (deleted)
-
pcc/arch/powerpc/order.c (deleted)
-
pcc/arch/powerpc/table.c (deleted)
-
pcc/arch/ppc32 (deleted)
-
pcc/arch/sparc64/code.c (deleted)
-
pcc/arch/sparc64/local.c (deleted)
-
pcc/arch/sparc64/local2.c (deleted)
-
pcc/arch/sparc64/macdefs.h (deleted)
-
pcc/arch/sparc64/order.c (deleted)
-
pcc/arch/sparc64/table.c (deleted)
-
pcc/arch/vax/code.c (deleted)
-
pcc/arch/vax/local.c (deleted)
-
pcc/arch/vax/local2.c (deleted)
-
pcc/arch/vax/macdefs.h (deleted)
-
pcc/arch/vax/order.c (deleted)
-
pcc/arch/vax/table.c (deleted)
-
pcc/cc/Makefile.in (deleted)
-
pcc/cc/cc/Makefile.in (deleted)
-
pcc/cc/cc/cc.1 (deleted)
-
pcc/cc/cc/cc.c (deleted)
-
pcc/cc/ccom/Makefile.in (deleted)
-
pcc/cc/ccom/arch/amd64/external.c (deleted)
-
pcc/cc/ccom/arch/amd64/external.h (deleted)
-
pcc/cc/ccom/arch/arm32/external.c (deleted)
-
pcc/cc/ccom/arch/arm32/external.h (deleted)
-
pcc/cc/ccom/arch/ia32/external.c (deleted)
-
pcc/cc/ccom/arch/ia32/external.h (deleted)
-
pcc/cc/ccom/arch/mips32/external.c (deleted)
-
pcc/cc/ccom/arch/mips32/external.h (deleted)
-
pcc/cc/ccom/arch/ppc32/external.c (deleted)
-
pcc/cc/ccom/arch/ppc32/external.h (deleted)
-
pcc/cc/ccom/builtins.c (deleted)
-
pcc/cc/ccom/ccom.1 (deleted)
-
pcc/cc/ccom/cgram.y (deleted)
-
pcc/cc/ccom/gcc_compat.c (deleted)
-
pcc/cc/ccom/init.c (deleted)
-
pcc/cc/ccom/inline.c (deleted)
-
pcc/cc/ccom/main.c (deleted)
-
pcc/cc/ccom/optim.c (deleted)
-
pcc/cc/ccom/pass1.h (deleted)
-
pcc/cc/ccom/pftn.c (deleted)
-
pcc/cc/ccom/scan.l (deleted)
-
pcc/cc/ccom/softfloat.c (deleted)
-
pcc/cc/ccom/stabs.c (deleted)
-
pcc/cc/ccom/symtabs.c (deleted)
-
pcc/cc/ccom/trees.c (deleted)
-
pcc/cc/cpp/Makefile.in (deleted)
-
pcc/cc/cpp/config.h (deleted)
-
pcc/cc/cpp/cpp.1 (deleted)
-
pcc/cc/cpp/cpp.c (deleted)
-
pcc/cc/cpp/cpp.h (deleted)
-
pcc/cc/cpp/cpy.y (deleted)
-
pcc/cc/cpp/scanner.l (deleted)
-
pcc/cc/cpp/tests/res1 (deleted)
-
pcc/cc/cpp/tests/res10 (deleted)
-
pcc/cc/cpp/tests/res11 (deleted)
-
pcc/cc/cpp/tests/res12 (deleted)
-
pcc/cc/cpp/tests/res13 (deleted)
-
pcc/cc/cpp/tests/res2 (deleted)
-
pcc/cc/cpp/tests/res3 (deleted)
-
pcc/cc/cpp/tests/res4 (deleted)
-
pcc/cc/cpp/tests/res5 (deleted)
-
pcc/cc/cpp/tests/res6 (deleted)
-
pcc/cc/cpp/tests/res7 (deleted)
-
pcc/cc/cpp/tests/res8 (deleted)
-
pcc/cc/cpp/tests/res9 (deleted)
-
pcc/cc/cpp/tests/test1 (deleted)
-
pcc/cc/cpp/tests/test10 (deleted)
-
pcc/cc/cpp/tests/test11 (deleted)
-
pcc/cc/cpp/tests/test12 (deleted)
-
pcc/cc/cpp/tests/test13 (deleted)
-
pcc/cc/cpp/tests/test2 (deleted)
-
pcc/cc/cpp/tests/test3 (deleted)
-
pcc/cc/cpp/tests/test4 (deleted)
-
pcc/cc/cpp/tests/test5 (deleted)
-
pcc/cc/cpp/tests/test6 (deleted)
-
pcc/cc/cpp/tests/test7 (deleted)
-
pcc/cc/cpp/tests/test8 (deleted)
-
pcc/cc/cpp/tests/test9 (deleted)
-
pcc/cc/cpp/token.c (deleted)
-
pcc/config.guess (deleted)
-
pcc/config.h (deleted)
-
pcc/config.h.in (deleted)
-
pcc/config.sub (deleted)
-
pcc/configure (deleted)
-
pcc/configure.ac (deleted)
-
pcc/f77/Makefile.in (deleted)
-
pcc/f77/f77/Makefile.in (deleted)
-
pcc/f77/f77/f77.1 (deleted)
-
pcc/f77/f77/f77.c (deleted)
-
pcc/f77/fcom/Makefile.in (deleted)
-
pcc/f77/fcom/data.c (deleted)
-
pcc/f77/fcom/defines.h (deleted)
-
pcc/f77/fcom/defs.h (deleted)
-
pcc/f77/fcom/equiv.c (deleted)
-
pcc/f77/fcom/error.c (deleted)
-
pcc/f77/fcom/exec.c (deleted)
-
pcc/f77/fcom/expr.c (deleted)
-
pcc/f77/fcom/ftypes.h (deleted)
-
pcc/f77/fcom/gram.dcl (deleted)
-
pcc/f77/fcom/gram.exec (deleted)
-
pcc/f77/fcom/gram.expr (deleted)
-
pcc/f77/fcom/gram.head (deleted)
-
pcc/f77/fcom/gram.io (deleted)
-
pcc/f77/fcom/init.c (deleted)
-
pcc/f77/fcom/intr.c (deleted)
-
pcc/f77/fcom/io.c (deleted)
-
pcc/f77/fcom/lex.c (deleted)
-
pcc/f77/fcom/main.c (deleted)
-
pcc/f77/fcom/misc.c (deleted)
-
pcc/f77/fcom/proc.c (deleted)
-
pcc/f77/fcom/put.c (deleted)
-
pcc/f77/fcom/putscj.c (deleted)
-
pcc/f77/fcom/scjdefs.h (deleted)
-
pcc/f77/fcom/tokens (deleted)
-
pcc/install-sh (deleted)
-
pcc/mip/common.c (deleted)
-
pcc/mip/compat.c (deleted)
-
pcc/mip/compat.h (deleted)
-
pcc/mip/config.h (deleted)
-
pcc/mip/manifest.h (deleted)
-
pcc/mip/match.c (deleted)
-
pcc/mip/mkext.c (deleted)
-
pcc/mip/node.h (deleted)
-
pcc/mip/optim2.c (deleted)
-
pcc/mip/pass2.h (deleted)
-
pcc/mip/reader.c (deleted)
-
pcc/mip/regs.c (deleted)
-
pcc/os/bsd/ccconfig.h (deleted)
-
pcc/os/darwin/ccconfig.h (deleted)
-
pcc/os/dragonfly/ccconfig.h (deleted)
-
pcc/os/freebsd/ccconfig.h (deleted)
-
pcc/os/helenos/ccconfig.h (deleted)
-
pcc/os/linux/ccconfig.h (deleted)
-
pcc/os/midnightbsd/ccconfig.h (deleted)
-
pcc/os/mirbsd/ccconfig.h (deleted)
-
pcc/os/netbsd/ccconfig.h (deleted)
-
pcc/os/nextstep/ccconfig.h (deleted)
-
pcc/os/none/ccconfig.h (deleted)
-
pcc/os/openbsd/ccconfig.h (deleted)
-
pcc/os/openbsd/f77config.h (deleted)
-
pcc/os/sunos/ccconfig.h (deleted)
-
pcc/os/win32/build.bat (deleted)
-
pcc/os/win32/build_installer.bat (deleted)
-
pcc/os/win32/ccconfig.h (deleted)
-
pcc/os/win32/config.h (deleted)
-
pcc/os/win32/pcc.iss (deleted)
-
redir/redir.c (modified) (3 diffs)
-
sbi/src/os/helenos.c (modified) (2 diffs)
-
taskdump/Makefile (modified) (1 diff)
-
taskdump/fibrildump.c (added)
-
taskdump/include/fibrildump.h (moved) (moved from uspace/lib/c/arch/mips64/include/libarch/faddr.h ) (2 diffs)
-
taskdump/include/symtab.h (modified) (1 diff)
-
taskdump/include/taskdump.h (moved) (moved from uspace/lib/c/arch/mips64/include/libarch/syscall.h ) (3 diffs)
-
taskdump/symtab.c (modified) (1 diff)
-
taskdump/taskdump.c (modified) (6 diffs)
-
tester/Makefile (modified) (3 diffs)
-
tester/float/float2.c (added)
-
tester/float/float2.def (added)
-
tester/float/softfloat1.c (modified) (17 diffs)
-
tester/hw/misc/virtchar1.c (modified) (1 diff)
-
tester/tester.c (modified) (1 diff)
-
tester/tester.h (modified) (1 diff)
-
trace/syscalls.c (modified) (3 diffs)
-
trace/trace.c (modified) (1 diff)
-
vdemo/Makefile (modified) (1 diff)
-
viewer/Makefile (modified) (1 diff)
-
viewer/viewer.c (modified) (1 diff)
-
vlaunch/Makefile (modified) (1 diff)
-
vlaunch/vlaunch.c (modified) (6 diffs)
-
vterm/Makefile (modified) (1 diff)
-
wavplay/dplay.c (modified) (2 diffs)
-
wavplay/drec.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/compl.c
r3eb0c85 r8e7c9fe 209 209 *cstart += rpath_sep + 1 - prefix; 210 210 free(prefix); 211 prefix = NULL; 211 212 212 213 cs->path_list = malloc(sizeof(char *) * 2); … … 252 253 } 253 254 254 if ( cs != NULL && cs->prefix != NULL)255 if ((cs != NULL) && (cs->prefix != NULL)) 255 256 free(cs->prefix); 257 256 258 if (dirname != NULL) 257 259 free(dirname); 260 258 261 if (prefix != NULL) 259 262 free(prefix); 263 260 264 if (stext != NULL) 261 265 free(stext); 266 262 267 if (cs != NULL) 263 268 free(cs); 269 264 270 if (tokens != NULL) 265 271 free(tokens); -
uspace/app/bdsh/exec.c
r3eb0c85 r8e7c9fe 97 97 { 98 98 task_id_t tid; 99 task_wait_t twait; 99 100 task_exit_t texit; 100 101 char *tmp; … … 121 122 file_handles_p[i] = NULL; 122 123 123 rc = task_spawnvf(&tid, tmp, (const char **) argv, file_handles_p);124 rc = task_spawnvf(&tid, &twait, tmp, (const char **) argv, file_handles_p); 124 125 free(tmp); 125 126 … … 130 131 } 131 132 132 rc = task_wait( tid, &texit, &retval);133 rc = task_wait(&twait, &texit, &retval); 133 134 if (rc != EOK) { 134 135 printf("%s: Failed waiting for command (%s)\n", progname, -
uspace/app/blkdump/Makefile
r3eb0c85 r8e7c9fe 30 30 USPACE_PREFIX = ../.. 31 31 LIBS = $(LIBBLOCK_PREFIX)/libblock.a 32 EXTRA_CFLAGS = -I$(LIBBLOCK_PREFIX) 32 EXTRA_CFLAGS = -I$(LIBBLOCK_PREFIX) -I$(LIBSCSI_PREFIX)/include 33 33 BINARY = blkdump 34 34 -
uspace/app/blkdump/blkdump.c
r3eb0c85 r8e7c9fe 44 44 #include <loc.h> 45 45 #include <byteorder.h> 46 #include <scsi/mmc.h> 46 47 #include <sys/types.h> 47 48 #include <sys/typefmt.h> … … 214 215 static int print_toc(void) 215 216 { 216 toc_block_t *toc; 217 218 toc = block_get_toc(service_id, 0); 219 if (toc == NULL) 217 scsi_toc_multisess_data_t toc; 218 int rc; 219 220 rc = block_read_toc(service_id, 0, &toc, sizeof(toc)); 221 if (rc != EOK) 220 222 return 1; 221 223 222 printf("TOC size: %" PRIu16 " bytes\n", toc->size); 223 printf("First session: %" PRIu8 "\n", toc->first_session); 224 printf("Last_session: %" PRIu8 "\n", toc->last_session); 224 printf("Multisession Information:\n"); 225 printf("\tFirst complete session: %" PRIu8 "\n", toc.first_sess); 226 printf("\tLast complete session: %" PRIu8 "\n", toc.last_sess); 227 printf("\tFirst track of last complete session:\n"); 228 printf("\t\tADR / Control: 0x%" PRIx8 "\n", toc.ftrack_lsess.adr_control); 229 printf("\t\tTrack number: %" PRIu8 "\n", toc.ftrack_lsess.track_no); 230 printf("\t\tStart block address: %" PRIu32 "\n", toc.ftrack_lsess.start_addr); 225 231 226 232 return 0; … … 271 277 static void syntax_print(void) 272 278 { 273 printf("syntax: blkdump [--relative] [--offset <num_blocks>] [--count <num_blocks>] <device_name>\n"); 279 printf("syntax: blkdump [--toc] [--relative] [--offset <num_blocks>] " 280 "[--count <num_blocks>] <device_name>\n"); 274 281 } 275 282 -
uspace/app/getterm/getterm.c
r3eb0c85 r8e7c9fe 42 42 #include <str_error.h> 43 43 #include <errno.h> 44 #include <loc.h> 44 45 #include "version.h" 45 46 #include "welcome.h" … … 49 50 static void usage(void) 50 51 { 51 printf("Usage: %s <terminal> [-w] <command> [<arguments...>]\n", APP_NAME); 52 printf("Usage: %s <terminal> <locfs> [--msg] [--wait] -- " 53 "<command> [<arguments...>]\n", APP_NAME); 54 printf(" <terminal> Terminal device\n"); 55 printf(" <locfs> Mount point of locfs\n"); 56 printf(" --msg Print welcome message\n"); 57 printf(" --wait Wait for the terminal to be ready\n"); 52 58 } 53 59 54 static void reopen(FILE **stream, int fd, const char *path, int flags, const char *mode) 60 static void reopen(FILE **stream, int fd, const char *path, int flags, 61 const char *mode) 55 62 { 56 63 if (fclose(*stream)) … … 76 83 int main(int argc, char *argv[]) 77 84 { 78 int rc;79 task_exit_t texit;80 int retval;81 task_id_t id;82 char *fname, *term;83 char **cmd_args;84 bool print_wmsg;85 86 85 argv++; 87 86 argc--; 87 if (argc < 4) { 88 usage(); 89 return 1; 90 } 91 92 char *term = *argv; 93 argv++; 94 argc--; 95 96 char *locfs = *argv; 97 argv++; 98 argc--; 99 100 bool print_msg = false; 101 bool wait = false; 102 103 while ((argc > 0) && (str_cmp(*argv, "--") != 0)) { 104 if (str_cmp(*argv, "--msg") == 0) { 105 print_msg = true; 106 } else if (str_cmp(*argv, "--wait") == 0) { 107 wait = true; 108 } else { 109 usage(); 110 return 2; 111 } 112 113 argv++; 114 argc--; 115 } 116 88 117 if (argc < 1) { 89 118 usage(); 90 return -1;119 return 3; 91 120 } 92 93 if (str_cmp(*argv, "-w") == 0) { 94 print_wmsg = true; 95 argv++; 96 argc--; 97 } else { 98 print_wmsg = false; 121 122 /* Skip "--" */ 123 argv++; 124 argc--; 125 126 char *cmd = *argv; 127 char **args = argv; 128 129 if (wait) { 130 /* Wait for the terminal service to be ready */ 131 service_id_t service_id; 132 int rc = loc_service_get_id(term, &service_id, IPC_FLAG_BLOCKING); 133 if (rc != EOK) { 134 printf("%s: Error waiting on %s (%s)\n", APP_NAME, term, 135 str_error(rc)); 136 return rc; 137 } 99 138 } 100 101 if (argc < 2) {102 usage();103 return -1;104 }105 106 term = *argv++;107 fname = *argv;108 cmd_args = argv;109 139 110 reopen(&stdin, 0, term, O_RDONLY, "r"); 111 reopen(&stdout, 1, term, O_WRONLY, "w"); 112 reopen(&stderr, 2, term, O_WRONLY, "w"); 140 char term_node[LOC_NAME_MAXLEN]; 141 snprintf(term_node, LOC_NAME_MAXLEN, "%s/%s", locfs, term); 142 143 reopen(&stdin, 0, term_node, O_RDONLY, "r"); 144 reopen(&stdout, 1, term_node, O_WRONLY, "w"); 145 reopen(&stderr, 2, term_node, O_WRONLY, "w"); 113 146 114 147 if (stdin == NULL) 115 return -2;148 return 4; 116 149 117 150 if (stdout == NULL) 118 return -3;151 return 5; 119 152 120 153 if (stderr == NULL) 121 return -4;154 return 6; 122 155 123 156 /* … … 128 161 129 162 version_print(term); 130 if (print_ wmsg)163 if (print_msg) 131 164 welcome_msg_print(); 132 133 rc = task_spawnv(&id, fname, (const char * const *) cmd_args); 165 166 task_id_t id; 167 task_wait_t twait; 168 169 int rc = task_spawnv(&id, &twait, cmd, (const char * const *) args); 134 170 if (rc != EOK) { 135 printf("%s: Error spawning %s (%s)\n", APP_NAME, fname,171 printf("%s: Error spawning %s (%s)\n", APP_NAME, cmd, 136 172 str_error(rc)); 137 return -5;173 return rc; 138 174 } 139 140 rc = task_wait(id, &texit, &retval); 175 176 task_exit_t texit; 177 int retval; 178 rc = task_wait(&twait, &texit, &retval); 141 179 if (rc != EOK) { 142 printf("%s: Error waiting for %s (%s)\n", APP_NAME, fname,180 printf("%s: Error waiting for %s (%s)\n", APP_NAME, cmd, 143 181 str_error(rc)); 144 return -6;182 return rc; 145 183 } 146 184 147 185 return 0; 148 186 } -
uspace/app/init/init.c
r3eb0c85 r8e7c9fe 59 59 #define TMPFS_FS_TYPE "tmpfs" 60 60 #define TMPFS_MOUNT_POINT "/tmp" 61 62 #define DATA_FS_TYPE "fat"63 #define DATA_DEVICE "bd/ata1disk0"64 #define DATA_MOUNT_POINT "/data"65 61 66 62 #define SRV_CONSOLE "/srv/console" … … 176 172 va_start(ap, path); 177 173 task_id_t id; 178 int rc = task_spawn(&id, path, cnt, ap); 174 task_wait_t wait; 175 int rc = task_spawn(&id, &wait, path, cnt, ap); 179 176 va_end(ap); 180 177 … … 193 190 task_exit_t texit; 194 191 int retval; 195 rc = task_wait( id, &texit, &retval);192 rc = task_wait(&wait, &texit, &retval); 196 193 if (rc != EOK) { 197 194 printf("%s: Error waiting for %s (%s)\n", NAME, path, … … 257 254 258 255 task_id_t id; 259 int rc = task_spawnl(&id, app, app, winreg, NULL); 256 task_wait_t wait; 257 int rc = task_spawnl(&id, &wait, app, app, winreg, NULL); 260 258 if (rc != EOK) { 261 259 printf("%s: Error spawning %s %s (%s)\n", NAME, app, … … 266 264 task_exit_t texit; 267 265 int retval; 268 rc = task_wait( id, &texit, &retval);266 rc = task_wait(&wait, &texit, &retval); 269 267 if ((rc != EOK) || (texit != TASK_EXIT_NORMAL)) { 270 268 printf("%s: Error retrieving retval from %s (%s)\n", NAME, … … 276 274 } 277 275 278 static void getterm(const char *svc, const char *app, bool wmsg) 279 { 280 char term[LOC_NAME_MAXLEN]; 281 snprintf(term, LOC_NAME_MAXLEN, "%s/%s", LOCFS_MOUNT_POINT, svc); 282 283 printf("%s: Spawning %s %s %s\n", NAME, APP_GETTERM, term, app); 284 285 /* Wait for the terminal service to be ready */ 286 service_id_t service_id; 287 int rc = loc_service_get_id(svc, &service_id, IPC_FLAG_BLOCKING); 288 if (rc != EOK) { 289 printf("%s: Error waiting on %s (%s)\n", NAME, term, 290 str_error(rc)); 291 return; 292 } 293 294 if (wmsg) { 295 rc = task_spawnl(NULL, APP_GETTERM, APP_GETTERM, "-w", term, 296 app, NULL); 297 if (rc != EOK) { 298 printf("%s: Error spawning %s -w %s %s (%s)\n", NAME, 299 APP_GETTERM, term, app, str_error(rc)); 300 } 276 static void getterm(const char *svc, const char *app, bool msg) 277 { 278 if (msg) { 279 printf("%s: Spawning %s %s %s --msg --wait -- %s\n", NAME, 280 APP_GETTERM, svc, LOCFS_MOUNT_POINT, app); 281 282 int rc = task_spawnl(NULL, NULL, APP_GETTERM, APP_GETTERM, svc, 283 LOCFS_MOUNT_POINT, "--msg", "--wait", "--", app, NULL); 284 if (rc != EOK) 285 printf("%s: Error spawning %s %s %s --msg --wait -- %s\n", 286 NAME, APP_GETTERM, svc, LOCFS_MOUNT_POINT, app); 301 287 } else { 302 rc = task_spawnl(NULL, APP_GETTERM, APP_GETTERM, term, app, 303 NULL); 304 if (rc != EOK) { 305 printf("%s: Error spawning %s %s %s (%s)\n", NAME, 306 APP_GETTERM, term, app, str_error(rc)); 307 } 288 printf("%s: Spawning %s %s %s --wait -- %s\n", NAME, 289 APP_GETTERM, svc, LOCFS_MOUNT_POINT, app); 290 291 int rc = task_spawnl(NULL, NULL, APP_GETTERM, APP_GETTERM, svc, 292 LOCFS_MOUNT_POINT, "--wait", "--", app, NULL); 293 if (rc != EOK) 294 printf("%s: Error spawning %s %s %s --wait -- %s\n", 295 NAME, APP_GETTERM, svc, LOCFS_MOUNT_POINT, app); 308 296 } 309 297 } … … 316 304 } 317 305 318 static bool mount_data(void)319 {320 int rc = mount(DATA_FS_TYPE, DATA_MOUNT_POINT, DATA_DEVICE, "wtcache", 0, 0);321 return mount_report("Data filesystem", DATA_MOUNT_POINT, DATA_FS_TYPE,322 DATA_DEVICE, rc);323 }324 325 306 int main(int argc, char *argv[]) 326 307 { … … 350 331 srv_start("/srv/apic"); 351 332 srv_start("/srv/i8259"); 333 srv_start("/srv/icp-ic"); 352 334 srv_start("/srv/obio"); 353 335 srv_start("/srv/cuda_adb"); … … 367 349 srv_start("/srv/remcons"); 368 350 369 /*370 * Start these synchronously so that mount_data() can be371 * non-blocking.372 */373 #ifdef CONFIG_START_BD374 srv_start("/srv/ata_bd");375 #endif376 377 #ifdef CONFIG_MOUNT_DATA378 /* Make sure fat is running. */379 if (str_cmp(STRING(RDFMT), "fat") != 0)380 srv_start("/srv/fat");381 382 mount_data();383 #else384 (void) mount_data;385 #endif386 387 351 srv_start("/srv/input", HID_INPUT); 388 352 srv_start("/srv/output", HID_OUTPUT); … … 393 357 gui_start("/app/vlaunch", HID_COMPOSITOR_SERVER); 394 358 gui_start("/app/vterm", HID_COMPOSITOR_SERVER); 395 } else { 396 rc = console(HID_INPUT, HID_OUTPUT); 397 if (rc == EOK) { 398 getterm("term/vc0", "/app/bdsh", true); 399 getterm("term/vc1", "/app/bdsh", false); 400 getterm("term/vc2", "/app/bdsh", false); 401 getterm("term/vc3", "/app/bdsh", false); 402 getterm("term/vc4", "/app/bdsh", false); 403 getterm("term/vc5", "/app/bdsh", false); 404 getterm("term/vc6", "/app/klog", false); 405 } 359 } 360 361 rc = console(HID_INPUT, HID_OUTPUT); 362 if (rc == EOK) { 363 getterm("term/vc0", "/app/bdsh", true); 364 getterm("term/vc1", "/app/bdsh", false); 365 getterm("term/vc2", "/app/bdsh", false); 366 getterm("term/vc3", "/app/bdsh", false); 367 getterm("term/vc4", "/app/bdsh", false); 368 getterm("term/vc5", "/app/bdsh", false); 406 369 } 407 370 -
uspace/app/kio/kio.c
r3eb0c85 r8e7c9fe 39 39 #include <as.h> 40 40 #include <ddi.h> 41 #include <event.h>42 41 #include <errno.h> 43 42 #include <str_error.h> … … 63 62 64 63 /* Pointer to kio area */ 65 static wchar_t *kio ;64 static wchar_t *kio = (wchar_t *) AS_AREA_ANY; 66 65 static size_t kio_length; 67 66 … … 149 148 * 150 149 */ 151 static void notification_received(ipc_callid_t callid, ipc_call_t *call) 150 static void kio_notification_handler(ipc_callid_t callid, ipc_call_t *call, 151 void *arg) 152 152 { 153 153 /* … … 181 181 producer(kio_stored, kio + offset); 182 182 183 event_unmask(EVENT_KIO);183 async_event_unmask(EVENT_KIO); 184 184 fibril_mutex_unlock(&mtx); 185 185 } … … 214 214 215 215 prodcons_initialize(&pc); 216 async_set_interrupt_received(notification_received); 217 rc = event_subscribe(EVENT_KIO, 0); 216 rc = async_event_subscribe(EVENT_KIO, kio_notification_handler, NULL); 218 217 if (rc != EOK) { 219 218 fprintf(stderr, "%s: Unable to register kio notifications\n", … … 233 232 fprintf(stderr, "%s: Could not create input\n", NAME); 234 233 return ENOMEM; 235 } 234 } 236 235 237 236 fibril_add_ready(fid); 238 event_unmask(EVENT_KIO);237 async_event_unmask(EVENT_KIO); 239 238 kio_update(); 240 239 … … 251 250 free(str); 252 251 } 253 252 254 253 if (rc == ENOENT) 255 rc = EOK; 254 rc = EOK; 256 255 257 256 return EOK; -
uspace/app/logset/main.c
r3eb0c85 r8e7c9fe 33 33 */ 34 34 #include <stdio.h> 35 #include <stdlib.h> 35 36 #include <async.h> 36 37 #include <errno.h> -
uspace/app/mixerctl/mixerctl.c
r3eb0c85 r8e7c9fe 35 35 #include <assert.h> 36 36 #include <errno.h> 37 #include <loc.h> 37 38 #include <str_error.h> 38 39 #include <str.h> 39 #include <devman.h>40 40 #include <audio_mixer_iface.h> 41 41 #include <stdio.h> 42 42 43 #define DEFAULT_ DEVICE "/hw/pci0/00:01.0/sb16/control"43 #define DEFAULT_SERVICE "devices/\\hw\\pci0\\00:01.0\\sb16\\control" 44 44 45 45 /** … … 128 128 int main(int argc, char *argv[]) 129 129 { 130 const char * device = DEFAULT_DEVICE;130 const char *service = DEFAULT_SERVICE; 131 131 void (*command)(async_exch_t *, int, char*[]) = NULL; 132 132 … … 134 134 command = set_level; 135 135 if (argc == 5) 136 device = argv[1];136 service = argv[1]; 137 137 } 138 138 … … 140 140 command = get_level; 141 141 if (argc == 4) 142 device = argv[1];142 service = argv[1]; 143 143 } 144 144 145 145 if ((argc == 2 && command == NULL)) 146 device = argv[1];146 service = argv[1]; 147 147 148 148 149 devman_handle_t mixer_handle;150 int r et = devman_fun_get_handle(device, &mixer_handle, 0);151 if (r et!= EOK) {152 printf("Failed to get device(%s) handle: %s.\n",153 device, str_error(ret));149 service_id_t mixer_sid; 150 int rc = loc_service_get_id(service, &mixer_sid, 0); 151 if (rc != EOK) { 152 printf("Failed to resolve service '%s': %s.\n", 153 service, str_error(rc)); 154 154 return 1; 155 155 } 156 156 157 async_sess_t *session = devman_device_connect(158 EXCHANGE_ATOMIC, mixer_ handle, IPC_FLAG_BLOCKING);157 async_sess_t *session = loc_service_connect( 158 EXCHANGE_ATOMIC, mixer_sid, 0); 159 159 if (!session) { 160 printf("Failed to connect to device.\n");160 printf("Failed connecting mixer service '%s'.\n", service); 161 161 return 1; 162 162 } -
uspace/app/redir/redir.c
r3eb0c85 r8e7c9fe 75 75 } 76 76 77 static task_id_t spawn( int argc, char *argv[])77 static task_id_t spawn(task_wait_t *wait, int argc, char *argv[]) 78 78 { 79 79 const char **args; … … 93 93 args[argc] = NULL; 94 94 95 rc = task_spawnv(&id, argv[0], args);95 rc = task_spawnv(&id, wait, argv[0], args); 96 96 97 97 free(args); … … 152 152 */ 153 153 setvbuf(stdout, NULL, _IOLBF, BUFSIZ); 154 155 task_id_t id = spawn(argc - i, argv + i); 154 155 task_wait_t wait; 156 task_id_t id = spawn(&wait, argc - i, argv + i); 156 157 157 158 if (id != 0) { 158 159 task_exit_t texit; 159 160 int retval; 160 task_wait( id, &texit, &retval);161 task_wait(&wait, &texit, &retval); 161 162 162 163 return retval; -
uspace/app/sbi/src/os/helenos.c
r3eb0c85 r8e7c9fe 250 250 { 251 251 task_id_t tid; 252 task_wait_t twait; 252 253 task_exit_t texit; 253 254 int rc, retval; 254 255 255 rc = task_spawnv(&tid, cmd[0], (char const * const *) cmd);256 rc = task_spawnv(&tid, &twait, cmd[0], (char const * const *) cmd); 256 257 if (rc != EOK) { 257 258 printf("Error: Failed spawning '%s' (%s).\n", cmd[0], … … 261 262 262 263 /* XXX Handle exit status and return value. */ 263 rc = task_wait( tid, &texit, &retval);264 rc = task_wait(&twait, &texit, &retval); 264 265 (void) rc; 265 266 -
uspace/app/taskdump/Makefile
r3eb0c85 r8e7c9fe 33 33 SOURCES = \ 34 34 elf_core.c \ 35 fibrildump.c \ 35 36 taskdump.c \ 36 37 symtab.c -
uspace/app/taskdump/include/fibrildump.h
r3eb0c85 r8e7c9fe 1 1 /* 2 * Copyright (c) 20 05 Ondrej Palkovsky2 * Copyright (c) 2014 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup libcmips6429 /** @addtogroup edit 30 30 * @{ 31 31 */ 32 /** @file 32 /** 33 * @file 33 34 */ 34 35 35 #ifndef LIBC_mips64_FADDR_H_36 #define LIBC_mips64_FADDR_H_36 #ifndef FIBRILDUMP_H 37 #define FIBRILDUMP_H 37 38 38 #include <libarch/types.h> 39 #include <async.h> 40 #include <symtab.h> 39 41 40 #define FADDR(fptr) ((uintptr_t) (fptr)) 42 extern int fibrils_dump(symtab_t *, async_sess_t *sess); 41 43 42 44 #endif -
uspace/app/taskdump/include/symtab.h
r3eb0c85 r8e7c9fe 50 50 extern int symtab_load(const char *file_name, symtab_t **symtab); 51 51 extern void symtab_delete(symtab_t *st); 52 extern int symtab_name_to_addr(symtab_t *st, c har *name, uintptr_t *addr);52 extern int symtab_name_to_addr(symtab_t *st, const char *name, uintptr_t *addr); 53 53 extern int symtab_addr_to_name(symtab_t *symtab, uintptr_t addr, char **name, 54 54 size_t *offs); -
uspace/app/taskdump/include/taskdump.h
r3eb0c85 r8e7c9fe 1 1 /* 2 * Copyright (c) 20 05 Martin Decky2 * Copyright (c) 2014 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup libc29 /** @addtogroup edit 30 30 * @{ 31 31 */ … … 34 34 */ 35 35 36 #ifndef LIBC_mips64_SYSCALL_H_37 #define LIBC_mips64_SYSCALL_H_36 #ifndef TASKDUMP_H 37 #define TASKDUMP_H 38 38 39 # define LIBARCH_SYSCALL_GENERIC39 #include <stdint.h> 40 40 41 #include <syscall.h> 41 extern int td_stacktrace(uintptr_t, uintptr_t); 42 42 43 43 #endif -
uspace/app/taskdump/symtab.c
r3eb0c85 r8e7c9fe 202 202 * @return EOK on success, ENOENT if no such symbol was found. 203 203 */ 204 int symtab_name_to_addr(symtab_t *st, c har *name, uintptr_t *addr)204 int symtab_name_to_addr(symtab_t *st, const char *name, uintptr_t *addr) 205 205 { 206 206 size_t i; -
uspace/app/taskdump/taskdump.c
r3eb0c85 r8e7c9fe 35 35 #include <async.h> 36 36 #include <elf/elf_linux.h> 37 #include <fibrildump.h> 37 38 #include <stdio.h> 38 39 #include <stdlib.h> … … 52 53 #include <elf_core.h> 53 54 #include <stacktrace.h> 55 #include <taskdump.h> 54 56 55 57 #define LINE_BYTES 16 … … 76 78 static istate_t reg_state; 77 79 80 static stacktrace_ops_t td_stacktrace_ops = { 81 .read_uintptr = td_read_uintptr 82 }; 83 78 84 int main(int argc, char *argv[]) 79 85 { … … 106 112 if (rc < 0) 107 113 printf("Failed dumping address space areas.\n"); 114 115 rc = fibrils_dump(app_symtab, sess); 116 if (rc < 0) 117 printf("Failed dumping fibrils.\n"); 108 118 109 119 udebug_end(sess); … … 311 321 } 312 322 323 int td_stacktrace(uintptr_t fp, uintptr_t pc) 324 { 325 uintptr_t nfp; 326 stacktrace_t st; 327 char *sym_pc; 328 int rc; 329 330 st.op_arg = NULL; 331 st.ops = &td_stacktrace_ops; 332 333 while (stacktrace_fp_valid(&st, fp)) { 334 sym_pc = fmt_sym_address(pc); 335 printf(" %p: %s\n", (void *) fp, sym_pc); 336 free(sym_pc); 337 338 rc = stacktrace_ra_get(&st, fp, &pc); 339 if (rc != EOK) 340 return rc; 341 342 rc = stacktrace_fp_prev(&st, fp, &nfp); 343 if (rc != EOK) 344 return rc; 345 346 fp = nfp; 347 } 348 349 return EOK; 350 } 351 313 352 static int thread_dump(uintptr_t thash) 314 353 { 315 354 istate_t istate; 316 uintptr_t pc, fp, nfp; 317 stacktrace_t st; 355 uintptr_t pc, fp; 318 356 char *sym_pc; 319 357 int rc; … … 336 374 free(sym_pc); 337 375 338 st.op_arg = NULL; 339 st.read_uintptr = td_read_uintptr; 340 341 while (stacktrace_fp_valid(&st, fp)) { 342 sym_pc = fmt_sym_address(pc); 343 printf(" %p: %s\n", (void *) fp, sym_pc); 344 free(sym_pc); 345 346 rc = stacktrace_ra_get(&st, fp, &pc); 347 if (rc != EOK) 348 return rc; 349 350 rc = stacktrace_fp_prev(&st, fp, &nfp); 351 if (rc != EOK) 352 return rc; 353 354 fp = nfp; 355 } 376 (void) td_stacktrace(fp, pc); 356 377 357 378 return EOK; -
uspace/app/tester/Makefile
r3eb0c85 r8e7c9fe 29 29 30 30 USPACE_PREFIX = ../.. 31 31 32 LIBS = \ 32 33 $(LIBBLOCK_PREFIX)/libblock.a \ … … 40 41 41 42 BINARY = tester 43 MATH = y 42 44 43 45 SOURCES = \ … … 61 63 fault/fault3.c \ 62 64 float/float1.c \ 65 float/float2.c \ 63 66 float/softfloat1.c \ 64 67 vfs/vfs1.c \ -
uspace/app/tester/float/softfloat1.c
r3eb0c85 r8e7c9fe 39 39 #include "../tester.h" 40 40 41 #define OPERANDS 1041 #define OPERANDS 10 42 42 #define PRECISION 10000 43 43 … … 56 56 cmptype_t *); 57 57 58 #define NUMBERS \58 #define NUMBERS \ 59 59 3.5, -2.1, 100.0, 50.0, -1024.0, 0.0, 768.3156, 1080.499999, -600.0, 1.0 60 60 … … 63 63 }; 64 64 65 static double dop_a[OPERANDS] = {65 static double dop_a[OPERANDS] = { 66 66 NUMBERS 67 67 }; … … 83 83 if (a < b) 84 84 return -1; 85 else if (a > b) 85 86 if (a > b) 86 87 return 1; 87 88 88 89 return 0; 89 90 } 90 91 91 static void 92 uint_to_double_template(void *f, unsigned i, cmptype_t *pic, cmptype_t *pisc) 93 { 92 static void uint_to_double_template(void *f, unsigned i, cmptype_t *pic, 93 cmptype_t *pisc) 94 { 95 uint_to_double_op_t op = (uint_to_double_op_t) f; 96 94 97 double c; 95 98 double_t sc; 96 97 uint_to_double_op_t op = (uint_to_double_op_t) f;98 99 99 op(uop_a[i], &c, &sc); 100 100 101 101 *pic = (cmptype_t) (c * PRECISION); 102 102 *pisc = (cmptype_t) (sc.val * PRECISION); 103 103 } 104 104 105 static void 106 double_to_uint_template(void *f, unsigned i, cmptype_t *pic, cmptype_t *pisc) 107 { 105 static void double_to_uint_template(void *f, unsigned i, cmptype_t *pic, 106 cmptype_t *pisc) 107 { 108 double_to_uint_op_t op = (double_to_uint_op_t) f; 109 108 110 unsigned int c; 109 111 unsigned int sc; 110 111 double_to_uint_op_t op = (double_to_uint_op_t) f;112 113 112 op(dop_a[i], &c, &sc); 114 113 115 114 *pic = (cmptype_t) c; 116 115 *pisc = (cmptype_t) sc; … … 118 117 119 118 120 static void 121 float_template_binary(void *f, unsigned i, unsigned j, cmptype_t *pic, 122 cmptype_t *pisc) 123 { 119 static void float_template_binary(void *f, unsigned i, unsigned j, 120 cmptype_t *pic, cmptype_t *pisc) 121 { 122 float_binary_op_t op = (float_binary_op_t) f; 123 124 124 float c; 125 125 float_t sc; 126 127 float_binary_op_t op = (float_binary_op_t) f;128 129 126 op(fop_a[i], fop_a[j], &c, &sc); 130 127 131 128 *pic = (cmptype_t) (c * PRECISION); 132 129 *pisc = (cmptype_t) (sc.val * PRECISION); 133 130 } 134 131 135 static void 136 double_template_binary(void *f, unsigned i, unsigned j, cmptype_t *pic, 137 cmptype_t *pisc) 138 { 132 static void double_template_binary(void *f, unsigned i, unsigned j, 133 cmptype_t *pic, cmptype_t *pisc) 134 { 135 double_binary_op_t op = (double_binary_op_t) f; 136 139 137 double c; 140 138 double_t sc; 141 142 double_binary_op_t op = (double_binary_op_t) f;143 144 139 op(dop_a[i], dop_a[j], &c, &sc); 145 140 146 141 *pic = (cmptype_t) (c * PRECISION); 147 142 *pisc = (cmptype_t) (sc.val * PRECISION); 148 143 } 149 144 150 static void 151 double_compare_template(void *f, unsigned i, unsigned j, cmptype_t *pis, 152 cmptype_t *piss) 145 static void double_compare_template(void *f, unsigned i, unsigned j, 146 cmptype_t *pis, cmptype_t *piss) 153 147 { 154 148 double_cmp_op_t op = (double_cmp_op_t) f; … … 164 158 cmptype_t ic; 165 159 cmptype_t isc; 166 167 template(f, i, &ic, &isc); 160 161 template(f, i, &ic, &isc); 168 162 cmptype_t diff = cmpabs(ic - isc); 169 163 170 164 if (diff != 0) { 171 165 TPRINTF("i=%u diff=%" PRIdCMPTYPE "\n", i, diff); … … 182 176 183 177 for (unsigned int i = 0; i < OPERANDS; i++) { 184 for (unsigned int j = 0; j < OPERANDS; j++) { 178 for (unsigned int j = 0; j < OPERANDS; j++) { 185 179 cmptype_t ic; 186 180 cmptype_t isc; 187 188 template(f, i, j, &ic, &isc); 181 182 template(f, i, j, &ic, &isc); 189 183 cmptype_t diff = cmpabs(ic - isc); 190 184 … … 206 200 } 207 201 208 static void 209 double_to_uint_operator(double a, unsigned int *pc,unsigned int *psc)210 { 211 double_t sa; 212 213 sa.val = a; 214 202 static void double_to_uint_operator(double a, unsigned int *pc, 203 unsigned int *psc) 204 { 205 double_t sa; 206 207 sa.val = a; 208 215 209 *pc = (unsigned int) a; 216 210 *psc = double_to_uint(sa.data); 217 211 } 218 212 219 static void 220 double_to_int_operator(double a, unsigned int *pc,unsigned int *psc)221 { 222 double_t sa; 223 224 sa.val = a; 225 213 static void double_to_int_operator(double a, unsigned int *pc, 214 unsigned int *psc) 215 { 216 double_t sa; 217 218 sa.val = a; 219 226 220 *pc = (int) a; 227 221 *psc = double_to_int(sa.data); … … 237 231 sa.val = a; 238 232 sb.val = b; 239 if (sa.data.parts.sign == sb.data.parts.sign) 233 234 if (sa.data.parts.sign == sb.data.parts.sign) { 240 235 psc->data = add_float(sa.data, sb.data); 241 else if (sa.data.parts.sign) {236 } else if (sa.data.parts.sign) { 242 237 sa.data.parts.sign = 0; 243 238 psc->data = sub_float(sb.data, sa.data); … … 267 262 return; 268 263 } 269 264 270 265 *pc = a / b; 271 266 … … 287 282 sa.val = a; 288 283 sb.val = b; 289 if (sa.data.parts.sign == sb.data.parts.sign) 284 285 if (sa.data.parts.sign == sb.data.parts.sign) { 290 286 psc->data = add_double(sa.data, sb.data); 291 else if (sa.data.parts.sign) {287 } else if (sa.data.parts.sign) { 292 288 sa.data.parts.sign = 0; 293 289 psc->data = sub_double(sb.data, sa.data); … … 317 313 return; 318 314 } 319 315 320 316 *pc = a / b; 321 317 … … 328 324 } 329 325 330 static void 331 double_cmp_operator(double a, double b, cmptype_t *pis,cmptype_t *piss)326 static void double_cmp_operator(double a, double b, cmptype_t *pis, 327 cmptype_t *piss) 332 328 { 333 329 *pis = dcmp(a, b); 334 330 335 331 double_t sa; 336 332 double_t sb; 337 338 sa.val = a; 339 sb.val = b; 340 333 334 sa.val = a; 335 sb.val = b; 336 341 337 if (is_double_lt(sa.data, sb.data)) 342 338 *piss = -1; … … 352 348 { 353 349 const char *err = NULL; 354 350 355 351 if (!test_template_binary(float_template_binary, float_add_operator)) { 356 352 err = "Float addition failed"; 357 353 TPRINTF("%s\n", err); 358 354 } 355 359 356 if (!test_template_binary(float_template_binary, float_mul_operator)) { 360 357 err = "Float multiplication failed"; 361 358 TPRINTF("%s\n", err); 362 359 } 360 363 361 if (!test_template_binary(float_template_binary, float_div_operator)) { 364 362 err = "Float division failed"; 365 363 TPRINTF("%s\n", err); 366 364 } 365 367 366 if (!test_template_binary(double_template_binary, double_add_operator)) { 368 367 err = "Double addition failed"; 369 368 TPRINTF("%s\n", err); 370 369 } 370 371 371 if (!test_template_binary(double_template_binary, double_mul_operator)) { 372 372 err = "Double multiplication failed"; 373 373 TPRINTF("%s\n", err); 374 374 } 375 375 376 if (!test_template_binary(double_template_binary, double_div_operator)) { 376 377 err = "Double division failed"; 377 378 TPRINTF("%s\n", err); 378 379 } 380 379 381 if (!test_template_binary(double_compare_template, double_cmp_operator)) { 380 382 err = "Double comparison failed"; 381 383 TPRINTF("%s\n", err); 382 384 } 385 383 386 if (!test_template_unary(uint_to_double_template, 384 387 uint_to_double_operator)) { … … 386 389 TPRINTF("%s\n", err); 387 390 } 391 388 392 if (!test_template_unary(double_to_uint_template, 389 393 double_to_uint_operator)) { … … 391 395 TPRINTF("%s\n", err); 392 396 } 397 393 398 if (!test_template_unary(double_to_uint_template, 394 399 double_to_int_operator)) { … … 399 404 return err; 400 405 } 401 -
uspace/app/tester/hw/misc/virtchar1.c
r3eb0c85 r8e7c9fe 40 40 #include <sys/types.h> 41 41 #include <async.h> 42 #include <unistd.h> 42 43 #include <char_dev_iface.h> 43 44 #include <str.h> -
uspace/app/tester/tester.c
r3eb0c85 r8e7c9fe 64 64 #include "fault/fault3.def" 65 65 #include "float/float1.def" 66 #include "float/float2.def" 66 67 #include "float/softfloat1.def" 67 68 #include "vfs/vfs1.def" -
uspace/app/tester/tester.h
r3eb0c85 r8e7c9fe 97 97 extern const char *test_fault3(void); 98 98 extern const char *test_float1(void); 99 extern const char *test_float2(void); 99 100 extern const char *test_softfloat1(void); 100 101 extern const char *test_vfs1(void); -
uspace/app/trace/syscalls.c
r3eb0c85 r8e7c9fe 65 65 [SYS_IPC_HANGUP] = { "ipc_hangup", 1, V_ERRNO }, 66 66 67 [SYS_EVENT_SUBSCRIBE] = { "event_subscribe", 2, V_ERRNO }, 67 [SYS_IPC_EVENT_SUBSCRIBE] = { "ipc_event_subscribe", 2, V_ERRNO }, 68 [SYS_IPC_EVENT_UNSUBSCRIBE] = { "ipc_event_unsubscribe", 1, V_ERRNO }, 69 [SYS_IPC_EVENT_UNMASK] = { "ipc_event_unmask", 1, V_ERRNO }, 68 70 69 71 [SYS_CAP_GRANT] = { "cap_grant", 2, V_ERRNO }, … … 71 73 [SYS_PHYSMEM_MAP] = { "physmem_map", 4, V_ERRNO }, 72 74 [SYS_IOSPACE_ENABLE] = { "iospace_enable", 1, V_ERRNO }, 73 [SYS_IRQ_REGISTER] = { "irq_register", 4, V_ERRNO }, 74 [SYS_IRQ_UNREGISTER] = { "irq_unregister", 2, V_ERRNO }, 75 76 [SYS_IPC_IRQ_SUBSCRIBE] = { "ipc_irq_subscribe", 4, V_ERRNO }, 77 [SYS_IPC_IRQ_UNSUBSCRIBE] = { "ipc_irq_unsubscribe", 2, V_ERRNO }, 75 78 76 79 [SYS_SYSINFO_GET_VAL_TYPE] = { "sysinfo_get_val_type", 2, V_INTEGER }, … … 79 82 [SYS_SYSINFO_GET_DATA] = { "sysinfo_get_data", 5, V_ERRNO }, 80 83 81 [SYS_DEBUG_ ACTIVATE_CONSOLE] = { "debug_activate_console", 0, V_ERRNO },84 [SYS_DEBUG_CONSOLE] = { "debug_console", 0, V_ERRNO }, 82 85 [SYS_IPC_CONNECT_KBOX] = { "ipc_connect_kbox", 1, V_ERRNO } 83 86 }; -
uspace/app/trace/trace.c
r3eb0c85 r8e7c9fe 876 876 printf("Waiting for task to exit.\n"); 877 877 878 rc = task_wait (task_id, &texit, &retval);878 rc = task_wait_task_id(task_id, &texit, &retval); 879 879 if (rc != EOK) { 880 880 printf("Failed waiting for task.\n"); -
uspace/app/vdemo/Makefile
r3eb0c85 r8e7c9fe 28 28 29 29 USPACE_PREFIX = ../.. 30 LIBS = $(LIBGUI_PREFIX)/libgui.a $(LIBDRAW_PREFIX)/libdraw.a \ 31 $(LIBSOFTREND_PREFIX)/libsoftrend.a $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a 32 EXTRA_CFLAGS += -I$(LIBGUI_PREFIX) -I$(LIBDRAW_PREFIX) \ 30 31 LIBS = \ 32 $(LIBGUI_PREFIX)/libgui.a \ 33 $(LIBDRAW_PREFIX)/libdraw.a \ 34 $(LIBSOFTREND_PREFIX)/libsoftrend.a \ 35 $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a 36 37 EXTRA_CFLAGS += \ 38 -I$(LIBGUI_PREFIX) \ 39 -I$(LIBDRAW_PREFIX) \ 33 40 -I$(LIBSOFTREND_PREFIX) 41 34 42 BINARY = vdemo 43 MATH = y 35 44 36 45 SOURCES = \ -
uspace/app/viewer/Makefile
r3eb0c85 r8e7c9fe 28 28 29 29 USPACE_PREFIX = ../.. 30 LIBS = $(LIBGUI_PREFIX)/libgui.a $(LIBDRAW_PREFIX)/libdraw.a \ 31 $(LIBSOFTREND_PREFIX)/libsoftrend.a $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a 32 EXTRA_CFLAGS += -I$(LIBGUI_PREFIX) -I$(LIBDRAW_PREFIX) \ 30 31 LIBS = \ 32 $(LIBGUI_PREFIX)/libgui.a \ 33 $(LIBDRAW_PREFIX)/libdraw.a \ 34 $(LIBSOFTREND_PREFIX)/libsoftrend.a \ 35 $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a 36 37 EXTRA_CFLAGS += \ 38 -I$(LIBGUI_PREFIX) \ 39 -I$(LIBDRAW_PREFIX) \ 33 40 -I$(LIBSOFTREND_PREFIX) 41 34 42 BINARY = viewer 43 MATH = y 35 44 36 45 SOURCES = \ -
uspace/app/viewer/viewer.c
r3eb0c85 r8e7c9fe 44 44 #include <surface.h> 45 45 #include <codec/tga.h> 46 #include <task.h> 46 47 47 48 #define NAME "viewer" -
uspace/app/vlaunch/Makefile
r3eb0c85 r8e7c9fe 28 28 29 29 USPACE_PREFIX = ../.. 30 LIBS = $(LIBGUI_PREFIX)/libgui.a $(LIBDRAW_PREFIX)/libdraw.a \ 31 $(LIBSOFTREND_PREFIX)/libsoftrend.a $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a 32 EXTRA_CFLAGS += -I$(LIBGUI_PREFIX) -I$(LIBDRAW_PREFIX) \ 30 31 LIBS = \ 32 $(LIBGUI_PREFIX)/libgui.a \ 33 $(LIBDRAW_PREFIX)/libdraw.a \ 34 $(LIBSOFTREND_PREFIX)/libsoftrend.a \ 35 $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a 36 37 EXTRA_CFLAGS += \ 38 -I$(LIBGUI_PREFIX) \ 39 -I$(LIBDRAW_PREFIX) \ 33 40 -I$(LIBSOFTREND_PREFIX) 41 34 42 BINARY = vlaunch 43 MATH = y 35 44 36 45 SOURCES = \ -
uspace/app/vlaunch/vlaunch.c
r3eb0c85 r8e7c9fe 41 41 #include <str.h> 42 42 #include <str_error.h> 43 #include <loc.h> 44 #include <fibril_synch.h> 45 #include <io/pixel.h> 46 #include <device/led_dev.h> 43 47 44 48 #include <window.h> … … 60 64 #define LOGO_HEIGHT 66 61 65 66 #define PERIOD 1000000 67 #define COLORS 7 68 62 69 static char *winreg = NULL; 70 static fibril_timer_t *timer = NULL; 71 static list_t led_devs; 72 73 static pixel_t colors[COLORS] = { 74 PIXEL(0xff, 0xff, 0x00, 0x00), 75 PIXEL(0xff, 0x00, 0xff, 0x00), 76 PIXEL(0xff, 0x00, 0x00, 0xff), 77 PIXEL(0xff, 0xff, 0xff, 0x00), 78 PIXEL(0xff, 0xff, 0x00, 0xff), 79 PIXEL(0xff, 0x00, 0xff, 0xff), 80 PIXEL(0xff, 0xff, 0xff, 0xff) 81 }; 82 83 static unsigned int color = 0; 84 85 typedef struct { 86 link_t link; 87 service_id_t svc_id; 88 async_sess_t *sess; 89 } led_dev_t; 63 90 64 91 static int app_launch(const char *app) 65 92 { 66 int rc;67 93 printf("%s: Spawning %s %s \n", NAME, app, winreg); 68 94 69 95 task_id_t id; 70 task_exit_t texit; 71 int retval; 72 rc = task_spawnl(&id, app, app, winreg, NULL); 96 task_wait_t wait; 97 int rc = task_spawnl(&id, &wait, app, app, winreg, NULL); 73 98 if (rc != EOK) { 74 99 printf("%s: Error spawning %s %s (%s)\n", NAME, app, … … 76 101 return -1; 77 102 } 78 rc = task_wait(id, &texit, &retval); 79 if (rc != EOK || texit != TASK_EXIT_NORMAL) { 103 104 task_exit_t texit; 105 int retval; 106 rc = task_wait(&wait, &texit, &retval); 107 if ((rc != EOK) || (texit != TASK_EXIT_NORMAL)) { 80 108 printf("%s: Error retrieving retval from %s (%s)\n", NAME, 81 109 app, str_error(rc)); 82 110 return -1; 83 111 } 84 112 85 113 return retval; 86 114 } … … 99 127 { 100 128 app_launch("/app/vlaunch"); 129 } 130 131 static void timer_callback(void *data) 132 { 133 pixel_t next_color = colors[color]; 134 135 color++; 136 if (color >= COLORS) 137 color = 0; 138 139 list_foreach(led_devs, link, led_dev_t, dev) { 140 if (dev->sess) 141 led_dev_color_set(dev->sess, next_color); 142 } 143 144 fibril_timer_set(timer, PERIOD, timer_callback, NULL); 145 } 146 147 static void loc_callback(void) 148 { 149 category_id_t led_cat; 150 int rc = loc_category_get_id("led", &led_cat, IPC_FLAG_BLOCKING); 151 if (rc != EOK) 152 return; 153 154 service_id_t *svcs; 155 size_t count; 156 rc = loc_category_get_svcs(led_cat, &svcs, &count); 157 if (rc != EOK) 158 return; 159 160 for (size_t i = 0; i < count; i++) { 161 bool known = false; 162 163 /* Determine whether we already know this device. */ 164 list_foreach(led_devs, link, led_dev_t, dev) { 165 if (dev->svc_id == svcs[i]) { 166 known = true; 167 break; 168 } 169 } 170 171 if (!known) { 172 led_dev_t *dev = (led_dev_t *) calloc(1, sizeof(led_dev_t)); 173 if (!dev) 174 continue; 175 176 link_initialize(&dev->link); 177 dev->svc_id = svcs[i]; 178 dev->sess = loc_service_connect(EXCHANGE_SERIALIZE, svcs[i], 0); 179 180 list_append(&dev->link, &led_devs); 181 } 182 } 183 184 // FIXME: Handle LED device removal 185 186 free(svcs); 101 187 } 102 188 … … 105 191 if (argc < 2) { 106 192 printf("Compositor server not specified.\n"); 193 return 1; 194 } 195 196 list_initialize(&led_devs); 197 int rc = loc_register_cat_change_cb(loc_callback); 198 if (rc != EOK) { 199 printf("Unable to register callback for device discovery.\n"); 200 return 1; 201 } 202 203 timer = fibril_timer_create(NULL); 204 if (!timer) { 205 printf("Unable to create timer.\n"); 107 206 return 1; 108 207 } … … 163 262 window_exec(main_window); 164 263 264 fibril_timer_set(timer, PERIOD, timer_callback, NULL); 265 165 266 task_retval(0); 166 267 async_manager(); -
uspace/app/vterm/Makefile
r3eb0c85 r8e7c9fe 28 28 29 29 USPACE_PREFIX = ../.. 30 LIBS = $(LIBGUI_PREFIX)/libgui.a $(LIBDRAW_PREFIX)/libdraw.a \ 31 $(LIBSOFTREND_PREFIX)/libsoftrend.a $(LIBGRAPH_PREFIX)/libgraph.a \ 30 31 LIBS = \ 32 $(LIBGUI_PREFIX)/libgui.a \ 33 $(LIBDRAW_PREFIX)/libdraw.a \ 34 $(LIBSOFTREND_PREFIX)/libsoftrend.a \ 35 $(LIBGRAPH_PREFIX)/libgraph.a \ 32 36 $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a 33 EXTRA_CFLAGS += -I$(LIBGUI_PREFIX) -I$(LIBDRAW_PREFIX) \ 34 -I$(LIBSOFTREND_PREFIX) -I$(LIBGRAPH_PREFIX) 37 38 EXTRA_CFLAGS += \ 39 -I$(LIBGUI_PREFIX) \ 40 -I$(LIBDRAW_PREFIX) \ 41 -I$(LIBSOFTREND_PREFIX) \ 42 -I$(LIBGRAPH_PREFIX) 43 35 44 BINARY = vterm 45 MATH = y 36 46 37 47 SOURCES = \ -
uspace/app/wavplay/dplay.c
r3eb0c85 r8e7c9fe 41 41 #include <fibril_synch.h> 42 42 #include <pcm/format.h> 43 #include < sys/mman.h>43 #include <as.h> 44 44 #include <sys/time.h> 45 45 #include <inttypes.h> … … 397 397 cleanup: 398 398 fclose(pb.source); 399 munmap(pb.buffer.base, pb.buffer.size);399 as_area_destroy(pb.buffer.base); 400 400 audio_pcm_release_buffer(pb.device); 401 401 close_session: -
uspace/app/wavplay/drec.c
r3eb0c85 r8e7c9fe 40 40 #include <pcm/format.h> 41 41 #include <stdio.h> 42 #include < sys/mman.h>42 #include <as.h> 43 43 #include <inttypes.h> 44 44 … … 229 229 cleanup: 230 230 fclose(rec.file); 231 munmap(rec.buffer.base, rec.buffer.size);231 as_area_destroy(rec.buffer.base); 232 232 audio_pcm_release_buffer(rec.device); 233 233 close_session:
Note:
See TracChangeset
for help on using the changeset viewer.
