Changeset 79ae36dd in mainline for uspace/srv/fs/devfs/devfs.c


Ignore:
Timestamp:
2011-06-08T19:01:55Z (14 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0eff68e
Parents:
764d71e
Message:

new async framework with integrated exchange tracking

  • strict isolation between low-level IPC and high-level async framework with integrated exchange tracking
    • each IPC connection is represented by an async_sess_t structure
    • each IPC exchange is represented by an async_exch_t structure
    • exchange management is either based on atomic messages (EXCHANGE_ATOMIC), locking (EXCHANGE_SERIALIZE) or connection cloning (EXCHANGE_CLONE)
  • async_obsolete: temporary compatibility layer to keep old async clients working (several pieces of code are currently broken, but only non-essential functionality)
  • IPC_M_PHONE_HANGUP is now method no. 0 (for elegant boolean evaluation)
  • IPC_M_DEBUG_ALL has been renamed to IPC_M_DEBUG
  • IPC_M_PING has been removed (VFS protocol now has VFS_IN_PING)
  • console routines in libc have been rewritten for better abstraction
  • additional use for libc-private header files (FILE structure opaque to the client)
  • various cstyle changes (typos, indentation, missing externs in header files, improved comments, etc.)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/devfs/devfs.c

    r764d71e r79ae36dd  
    4141#include <stdio.h>
    4242#include <ipc/services.h>
    43 #include <ipc/ns.h>
     43#include <ns.h>
    4444#include <async.h>
    4545#include <errno.h>
     
    6868                ipc_callid_t callid = async_get_call(&call);
    6969               
    70                 switch  (IPC_GET_IMETHOD(call)) {
    71                 case IPC_M_PHONE_HUNGUP:
     70                if (!IPC_GET_IMETHOD(call))
    7271                        return;
     72               
     73                switch (IPC_GET_IMETHOD(call)) {
    7374                case VFS_OUT_MOUNTED:
    7475                        devfs_mounted(callid, &call);
     
    119120int main(int argc, char *argv[])
    120121{
    121         printf(NAME ": HelenOS Device Filesystem\n");
     122        printf("%s: HelenOS Device Filesystem\n", NAME);
    122123       
    123124        if (!devfs_init()) {
    124                 printf(NAME ": failed to initialize devfs\n");
     125                printf("%s: failed to initialize devfs\n", NAME);
    125126                return -1;
    126127        }
    127128       
    128         int vfs_phone = service_connect_blocking(SERVICE_VFS, 0, 0);
    129         if (vfs_phone < EOK) {
    130                 printf(NAME ": Unable to connect to VFS\n");
     129        async_sess_t *vfs_sess = service_connect_blocking(EXCHANGE_SERIALIZE,
     130            SERVICE_VFS, 0, 0);
     131        if (!vfs_sess) {
     132                printf("%s: Unable to connect to VFS\n", NAME);
    131133                return -1;
    132134        }
    133135       
    134         int rc = fs_register(vfs_phone, &devfs_reg, &devfs_vfs_info,
     136        int rc = fs_register(vfs_sess, &devfs_reg, &devfs_vfs_info,
    135137            devfs_connection);
    136138        if (rc != EOK) {
    137                 printf(NAME ": Failed to register file system (%d)\n", rc);
     139                printf("%s: Failed to register file system (%d)\n", NAME, rc);
    138140                return rc;
    139141        }
    140142       
    141         printf(NAME ": Accepting connections\n");
     143        printf("%s: Accepting connections\n", NAME);
    142144        task_retval(0);
    143145        async_manager();
Note: See TracChangeset for help on using the changeset viewer.