Changeset 15d0046 in mainline for uspace/app
- Timestamp:
- 2014-09-12T13:22:33Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9b20126
- Parents:
- 8db09e4 (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:
-
- 5 added
- 227 deleted
- 20 edited
- 2 moved
-
bdsh/compl.c (modified) (2 diffs)
-
bdsh/exec.c (modified) (3 diffs)
-
binutils/Makefile (deleted)
-
binutils/distclean.sh (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) (7 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/hw/misc/virtchar1.c (modified) (1 diff)
-
trace/syscalls.c (modified) (3 diffs)
-
trace/trace.c (modified) (1 diff)
-
viewer/viewer.c (modified) (1 diff)
-
vlaunch/vlaunch.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/compl.c
r8db09e4 r15d0046 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
r8db09e4 r15d0046 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
r8db09e4 r15d0046 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
r8db09e4 r15d0046 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
r8db09e4 r15d0046 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
r8db09e4 r15d0046 172 172 va_start(ap, path); 173 173 task_id_t id; 174 int rc = task_spawn(&id, path, cnt, ap); 174 task_wait_t wait; 175 int rc = task_spawn(&id, &wait, path, cnt, ap); 175 176 va_end(ap); 176 177 … … 189 190 task_exit_t texit; 190 191 int retval; 191 rc = task_wait( id, &texit, &retval);192 rc = task_wait(&wait, &texit, &retval); 192 193 if (rc != EOK) { 193 194 printf("%s: Error waiting for %s (%s)\n", NAME, path, … … 253 254 254 255 task_id_t id; 255 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); 256 258 if (rc != EOK) { 257 259 printf("%s: Error spawning %s %s (%s)\n", NAME, app, … … 262 264 task_exit_t texit; 263 265 int retval; 264 rc = task_wait( id, &texit, &retval);266 rc = task_wait(&wait, &texit, &retval); 265 267 if ((rc != EOK) || (texit != TASK_EXIT_NORMAL)) { 266 268 printf("%s: Error retrieving retval from %s (%s)\n", NAME, … … 272 274 } 273 275 274 static void getterm(const char *svc, const char *app, bool wmsg) 275 { 276 char term[LOC_NAME_MAXLEN]; 277 snprintf(term, LOC_NAME_MAXLEN, "%s/%s", LOCFS_MOUNT_POINT, svc); 278 279 printf("%s: Spawning %s %s %s\n", NAME, APP_GETTERM, term, app); 280 281 /* Wait for the terminal service to be ready */ 282 service_id_t service_id; 283 int rc = loc_service_get_id(svc, &service_id, IPC_FLAG_BLOCKING); 284 if (rc != EOK) { 285 printf("%s: Error waiting on %s (%s)\n", NAME, term, 286 str_error(rc)); 287 return; 288 } 289 290 if (wmsg) { 291 rc = task_spawnl(NULL, APP_GETTERM, APP_GETTERM, "-w", term, 292 app, NULL); 293 if (rc != EOK) { 294 printf("%s: Error spawning %s -w %s %s (%s)\n", NAME, 295 APP_GETTERM, term, app, str_error(rc)); 296 } 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); 297 287 } else { 298 rc = task_spawnl(NULL, APP_GETTERM, APP_GETTERM, term, app, 299 NULL); 300 if (rc != EOK) { 301 printf("%s: Error spawning %s %s %s (%s)\n", NAME, 302 APP_GETTERM, term, app, str_error(rc)); 303 } 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); 304 296 } 305 297 } … … 339 331 srv_start("/srv/apic"); 340 332 srv_start("/srv/i8259"); 333 srv_start("/srv/icp-ic"); 341 334 srv_start("/srv/obio"); 342 335 srv_start("/srv/cuda_adb"); … … 364 357 gui_start("/app/vlaunch", HID_COMPOSITOR_SERVER); 365 358 gui_start("/app/vterm", HID_COMPOSITOR_SERVER); 366 } else { 367 rc = console(HID_INPUT, HID_OUTPUT); 368 if (rc == EOK) { 369 getterm("term/vc0", "/app/bdsh", true); 370 getterm("term/vc1", "/app/bdsh", false); 371 getterm("term/vc2", "/app/bdsh", false); 372 getterm("term/vc3", "/app/bdsh", false); 373 getterm("term/vc4", "/app/bdsh", false); 374 getterm("term/vc5", "/app/bdsh", false); 375 getterm("term/vc6", "/app/klog", false); 376 } 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); 377 369 } 378 370 -
uspace/app/kio/kio.c
r8db09e4 r15d0046 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
r8db09e4 r15d0046 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
r8db09e4 r15d0046 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
r8db09e4 r15d0046 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
r8db09e4 r15d0046 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
r8db09e4 r15d0046 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
r8db09e4 r15d0046 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
r8db09e4 r15d0046 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
r8db09e4 r15d0046 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
r8db09e4 r15d0046 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
r8db09e4 r15d0046 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/hw/misc/virtchar1.c
r8db09e4 r15d0046 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/trace/syscalls.c
r8db09e4 r15d0046 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
r8db09e4 r15d0046 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/viewer/viewer.c
r8db09e4 r15d0046 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/vlaunch.c
r8db09e4 r15d0046 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();
Note:
See TracChangeset
for help on using the changeset viewer.
