Changeset 16dc887 in mainline for uspace/app/init/init.c


Ignore:
Timestamp:
2011-08-16T14:00:32Z (13 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
278ac72, b112055
Parents:
3751a08 (diff), cc574511 (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 Location service.

File:
1 edited

Legend:

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

    r3751a08 r16dc887  
    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;
Note: See TracChangeset for help on using the changeset viewer.