Changeset 80cd7cd in mainline for uspace/app
- Timestamp:
- 2011-01-13T20:58:24Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 87e373b
- Parents:
- eaef141 (diff), a613fea1 (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:
-
- 3 added
- 6 edited
- 3 moved
-
init/init.c (modified) (2 diffs)
-
kill/Makefile (added)
-
kill/kill.c (moved) (moved from uspace/srv/net/il/arp/arp_module.h ) (2 diffs)
-
killall/Makefile (moved) (moved from uspace/srv/net/cfg/Makefile ) (1 diff)
-
killall/killall.c (moved) (moved from uspace/srv/net/nil/eth/eth_module.c ) (2 diffs)
-
netecho/netecho.c (modified) (1 diff)
-
taskdump/taskdump.c (modified) (1 diff)
-
tester/hw/misc/virtchar1.c (modified) (2 diffs)
-
tester/hw/serial/serial1.c (modified) (4 diffs)
-
trace/syscalls.c (modified) (1 diff)
-
websrv/Makefile (added)
-
websrv/websrv.c (added)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/init/init.c
reaef141 r80cd7cd 61 61 62 62 #define DATA_FS_TYPE "fat" 63 #define DATA_DEVICE "bd/ disk0"63 #define DATA_DEVICE "bd/ata1disk0" 64 64 #define DATA_MOUNT_POINT "/data" 65 65 … … 273 273 mount_tmpfs(); 274 274 275 spawn("/srv/apic"); 276 spawn("/srv/i8259"); 275 277 spawn("/srv/fhc"); 276 278 spawn("/srv/obio"); -
uspace/app/kill/kill.c
reaef141 r80cd7cd 1 1 /* 2 * Copyright (c) 20 09 Lukas Mejdrech2 * Copyright (c) 2010 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup arp29 /** @addtogroup kill 30 30 * @{ 31 31 */ 32 33 /** @file 34 * ARP module functions. 35 * The functions are used as ARP module entry points. 32 /** 33 * @file Forcefully terminate a task. 36 34 */ 37 35 38 #ifndef NET_ARP_MODULE_H_ 39 #define NET_ARP_MODULE_H_ 36 #include <errno.h> 37 #include <stdio.h> 38 #include <task.h> 39 #include <str_error.h> 40 40 41 #include <ipc/ipc.h> 42 #include <async.h> 41 #define NAME "kill" 43 42 44 extern int arp_initialize(async_client_conn_t); 45 extern int arp_message_standalone(ipc_callid_t, ipc_call_t *, ipc_call_t *, 46 int *); 43 static void print_syntax(void) 44 { 45 printf("Syntax: " NAME " <task ID>\n"); 46 } 47 47 48 #endif 48 int main(int argc, char *argv[]) 49 { 50 char *eptr; 51 task_id_t taskid; 52 int rc; 53 54 if (argc != 2) { 55 print_syntax(); 56 return 1; 57 } 58 59 taskid = strtoul(argv[1], &eptr, 0); 60 if (*eptr != '\0') { 61 printf("Invalid task ID argument '%s'.\n", argv[1]); 62 return 2; 63 } 64 65 rc = task_kill(taskid); 66 if (rc != EOK) { 67 printf("Failed to kill task ID %" PRIu64 ": %s\n", 68 taskid, str_error(rc)); 69 return 3; 70 } 71 72 return 0; 73 } 49 74 50 75 /** @} -
uspace/app/killall/Makefile
reaef141 r80cd7cd 27 27 # 28 28 29 USPACE_PREFIX = ../../.. 30 ROOT_PATH = $(USPACE_PREFIX)/.. 29 USPACE_PREFIX = ../.. 30 LIBS = 31 EXTRA_CFLAGS = 32 BINARY = killall 31 33 32 COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common 33 CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config 34 SOURCES = \ 35 killall.c 34 36 35 -include $(COMMON_MAKEFILE) 36 -include $(CONFIG_MAKEFILE) 37 38 LO_SOURCE = lo.netif_standalone 39 NE2K_SOURCE = ne2k.netif_standalone 40 41 LO_TARGET = lo 42 NE2K_TARGET = ne2k 43 44 .PHONY: all clean 45 46 all: $(LO_TARGET) $(NE2K_TARGET) 47 48 clean: 49 rm -f $(LO_TARGET) $(NE2K_TARGET) 50 51 $(LO_TARGET): $(LO_SOURCE) 52 cp $< $@ 53 54 $(NE2K_TARGET): $(NE2K_SOURCE) 55 cp $< $@ 37 include $(USPACE_PREFIX)/Makefile.common -
uspace/app/killall/killall.c
reaef141 r80cd7cd 1 1 /* 2 * Copyright (c) 20 09 Lukas Mejdrech2 * Copyright (c) 2010 Martin Decky 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup eth29 /** @addtogroup killall 30 30 * @{ 31 31 */ 32 33 /** @file 34 * Ethernet module stub. 35 * @see module.c 32 /** 33 * @file Forcefully terminate a task specified by name. 36 34 */ 37 35 38 #include "eth.h" 36 #include <errno.h> 37 #include <stdio.h> 38 #include <task.h> 39 #include <stats.h> 40 #include <str_error.h> 41 #include <malloc.h> 39 42 40 #include <async.h> 41 #include <stdio.h> 42 #include <errno.h> 43 #define NAME "killall" 43 44 44 #include <ipc/ipc.h> 45 #include <ipc/services.h> 46 47 #include <net/modules.h> 48 #include <net_interface.h> 49 #include <net/packet.h> 50 #include <nil_local.h> 51 52 int nil_module_start_standalone(async_client_conn_t client_connection) 45 static void print_syntax(void) 53 46 { 54 sysarg_t phonehash; 55 int rc; 56 57 async_set_client_connection(client_connection); 58 int net_phone = net_connect_module(); 59 60 rc = pm_init(); 61 if (rc != EOK) 62 return rc; 63 64 rc = nil_initialize(net_phone); 65 if (rc != EOK) 66 goto out; 67 68 rc = ipc_connect_to_me(PHONE_NS, SERVICE_ETHERNET, 0, 0, &phonehash); 69 if (rc != EOK) 70 goto out; 71 72 async_manager(); 73 74 out: 75 pm_destroy(); 76 return rc; 47 printf("Syntax: " NAME " <task name>\n"); 77 48 } 78 49 79 int nil_module_message_standalone(const char *name, ipc_callid_t callid, 80 ipc_call_t *call, ipc_call_t *answer, int *answer_count) 50 int main(int argc, char *argv[]) 81 51 { 82 return nil_message_standalone(name, callid, call, answer, answer_count); 52 if (argc != 2) { 53 print_syntax(); 54 return 1; 55 } 56 57 size_t count; 58 stats_task_t *stats_tasks = stats_get_tasks(&count); 59 60 if (stats_tasks == NULL) { 61 fprintf(stderr, "%s: Unable to get tasks\n", NAME); 62 return 2; 63 } 64 65 size_t i; 66 for (i = 0; i < count; i++) { 67 if (str_cmp(stats_tasks[i].name, argv[1]) == 0) { 68 task_id_t taskid = stats_tasks[i].task_id; 69 int rc = task_kill(taskid); 70 if (rc != EOK) 71 printf("Failed to kill task ID %" PRIu64 ": %s\n", 72 taskid, str_error(rc)); 73 else 74 printf("Killed task ID %" PRIu64 "\n", taskid); 75 } 76 } 77 78 free(stats_tasks); 79 80 return 0; 83 81 } 84 82 -
uspace/app/netecho/netecho.c
reaef141 r80cd7cd 180 180 } else if (str_lcmp(argv[*index] + 2, "help", 5) == 0) { 181 181 echo_print_help(); 182 return EOK;182 exit(0); 183 183 } else if (str_lcmp(argv[*index] + 2, "port=", 5) == 0) { 184 184 rc = arg_parse_int(argc, argv, index, &value, 7); -
uspace/app/taskdump/taskdump.c
reaef141 r80cd7cd 326 326 327 327 sym_pc = fmt_sym_address(pc); 328 printf("Thread %p crashed at%s. FP = %p\n", (void *) thash,328 printf("Thread %p: PC = %s. FP = %p\n", (void *) thash, 329 329 sym_pc, (void *) fp); 330 330 free(sym_pc); -
uspace/app/tester/hw/misc/virtchar1.c
reaef141 r80cd7cd 40 40 #include <sys/types.h> 41 41 #include <async.h> 42 #include <device/char .h>42 #include <device/char_dev.h> 43 43 #include <str.h> 44 44 #include <vfs/vfs.h> 45 45 #include <sys/stat.h> 46 46 #include <fcntl.h> 47 #include <device/char.h>48 47 #include "../../tester.h" 49 48 … … 79 78 size_t i; 80 79 char buffer[BUFFER_SIZE]; 81 read_dev(phone, buffer, BUFFER_SIZE);80 char_dev_read(phone, buffer, BUFFER_SIZE); 82 81 TPRINTF(" ...verifying that we read zeroes only...\n"); 83 82 for (i = 0; i < BUFFER_SIZE; i++) { -
uspace/app/tester/hw/serial/serial1.c
reaef141 r80cd7cd 45 45 #include <ipc/devman.h> 46 46 #include <devman.h> 47 #include <device/char .h>47 #include <device/char_dev.h> 48 48 #include <str.h> 49 49 #include <ipc/serial_ctl.h> … … 121 121 size_t total = 0; 122 122 while (total < cnt) { 123 ssize_t read = read_dev(phone, buf, cnt - total);123 ssize_t read = char_dev_read(phone, buf, cnt - total); 124 124 125 125 if (read < 0) { … … 152 152 * direction of data transfer. 153 153 */ 154 ssize_t written = write_dev(phone, buf, read);154 ssize_t written = char_dev_write(phone, buf, read); 155 155 156 156 if (written < 0) { … … 181 181 182 182 size_t eot_size = str_size(EOT); 183 ssize_t written = write_dev(phone, (void *) EOT, eot_size);183 ssize_t written = char_dev_write(phone, (void *) EOT, eot_size); 184 184 185 185 ipc_call_sync_4_0(phone, SERIAL_SET_COM_PROPS, old_baud, -
uspace/app/trace/syscalls.c
reaef141 r80cd7cd 73 73 [SYS_PHYSMEM_MAP] = { "physmem_map", 4, V_ERRNO }, 74 74 [SYS_IOSPACE_ENABLE] = { "iospace_enable", 1, V_ERRNO }, 75 [SYS_INTERRUPT_ENABLE] = { "interrupt_enable", 2, V_ERRNO },76 75 77 76 [SYS_SYSINFO_GET_TAG] = { "sysinfo_get_tag", 2, V_INTEGER },
Note:
See TracChangeset
for help on using the changeset viewer.
