Changeset e29e09cf in mainline for uspace/app


Ignore:
Timestamp:
2011-02-04T21:00:56Z (15 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
474afc9, 960ff451
Parents:
400575c5 (diff), 17aca1c (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:
16 edited

Legend:

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

    r400575c5 re29e09cf  
    3737#include <stdio.h>
    3838#include <unistd.h>
    39 #include <ipc/ipc.h>
    4039#include <vfs/vfs.h>
    4140#include <bool.h>
  • uspace/app/klog/klog.c

    r400575c5 re29e09cf  
    3636
    3737#include <stdio.h>
    38 #include <ipc/ipc.h>
    3938#include <async.h>
    40 #include <ipc/services.h>
    4139#include <as.h>
    42 #include <sysinfo.h>
     40#include <ddi.h>
    4341#include <event.h>
    4442#include <errno.h>
    4543#include <str_error.h>
    4644#include <io/klog.h>
     45#include <sysinfo.h>
    4746
    4847#define NAME       "klog"
     
    7978int main(int argc, char *argv[])
    8079{
    81         size_t klog_pages;
    82         if (sysinfo_get_value("klog.pages", &klog_pages) != EOK) {
    83                 printf("%s: Error getting klog address\n", NAME);
    84                 return -1;
     80        size_t pages;
     81        int rc = sysinfo_get_value("klog.pages", &pages);
     82        if (rc != EOK) {
     83                fprintf(stderr, "%s: Unable to get number of klog pages\n",
     84                    NAME);
     85                return rc;
    8586        }
    8687       
    87         size_t klog_size = klog_pages * PAGE_SIZE;
    88         klog_length = klog_size / sizeof(wchar_t);
    89        
    90         klog = (wchar_t *) as_get_mappable_page(klog_size);
    91         if (klog == NULL) {
    92                 printf("%s: Error allocating memory area\n", NAME);
    93                 return -1;
     88        uintptr_t faddr;
     89        rc = sysinfo_get_value("klog.faddr", &faddr);
     90        if (rc != EOK) {
     91                fprintf(stderr, "%s: Unable to get klog physical address\n",
     92                    NAME);
     93                return rc;
    9494        }
    9595       
    96         int res = async_share_in_start_1_0(PHONE_NS, (void *) klog,
    97             klog_size, SERVICE_MEM_KLOG);
    98         if (res != EOK) {
    99                 printf("%s: Error initializing memory area\n", NAME);
    100                 return -1;
     96        size_t size = pages * PAGE_SIZE;
     97        klog_length = size / sizeof(wchar_t);
     98       
     99        klog = (wchar_t *) as_get_mappable_page(size);
     100        if (klog == NULL) {
     101                fprintf(stderr, "%s: Unable to allocate virtual memory area\n",
     102                    NAME);
     103                return ENOMEM;
    101104        }
    102105       
    103         if (event_subscribe(EVENT_KLOG, 0) != EOK) {
    104                 printf("%s: Error registering klog notifications\n", NAME);
    105                 return -1;
     106        rc = physmem_map((void *) faddr, (void *) klog, pages,
     107            AS_AREA_READ | AS_AREA_CACHEABLE);
     108        if (rc != EOK) {
     109                fprintf(stderr, "%s: Unable to map klog\n", NAME);
     110                return rc;
     111        }
     112       
     113        rc = event_subscribe(EVENT_KLOG, 0);
     114        if (rc != EOK) {
     115                fprintf(stderr, "%s: Unable to register klog notifications\n",
     116                    NAME);
     117                return rc;
    106118        }
    107119       
     
    109121         * Mode "a" would be definitively much better here, but it is
    110122         * not well supported by the FAT driver.
    111          *
    112123         */
    113124        log = fopen(LOG_FNAME, "w");
  • uspace/app/ping/ping.c

    r400575c5 re29e09cf  
    3535 */
    3636
     37#include <async.h>
    3738#include <stdio.h>
    3839#include <str.h>
    3940#include <task.h>
    4041#include <time.h>
    41 #include <ipc/ipc.h>
    4242#include <ipc/services.h>
    4343#include <str_error.h>
     
    355355                            str_error(ret));
    356356                       
    357                         ipc_hangup(icmp_phone);
     357                        async_hangup(icmp_phone);
    358358                        return ret;
    359359                }
     
    370370                            str_error(ret));
    371371                       
    372                         ipc_hangup(icmp_phone);
     372                        async_hangup(icmp_phone);
    373373                        return ret;
    374374                }
     
    390390        }
    391391       
    392         ipc_hangup(icmp_phone);
     392        async_hangup(icmp_phone);
    393393       
    394394        return 0;
  • uspace/app/taskdump/taskdump.c

    r400575c5 re29e09cf  
    3333 */
    3434
     35#include <async.h>
    3536#include <stdio.h>
    3637#include <stdlib.h>
    3738#include <unistd.h>
    38 #include <ipc/ipc.h>
    3939#include <errno.h>
    4040#include <udebug.h>
     
    105105
    106106        udebug_end(phoneid);
    107         ipc_hangup(phoneid);
     107        async_hangup(phoneid);
    108108
    109109        return 0;
     
    114114        int rc;
    115115
    116         rc = ipc_connect_kbox(task_id);
     116        rc = async_connect_kbox(task_id);
    117117
    118118        if (rc == ENOTSUP) {
     
    126126        if (rc < 0) {
    127127                printf("Error connecting\n");
    128                 printf("ipc_connect_task(%" PRIu64 ") -> %d ", task_id, rc);
     128                printf("async_connect_kbox(%" PRIu64 ") -> %d ", task_id, rc);
    129129                return rc;
    130130        }
  • uspace/app/tester/hw/misc/virtchar1.c

    r400575c5 re29e09cf  
    8989        /* Clean-up. */
    9090        TPRINTF(" Closing phones and file descriptors\n");
    91         ipc_hangup(phone);
     91        async_hangup(phone);
    9292        close(fd);
    9393       
  • uspace/app/tester/hw/serial/serial1.c

    r400575c5 re29e09cf  
    3939#include <stdlib.h>
    4040#include <stdio.h>
    41 #include <ipc/ipc.h>
    4241#include <sys/types.h>
    4342#include <async.h>
     
    8887        char *buf = (char *) malloc(cnt + 1);
    8988        if (buf == NULL) {
    90                 ipc_hangup(phone);
     89                async_hangup(phone);
    9190                devman_hangup_phone(DEVMAN_CLIENT);
    9291                return "Failed to allocate input buffer";
     
    9897        sysarg_t old_word_size;
    9998       
    100         res = ipc_call_sync_0_4(phone, SERIAL_GET_COM_PROPS, &old_baud,
     99        res = async_req_0_4(phone, SERIAL_GET_COM_PROPS, &old_baud,
    101100            &old_par, &old_word_size, &old_stop);
    102101        if (res != EOK) {
    103102                free(buf);
    104                 ipc_hangup(phone);
     103                async_hangup(phone);
    105104                devman_hangup_phone(DEVMAN_CLIENT);
    106105                return "Failed to get old serial communication parameters";
    107106        }
    108107       
    109         res = ipc_call_sync_4_0(phone, SERIAL_SET_COM_PROPS, 1200,
     108        res = async_req_4_0(phone, SERIAL_SET_COM_PROPS, 1200,
    110109            SERIAL_NO_PARITY, 8, 1);
    111110        if (EOK != res) {
    112111                free(buf);
    113                 ipc_hangup(phone);
     112                async_hangup(phone);
    114113                devman_hangup_phone(DEVMAN_CLIENT);
    115114                return "Failed to set serial communication parameters";
     
    124123               
    125124                if (read < 0) {
    126                         ipc_call_sync_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,
     125                        async_req_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,
    127126                            old_par, old_word_size, old_stop);
    128127                        free(buf);
    129                         ipc_hangup(phone);
     128                        async_hangup(phone);
    130129                        devman_hangup_phone(DEVMAN_CLIENT);
    131130                        return "Failed read from serial device";
     
    133132               
    134133                if ((size_t) read > cnt - total) {
    135                         ipc_call_sync_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,
     134                        async_req_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,
    136135                            old_par, old_word_size, old_stop);
    137136                        free(buf);
    138                         ipc_hangup(phone);
     137                        async_hangup(phone);
    139138                        devman_hangup_phone(DEVMAN_CLIENT);
    140139                        return "Read more data than expected";
     
    155154                       
    156155                        if (written < 0) {
    157                                 ipc_call_sync_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,
     156                                async_req_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,
    158157                                    old_par, old_word_size, old_stop);
    159158                                free(buf);
    160                                 ipc_hangup(phone);
     159                                async_hangup(phone);
    161160                                devman_hangup_phone(DEVMAN_CLIENT);
    162161                                return "Failed write to serial device";
     
    164163                       
    165164                        if (written != read) {
    166                                 ipc_call_sync_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,
     165                                async_req_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,
    167166                                    old_par, old_word_size, old_stop);
    168167                                free(buf);
    169                                 ipc_hangup(phone);
     168                                async_hangup(phone);
    170169                                devman_hangup_phone(DEVMAN_CLIENT);
    171170                                return "Written less data than read from serial device";
     
    183182        ssize_t written = char_dev_write(phone, (void *) EOT, eot_size);
    184183       
    185         ipc_call_sync_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,
     184        async_req_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,
    186185            old_par, old_word_size, old_stop);
    187186        free(buf);
    188         ipc_hangup(phone);
     187        async_hangup(phone);
    189188        devman_hangup_phone(DEVMAN_CLIENT);
    190189       
  • uspace/app/tester/tester.h

    r400575c5 re29e09cf  
    3838#include <sys/types.h>
    3939#include <bool.h>
    40 #include <ipc/ipc.h>
    4140
    4241#define IPC_TEST_SERVICE  10240
  • uspace/app/tetris/screen.h

    r400575c5 re29e09cf  
    4848
    4949#include <sys/types.h>
    50 #include <ipc/ipc.h>
    5150#include <async.h>
    5251#include <bool.h>
  • uspace/app/top/screen.c

    r400575c5 re29e09cf  
    3737
    3838#include <stdio.h>
    39 #include <ipc/ipc.h>
    4039#include <io/console.h>
    4140#include <io/style.h>
  • uspace/app/trace/ipc_desc.c

    r400575c5 re29e09cf  
    3333 */
    3434
     35#include <ipc/common.h>
    3536#include <stdlib.h>
    36 #include <ipc/ipc.h>
    3737#include "ipc_desc.h"
    3838
  • uspace/app/trace/ipcp.h

    r400575c5 re29e09cf  
    3636#define IPCP_H_
    3737
    38 #include <ipc/ipc.h>
    3938#include "proto.h"
    4039
  • uspace/app/trace/proto.c

    r400575c5 re29e09cf  
    3535#include <stdio.h>
    3636#include <stdlib.h>
    37 #include <ipc/ipc.h>
    3837#include <adt/hash_table.h>
    3938
  • uspace/app/trace/proto.h

    r400575c5 re29e09cf  
    3636#define PROTO_H_
    3737
     38#include <ipc/common.h>
    3839#include <adt/hash_table.h>
    39 #include <ipc/ipc.h>
    4040#include "trace.h"
    4141
  • uspace/app/trace/syscalls.c

    r400575c5 re29e09cf  
    6464    [SYS_IPC_POKE] = { "ipc_poke",                      0,      V_ERRNO },
    6565    [SYS_IPC_HANGUP] = { "ipc_hangup",                  1,      V_ERRNO },
    66     [SYS_IPC_REGISTER_IRQ] = { "ipc_register_irq",      4,      V_ERRNO },
    67     [SYS_IPC_UNREGISTER_IRQ] = { "ipc_unregister_irq",  2,      V_ERRNO },
    6866
    6967    [SYS_EVENT_SUBSCRIBE] = { "event_subscribe",        2,      V_ERRNO },
     
    7371    [SYS_PHYSMEM_MAP] = { "physmem_map",                4,      V_ERRNO },
    7472    [SYS_IOSPACE_ENABLE] = { "iospace_enable",          1,      V_ERRNO },
     73    [SYS_REGISTER_IRQ] = { "register_irq",      4,      V_ERRNO },
     74    [SYS_UNREGISTER_IRQ] = { "unregister_irq",  2,      V_ERRNO },
    7575
    7676    [SYS_SYSINFO_GET_TAG] = { "sysinfo_get_tag",                2,      V_INTEGER },
  • uspace/app/trace/trace.c

    r400575c5 re29e09cf  
    3636#include <stdlib.h>
    3737#include <unistd.h>
    38 #include <ipc/ipc.h>
    3938#include <fibril.h>
    4039#include <errno.h>
     
    149148        int rc;
    150149
    151         rc = ipc_connect_kbox(task_id);
     150        rc = async_connect_kbox(task_id);
    152151
    153152        if (rc == ENOTSUP) {
     
    745744        abort_trace = true;
    746745        udebug_end(phoneid);
    747         ipc_hangup(phoneid);
     746        async_hangup(phoneid);
    748747
    749748        ipcp_cleanup();
  • uspace/app/usbinfo/info.c

    r400575c5 re29e09cf  
    141141leave:
    142142        /* Ignoring errors here. */
    143         ipc_hangup(hc_phone);
     143        async_hangup(hc_phone);
    144144        usb_endpoint_pipe_end_session(&ctrl_pipe);
    145145
Note: See TracChangeset for help on using the changeset viewer.