Changeset 80cd7cd in mainline for uspace/app


Ignore:
Timestamp:
2011-01-13T20:58:24Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
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.
Message:

Merge mainline changes.

Location:
uspace/app
Files:
3 added
6 edited
3 moved

Legend:

Unmodified
Added
Removed
  • uspace/app/init/init.c

    reaef141 r80cd7cd  
    6161
    6262#define DATA_FS_TYPE      "fat"
    63 #define DATA_DEVICE       "bd/disk0"
     63#define DATA_DEVICE       "bd/ata1disk0"
    6464#define DATA_MOUNT_POINT  "/data"
    6565
     
    273273        mount_tmpfs();
    274274       
     275        spawn("/srv/apic");
     276        spawn("/srv/i8259");
    275277        spawn("/srv/fhc");
    276278        spawn("/srv/obio");
  • uspace/app/kill/kill.c

    reaef141 r80cd7cd  
    11/*
    2  * Copyright (c) 2009 Lukas Mejdrech
     2 * Copyright (c) 2010 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup arp
     29/** @addtogroup kill
    3030 * @{
    3131 */
    32 
    33 /** @file
    34  * ARP module functions.
    35  * The functions are used as ARP module entry points.
     32/**
     33 * @file Forcefully terminate a task.
    3634 */
    3735
    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>
    4040
    41 #include <ipc/ipc.h>
    42 #include <async.h>
     41#define NAME  "kill"
    4342
    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 *);
     43static void print_syntax(void)
     44{
     45        printf("Syntax: " NAME " <task ID>\n");
     46}
    4747
    48 #endif
     48int 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}
    4974
    5075/** @}
  • uspace/app/killall/Makefile

    reaef141 r80cd7cd  
    2727#
    2828
    29 USPACE_PREFIX = ../../..
    30 ROOT_PATH = $(USPACE_PREFIX)/..
     29USPACE_PREFIX = ../..
     30LIBS =
     31EXTRA_CFLAGS =
     32BINARY = killall
    3133
    32 COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
    33 CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
     34SOURCES = \
     35        killall.c
    3436
    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 $< $@
     37include $(USPACE_PREFIX)/Makefile.common
  • uspace/app/killall/killall.c

    reaef141 r80cd7cd  
    11/*
    2  * Copyright (c) 2009 Lukas Mejdrech
     2 * Copyright (c) 2010 Martin Decky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup eth
     29/** @addtogroup killall
    3030 * @{
    3131 */
    32 
    33 /** @file
    34  *  Ethernet module stub.
    35  *  @see module.c
     32/**
     33 * @file Forcefully terminate a task specified by name.
    3634 */
    3735
    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>
    3942
    40 #include <async.h>
    41 #include <stdio.h>
    42 #include <errno.h>
     43#define NAME  "killall"
    4344
    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)
     45static void print_syntax(void)
    5346{
    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");
    7748}
    7849
    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)
     50int main(int argc, char *argv[])
    8151{
    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;
    8381}
    8482
  • uspace/app/netecho/netecho.c

    reaef141 r80cd7cd  
    180180                } else if (str_lcmp(argv[*index] + 2, "help", 5) == 0) {
    181181                        echo_print_help();
    182                         return EOK;
     182                        exit(0);
    183183                } else if (str_lcmp(argv[*index] + 2, "port=", 5) == 0) {
    184184                        rc = arg_parse_int(argc, argv, index, &value, 7);
  • uspace/app/taskdump/taskdump.c

    reaef141 r80cd7cd  
    326326
    327327        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,
    329329            sym_pc, (void *) fp);
    330330        free(sym_pc);
  • uspace/app/tester/hw/misc/virtchar1.c

    reaef141 r80cd7cd  
    4040#include <sys/types.h>
    4141#include <async.h>
    42 #include <device/char.h>
     42#include <device/char_dev.h>
    4343#include <str.h>
    4444#include <vfs/vfs.h>
    4545#include <sys/stat.h>
    4646#include <fcntl.h>
    47 #include <device/char.h>
    4847#include "../../tester.h"
    4948
     
    7978        size_t i;
    8079        char buffer[BUFFER_SIZE];
    81         read_dev(phone, buffer, BUFFER_SIZE);
     80        char_dev_read(phone, buffer, BUFFER_SIZE);
    8281        TPRINTF(" ...verifying that we read zeroes only...\n");
    8382        for (i = 0; i < BUFFER_SIZE; i++) {
  • uspace/app/tester/hw/serial/serial1.c

    reaef141 r80cd7cd  
    4545#include <ipc/devman.h>
    4646#include <devman.h>
    47 #include <device/char.h>
     47#include <device/char_dev.h>
    4848#include <str.h>
    4949#include <ipc/serial_ctl.h>
     
    121121        size_t total = 0;
    122122        while (total < cnt) {
    123                 ssize_t read = read_dev(phone, buf, cnt - total);
     123                ssize_t read = char_dev_read(phone, buf, cnt - total);
    124124               
    125125                if (read < 0) {
     
    152152                         * direction of data transfer.
    153153                         */
    154                         ssize_t written = write_dev(phone, buf, read);
     154                        ssize_t written = char_dev_write(phone, buf, read);
    155155                       
    156156                        if (written < 0) {
     
    181181       
    182182        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);
    184184       
    185185        ipc_call_sync_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,
  • uspace/app/trace/syscalls.c

    reaef141 r80cd7cd  
    7373    [SYS_PHYSMEM_MAP] = { "physmem_map",                4,      V_ERRNO },
    7474    [SYS_IOSPACE_ENABLE] = { "iospace_enable",          1,      V_ERRNO },
    75     [SYS_INTERRUPT_ENABLE] = { "interrupt_enable",      2,      V_ERRNO },
    7675
    7776    [SYS_SYSINFO_GET_TAG] = { "sysinfo_get_tag",                2,      V_INTEGER },
Note: See TracChangeset for help on using the changeset viewer.