Changeset 15f3c3f in mainline for uspace/app


Ignore:
Timestamp:
2011-06-22T22:00:52Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
86ffa27f
Parents:
ef09a7a
Message:

Rename devmap to loc, devfs to locfs.

Location:
uspace/app
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/modules/bdd/bdd.c

    ref09a7a r15f3c3f  
    3939
    4040#include <libblock.h>
    41 #include <devmap.h>
     41#include <loc.h>
    4242#include <errno.h>
    4343#include <assert.h>
     
    6969        unsigned int argc;
    7070        unsigned int i, j;
    71         devmap_handle_t handle;
     71        service_id_t service_id;
    7272        aoff64_t offset;
    7373        uint8_t *blk;
     
    9696                size = 256;
    9797
    98         rc = devmap_device_get_handle(argv[1], &handle, 0);
     98        rc = loc_service_get_id(argv[1], &service_id, 0);
    9999        if (rc != EOK) {
    100100                printf("%s: Error resolving device `%s'.\n", cmdname, argv[1]);
     
    102102        }
    103103
    104         rc = block_init(EXCHANGE_SERIALIZE, handle, 2048);
     104        rc = block_init(EXCHANGE_SERIALIZE, service_id, 2048);
    105105        if (rc != EOK)  {
    106106                printf("%s: Error initializing libblock.\n", cmdname);
     
    108108        }
    109109
    110         rc = block_get_bsize(handle, &block_size);
     110        rc = block_get_bsize(service_id, &block_size);
    111111        if (rc != EOK) {
    112112                printf("%s: Error determining device block size.\n", cmdname);
     
    117117        if (blk == NULL) {
    118118                printf("%s: Error allocating memory.\n", cmdname);
    119                 block_fini(handle);
     119                block_fini(service_id);
    120120                return CMD_FAILURE;
    121121        }
     
    124124
    125125        while (size > 0) {
    126                 rc = block_read_direct(handle, ba, 1, blk);
     126                rc = block_read_direct(service_id, ba, 1, blk);
    127127                if (rc != EOK) {
    128128                        printf("%s: Error reading block %" PRIuOFF64 "\n", cmdname, ba);
    129129                        free(blk);
    130                         block_fini(handle);
     130                        block_fini(service_id);
    131131                        return CMD_FAILURE;
    132132                }
     
    170170
    171171        free(blk);
    172         block_fini(handle);
     172        block_fini(service_id);
    173173
    174174        return CMD_SUCCESS;
  • uspace/app/blkdump/blkdump.c

    ref09a7a r15f3c3f  
    4242#include <libblock.h>
    4343#include <mem.h>
    44 #include <devmap.h>
     44#include <loc.h>
    4545#include <byteorder.h>
    4646#include <sys/types.h>
     
    5959        int rc;
    6060        char *dev_path;
    61         devmap_handle_t handle;
     61        service_id_t service_id;
    6262        size_t block_size;
    6363        char *endptr;
     
    128128        dev_path = *argv;
    129129
    130         rc = devmap_device_get_handle(dev_path, &handle, 0);
     130        rc = loc_service_get_id(dev_path, &service_id, 0);
    131131        if (rc != EOK) {
    132132                printf(NAME ": Error resolving device `%s'.\n", dev_path);
     
    134134        }
    135135
    136         rc = block_init(EXCHANGE_SERIALIZE, handle, 2048);
     136        rc = block_init(EXCHANGE_SERIALIZE, service_id, 2048);
    137137        if (rc != EOK)  {
    138138                printf(NAME ": Error initializing libblock.\n");
     
    140140        }
    141141
    142         rc = block_get_bsize(handle, &block_size);
     142        rc = block_get_bsize(service_id, &block_size);
    143143        if (rc != EOK) {
    144144                printf(NAME ": Error determining device block size.\n");
     
    146146        }
    147147
    148         rc = block_get_nblocks(handle, &dev_nblocks);
     148        rc = block_get_nblocks(service_id, &dev_nblocks);
    149149        if (rc != EOK) {
    150150                printf(NAME ": Warning, failed to obtain block device size.\n");
     
    156156        if (data == NULL) {
    157157                printf(NAME ": Error allocating data buffer of %" PRIuOFF64 " bytes", (aoff64_t) block_size);
    158                 block_fini(handle);
     158                block_fini(service_id);
    159159                return 3;
    160160        }
     
    162162        limit = block_offset + block_count;
    163163        for (current = block_offset; current < limit; current++) {
    164                 rc = block_read_direct(handle, current, 1, data);
     164                rc = block_read_direct(service_id, current, 1, data);
    165165                if (rc != EOK) {
    166166                        printf(NAME ": Error reading block at %" PRIuOFF64 " \n", current);
     
    186186        free(data);
    187187
    188         block_fini(handle);
     188        block_fini(service_id);
    189189
    190190        return 0;
  • uspace/app/bnchmark/bnchmark.c

    ref09a7a r15f3c3f  
    4141#include <stdlib.h>
    4242#include <mem.h>
    43 #include <devmap.h>
     43#include <loc.h>
    4444#include <byteorder.h>
    4545#include <sys/types.h>
  • uspace/app/ext2info/ext2info.c

    ref09a7a r15f3c3f  
    4242#include <libblock.h>
    4343#include <mem.h>
    44 #include <devmap.h>
     44#include <loc.h>
    4545#include <byteorder.h>
    4646#include <sys/types.h>
     
    8181        char *endptr;
    8282        char *dev_path;
    83         devmap_handle_t handle;
     83        service_id_t service_id;
    8484        ext2_filesystem_t filesystem;
    8585        int arg_flags;
     
    178178        dev_path = *argv;
    179179
    180         rc = devmap_device_get_handle(dev_path, &handle, 0);
     180        rc = loc_service_get_id(dev_path, &service_id, 0);
    181181        if (rc != EOK) {
    182182                printf(NAME ": Error resolving device `%s'.\n", dev_path);
     
    184184        }
    185185
    186         rc = ext2_filesystem_init(&filesystem, handle);
     186        rc = ext2_filesystem_init(&filesystem, service_id);
    187187        if (rc != EOK)  {
    188188                printf(NAME ": Error initializing libext2.\n");
  • uspace/app/init/init.c

    ref09a7a r15f3c3f  
    4646#include <macros.h>
    4747#include <str.h>
    48 #include <devmap.h>
     48#include <loc.h>
    4949#include <str_error.h>
    5050#include "init.h"
     
    5353#define ROOT_MOUNT_POINT  "/"
    5454
    55 #define DEVFS_FS_TYPE      "devfs"
    56 #define DEVFS_MOUNT_POINT  "/dev"
     55#define LOCFS_FS_TYPE      "locfs"
     56#define LOCFS_MOUNT_POINT  "/loc"
    5757
    5858#define TMPFS_FS_TYPE      "tmpfs"
     
    113113}
    114114
    115 static bool mount_devfs(void)
    116 {
    117         int rc = mount(DEVFS_FS_TYPE, DEVFS_MOUNT_POINT, "", "",
     115static bool mount_locfs(void)
     116{
     117        int rc = mount(LOCFS_FS_TYPE, LOCFS_MOUNT_POINT, "", "",
    118118            IPC_FLAG_BLOCKING);
    119         return mount_report("Device filesystem", DEVFS_MOUNT_POINT, DEVFS_FS_TYPE,
    120             NULL, rc);
     119        return mount_report("Location service filesystem", LOCFS_MOUNT_POINT,
     120            LOCFS_FS_TYPE, NULL, rc);
    121121}
    122122
     
    174174}
    175175
    176 static void console(const char *dev)
    177 {
    178         printf("%s: Spawning %s %s\n", NAME, SRV_CONSOLE, dev);
    179        
    180         /* Wait for the input device to be ready */
    181         devmap_handle_t handle;
    182         int rc = devmap_device_get_handle(dev, &handle, IPC_FLAG_BLOCKING);
    183         if (rc != EOK) {
    184                 printf("%s: Error waiting on %s (%s)\n", NAME, dev,
    185                     str_error(rc));
    186                 return;
    187         }
    188        
    189         rc = task_spawnl(NULL, SRV_CONSOLE, SRV_CONSOLE, dev, NULL);
     176static void console(const char *svc)
     177{
     178        printf("%s: Spawning %s %s\n", NAME, SRV_CONSOLE, svc);
     179       
     180        /* Wait for the input service to be ready */
     181        service_id_t service_id;
     182        int rc = loc_service_get_id(svc, &service_id, IPC_FLAG_BLOCKING);
     183        if (rc != EOK) {
     184                printf("%s: Error waiting on %s (%s)\n", NAME, svc,
     185                    str_error(rc));
     186                return;
     187        }
     188       
     189        rc = task_spawnl(NULL, SRV_CONSOLE, SRV_CONSOLE, svc, NULL);
    190190        if (rc != EOK) {
    191191                printf("%s: Error spawning %s %s (%s)\n", NAME, SRV_CONSOLE,
    192                     dev, str_error(rc));
    193         }
    194 }
    195 
    196 static void getterm(const char *dev, const char *app, bool wmsg)
    197 {
    198         char term[DEVMAP_NAME_MAXLEN];
     192                    svc, str_error(rc));
     193        }
     194}
     195
     196static void getterm(const char *svc, const char *app, bool wmsg)
     197{
     198        char term[LOC_NAME_MAXLEN];
    199199        int rc;
    200200       
    201         snprintf(term, DEVMAP_NAME_MAXLEN, "%s/%s", DEVFS_MOUNT_POINT, dev);
     201        snprintf(term, LOC_NAME_MAXLEN, "%s/%s", LOCFS_MOUNT_POINT, svc);
    202202       
    203203        printf("%s: Spawning %s %s %s\n", NAME, APP_GETTERM, term, app);
    204204       
    205         /* Wait for the terminal device to be ready */
    206         devmap_handle_t handle;
    207         rc = devmap_device_get_handle(dev, &handle, IPC_FLAG_BLOCKING);
     205        /* Wait for the terminal service to be ready */
     206        service_id_t service_id;
     207        rc = loc_service_get_id(svc, &service_id, IPC_FLAG_BLOCKING);
    208208        if (rc != EOK) {
    209209                printf("%s: Error waiting on %s (%s)\n", NAME, term,
     
    257257        }
    258258       
    259         spawn("/srv/devfs");
     259        spawn("/srv/locfs");
    260260        spawn("/srv/taskmon");
    261261       
    262         if (!mount_devfs()) {
     262        if (!mount_locfs()) {
    263263                printf("%s: Exiting\n", NAME);
    264264                return -2;
  • uspace/app/lsusb/main.c

    ref09a7a r15f3c3f  
    4343#include <getopt.h>
    4444#include <devman.h>
    45 #include <devmap.h>
     45#include <loc.h>
    4646#include <usb/dev/hub.h>
    4747#include <usb/hc.h>
  • uspace/app/mkbd/main.c

    ref09a7a r15f3c3f  
    4343#include <getopt.h>
    4444#include <devman.h>
    45 #include <devmap.h>
     45#include <loc.h>
    4646#include <usb/dev/hub.h>
    4747#include <usb/hid/iface.h>
  • uspace/app/mkfat/mkfat.c

    ref09a7a r15f3c3f  
    4242#include <libblock.h>
    4343#include <mem.h>
    44 #include <devmap.h>
     44#include <loc.h>
    4545#include <byteorder.h>
    4646#include <sys/types.h>
     
    8585    struct fat_params *par);
    8686static int fat_blocks_write(struct fat_params const *par,
    87     devmap_handle_t handle);
     87    service_id_t service_id);
    8888static void fat_bootsec_create(struct fat_params const *par, struct fat_bs *bs);
    8989
     
    9595        int rc;
    9696        char *dev_path;
    97         devmap_handle_t handle;
     97        service_id_t service_id;
    9898        size_t block_size;
    9999        char *endptr;
     
    138138        dev_path = *argv;
    139139
    140         rc = devmap_device_get_handle(dev_path, &handle, 0);
     140        rc = loc_service_get_id(dev_path, &service_id, 0);
    141141        if (rc != EOK) {
    142142                printf(NAME ": Error resolving device `%s'.\n", dev_path);
     
    144144        }
    145145
    146         rc = block_init(EXCHANGE_SERIALIZE, handle, 2048);
     146        rc = block_init(EXCHANGE_SERIALIZE, service_id, 2048);
    147147        if (rc != EOK)  {
    148148                printf(NAME ": Error initializing libblock.\n");
     
    150150        }
    151151
    152         rc = block_get_bsize(handle, &block_size);
     152        rc = block_get_bsize(service_id, &block_size);
    153153        if (rc != EOK) {
    154154                printf(NAME ": Error determining device block size.\n");
     
    156156        }
    157157
    158         rc = block_get_nblocks(handle, &dev_nblocks);
     158        rc = block_get_nblocks(service_id, &dev_nblocks);
    159159        if (rc != EOK) {
    160160                printf(NAME ": Warning, failed to obtain block device size.\n");
     
    183183        }
    184184
    185         rc = fat_blocks_write(&par, handle);
     185        rc = fat_blocks_write(&par, service_id);
    186186        if (rc != EOK) {
    187187                printf(NAME ": Error writing device.\n");
     
    189189        }
    190190
    191         block_fini(handle);
     191        block_fini(service_id);
    192192        printf("Success.\n");
    193193
     
    234234
    235235/** Create file system with the given parameters. */
    236 static int fat_blocks_write(struct fat_params const *par, devmap_handle_t handle)
     236static int fat_blocks_write(struct fat_params const *par, service_id_t service_id)
    237237{
    238238        aoff64_t addr;
     
    245245        fat_bootsec_create(par, &bs);
    246246
    247         rc = block_write_direct(handle, BS_BLOCK, 1, &bs);
     247        rc = block_write_direct(service_id, BS_BLOCK, 1, &bs);
    248248        if (rc != EOK)
    249249                return EIO;
     
    257257        /* Reserved sectors */
    258258        for (i = 0; i < par->reserved_sectors - 1; ++i) {
    259                 rc = block_write_direct(handle, addr, 1, buffer);
     259                rc = block_write_direct(service_id, addr, 1, buffer);
    260260                if (rc != EOK)
    261261                        return EIO;
     
    277277                        }
    278278
    279                         rc = block_write_direct(handle, addr, 1, buffer);
     279                        rc = block_write_direct(service_id, addr, 1, buffer);
    280280                        if (rc != EOK)
    281281                                return EIO;
     
    291291        /* Root directory */
    292292        for (i = 0; i < par->rootdir_sectors; ++i) {
    293                 rc = block_write_direct(handle, addr, 1, buffer);
     293                rc = block_write_direct(service_id, addr, 1, buffer);
    294294                if (rc != EOK)
    295295                        return EIO;
  • uspace/app/tester/devs/devman2.c

    ref09a7a r15f3c3f  
    5858        char *path = NULL;
    5959        while (rc == EOK) {
    60                 rc = asprintf(&path, "/dev/class/%s\\%zu", DEVICE_CLASS, idx);
     60                rc = asprintf(&path, "/loc/class/%s\\%zu", DEVICE_CLASS, idx);
    6161                if (rc < 0) {
    6262                        continue;
  • uspace/app/tester/hw/misc/virtchar1.c

    ref09a7a r15f3c3f  
    4848#include "../../tester.h"
    4949
    50 #define DEVICE_PATH_NORMAL "/dev/devices/\\virt\\null\\a"
    51 #define DEVICE_PATH_CLASSES "/dev/class/virt-null\\1"
     50#define DEVICE_PATH_NORMAL "/loc/devices/\\virt\\null\\a"
     51#define DEVICE_PATH_CLASSES "/loc/class/virt-null\\1"
    5252#define BUFFER_SIZE 64
    5353
  • uspace/app/tester/vfs/vfs1.c

    ref09a7a r15f3c3f  
    3535#include <fcntl.h>
    3636#include <dirent.h>
    37 #include <devmap.h>
     37#include <loc.h>
    3838#include <sys/types.h>
    3939#include <sys/stat.h>
  • uspace/app/testread/testread.c

    ref09a7a r15f3c3f  
    5050#include <stdlib.h>
    5151#include <mem.h>
    52 #include <devmap.h>
     52#include <loc.h>
    5353#include <byteorder.h>
    5454#include <sys/types.h>
  • uspace/app/usbinfo/main.c

    ref09a7a r15f3c3f  
    4242#include <getopt.h>
    4343#include <devman.h>
    44 #include <devmap.h>
     44#include <loc.h>
    4545#include <usb/hc.h>
    4646#include <usb/dev/pipes.h>
Note: See TracChangeset for help on using the changeset viewer.