Changeset cf7b3e0 in mainline for contrib/arch/uspace/srv


Ignore:
Timestamp:
2009-09-16T22:46:58Z (17 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
51d4040
Parents:
57688fe2
Message:

various fixes and cleanup

Location:
contrib/arch/uspace/srv
Files:
3 added
14 edited

Legend:

Unmodified
Added
Removed
  • contrib/arch/uspace/srv/bd/bd.adl

    r57688fe2 rcf7b3e0  
    11interface bd extends service {
    2                 /* Establish connection */
    3                 ipcarg_t ipc_m_connect_me_to(void);
    4                
    52                /* Share out data buffer */
    63                ipcarg_t ipc_m_share_out(in ipcarg_t as_area_base, in ipcarg_t as_area_size, in ipcarg_t flags, out ipcarg_t dst_as_area_base);
     
    1411                /* Write blocks via shared data buffer */
    1512                ipcarg_t write_blocks(in ipcarg_t index_lower, in ipcarg_t index_upper, in ipcarg_t count);
    16                
    17                 /* Close connection */
    18                 ipcarg_t ipc_m_phone_hungup(void);
    1913        protocol:
    2014                [bd.bp]
     
    2620        [/uspace/lib/libc/subsume%rd]
    2721       
    28         delegate bd to rd:bd;
     22        delegate rd to rd:rd;
    2923       
    3024        subsume rd:ns to ns;
    31         subsume rd:devmap to devmap;
     25        subsume rd:devmap_driver to devmap_driver;
    3226};
  • contrib/arch/uspace/srv/bd/rd/rd.adl

    r57688fe2 rcf7b3e0  
     1interface rd extends bd;
     2
    13frame rd {
    24        provides:
    3                 bd bd;
     5                rd rd;
    46        requires:
    57                [/uspace/lib/libc/requires]
     
    79                devmap_driver devmap_driver;
    810        protocol:
    9                 [/uspace/lib/libc/protocol] +
     11                [/uspace/lib/libc/protocol] |
    1012                [rd.bp]
    1113};
  • contrib/arch/uspace/srv/fs/devfs/devfs.adl

    r57688fe2 rcf7b3e0  
     1interface devfs extends fs {
     2        protocol:
     3                [devfs.bp]
     4};
     5
    16frame devfs {
    27        provides:
    3                 fs fs;
     8                devfs devfs;
    49        requires:
    510                [/uspace/lib/libc/requires]
     
    914                service device;
    1015        protocol:
    11                 [/uspace/lib/libc/protocol] +
     16                [/uspace/lib/libc/protocol] |
    1217                [devfs_server.bp]
    1318};
  • contrib/arch/uspace/srv/fs/devfs/devfs_server.bp

    r57688fe2 rcf7b3e0  
    11[/uspace/lib/libc/fnc.devmap_get_phone] ;
    22!ns.ipc_m_connect_me_to /* vfs */ ;
    3 [/uspace/lib/libfs/fnc.fs_register] ;
    4 (
    5         ?fs.ipc_m_connect_me_to ;
    6         (
    7                 ?fs.mounted {
    8                         ?fs.ipc_m_data_write /* mount options */
    9                 } +
    10                
    11                 ?fs.lookup {
    12                         tentative {
    13                                 [/uspace/lib/libc/fnc.devmap_device_get_handle] ;
    14                                 tentative {
    15                                         [/uspace/lib/libc/fnc.devmap_device_connect]
    16                                 }
    17                         }
    18                 } +
    19                
    20                 ?fs.open_node {
    21                         tentative {
    22                                 [/uspace/lib/libc/fnc.devmap_device_connect]
    23                         }
    24                 } +
    25                
    26                 ?fs.read {
    27                         tentative {
    28                                 ?fs.ipc_m_data_read /* payload */ {
    29                                         !device.read {
    30                                                 !device.ipc_m_data_read /* forward */
    31                                         }
    32                                 } +
    33                                 (
    34                                         [/uspace/lib/libc/fnc.devmap_device_get_count] ;
    35                                         [/uspace/lib/libc/fnc.devmap_device_get_devices]
    36                                 )
    37                         }
    38                 } +
    39                
    40                 ?fs.write {
    41                         tentative {
    42                                 ?fs.ipc_m_data_write /* payload */ {
    43                                         !device.write {
    44                                                 !device.ipc_m_data_write /* forward */
    45                                         }
    46                                 }
    47                         }
    48                 } +
    49                
    50                 ?fs.stat {
    51                         ?fs.ipc_m_data_read /* struct data */
    52                 } +
    53                
    54                 ?fs.close {
    55                         !device.ipc_m_phone_hungup
    56                 } +
    57                
    58                 ?fs.mount +
    59                 ?fs.truncate +
    60                 ?fs.destroy +
    61                 ?fs.sync
    62         )* ;
    63         ?fs.ipc_m_phone_hungup
    64 )* ;
    65 !vfs.ipc_m_phone_hungup
     3[/uspace/lib/libfs/fnc.fs_register]
  • contrib/arch/uspace/srv/fs/fat/fat.adl

    r57688fe2 rcf7b3e0  
     1interface fat extends fs {
     2        protocol:
     3                [fat.bp]
     4};
     5
    16frame fat {
    27        provides:
    3                 fs fs;
     8                fat fat;
    49        requires:
    510                [/uspace/lib/libc/requires]
    611                vfs vfs;
    712                ns ns;
    8                 bd bd;
     13                rd rd;
    914        protocol:
    10                 [/uspace/lib/libc/protocol] +
     15                [/uspace/lib/libc/protocol] |
    1116                [fat_server.bp]
    1217};
  • contrib/arch/uspace/srv/fs/fat/fat_server.bp

    r57688fe2 rcf7b3e0  
    11!ns.ipc_m_connect_me_to /* vfs */ ;
    2 [/uspace/lib/libfs/fnc.fs_register] ;
    3 (
    4         ?fs.ipc_m_connect_me_to ;
    5         (
    6                 ?fs.mounted {
    7                         ?fs.ipc_m_data_write /* mount options */
    8                 } +
    9                
    10                 ?fs.mount {
    11                         [/uspace/lib/libfs/fnc.libfs_mount]
    12                 } +
    13                
    14                 ?fs.lookup {
    15                         [/uspace/lib/libfs/fnc.libfs_lookup]
    16                 } +
    17                
    18                 ?fs.open_node {
    19                         [/uspace/lib/libfs/fnc.libfs_open_node]
    20                 } +
    21                
    22                 ?fs.read {
    23                         tentative {
    24                                 ?fs.ipc_m_data_read /* payload */
    25                         }
    26                 } +
    27                
    28                 ?fs.write {
    29                         tentative {
    30                                 ?fs.ipc_m_data_write /* payload */
    31                         }
    32                 } +
    33                
    34                 ?fs.stat {
    35                         [/uspace/lib/libfs/fnc.libfs_stat]
    36                 } +
    37                
    38                 ?fs.truncate +
    39                 ?fs.close +
    40                 ?fs.destroy +
    41                 ?fs.sync
    42         )* ;
    43         ?fs.ipc_m_phone_hungup
    44 )* ;
    45 !vfs.ipc_m_phone_hungup
     2[/uspace/lib/libfs/fnc.fs_register]
  • contrib/arch/uspace/srv/fs/tmpfs/tmpfs.adl

    r57688fe2 rcf7b3e0  
     1interface tmpfs extends fs {
     2        protocol:
     3                [tmpfs.bp]
     4};
     5
    16frame tmpfs {
    27        provides:
    3                 fs fs;
     8                tmpfs tmpfs;
    49        requires:
    510                [/uspace/lib/libc/requires]
    611                vfs vfs;
    712                ns ns;
    8                 bd bd;
     13                rd rd;
    914        protocol:
    10                 [/uspace/lib/libc/protocol] +
     15                [/uspace/lib/libc/protocol] |
    1116                [tmpfs_server.bp]
    1217};
  • contrib/arch/uspace/srv/fs/tmpfs/tmpfs_server.bp

    r57688fe2 rcf7b3e0  
    11!ns.ipc_m_connect_me_to /* vfs */ ;
    2 [/uspace/lib/libfs/fnc.fs_register] ;
    3 (
    4         ?fs.ipc_m_connect_me_to ;
    5         (
    6                 ?fs.mounted {
    7                         ?fs.ipc_m_data_write /* mount options */
    8                 } +
    9                
    10                 ?fs.mount {
    11                         [/uspace/lib/libfs/fnc.libfs_mount]
    12                 } +
    13                
    14                 ?fs.lookup {
    15                         [/uspace/lib/libfs/fnc.libfs_lookup]
    16                 } +
    17                
    18                 ?fs.open_node {
    19                         [/uspace/lib/libfs/fnc.libfs_open_node]
    20                 } +
    21                
    22                 ?fs.read {
    23                         tentative {
    24                                 ?fs.ipc_m_data_read /* payload */
    25                         }
    26                 } +
    27                
    28                 ?fs.write {
    29                         tentative {
    30                                 ?fs.ipc_m_data_write /* payload */
    31                         }
    32                 } +
    33                
    34                 ?fs.stat {
    35                         [/uspace/lib/libfs/fnc.libfs_stat]
    36                 } +
    37                
    38                 ?fs.truncate +
    39                 ?fs.close +
    40                 ?fs.destroy +
    41                 ?fs.sync
    42         )* ;
    43         ?fs.ipc_m_phone_hungup
    44 )* ;
    45 !vfs.ipc_m_phone_hungup
     2[/uspace/lib/libfs/fnc.fs_register]
  • contrib/arch/uspace/srv/kbd/kbd.adl

    r57688fe2 rcf7b3e0  
    11interface kbd extends service {
    2                 /* Establish connection */
    3                 ipcarg_t ipc_m_connect_me_to(void);
    4                
    52                /* Callback connection */
    63                ipcarg_t ipc_m_connect_to_me(void);
     
    118                /* Reclaim hardware */
    129                ipcarg_t reclaim(void);
    13                
    14                 /* Close connection */
    15                 ipcarg_t ipc_m_phone_hungup(void);
    1610        protocol:
    1711                [kbd.bp]
     
    3327                ns ns;
    3428        protocol:
    35                 [/uspace/lib/libc/protocol] +
     29                [/uspace/lib/libc/protocol] |
    3630                [kbd_server.bp]
    3731};
  • contrib/arch/uspace/srv/loader/loader.adl

    r57688fe2 rcf7b3e0  
    11interface loader extends service {
    2                 /* Establish connection */
    3                 ipcarg_t ipc_m_connect_me_to(void);
    4                
    52                /* Set task pathname */
    63                ipcarg_t set_pathname(in_copy string pathname);
     
    2017                /* Run binary */
    2118                ipcarg_t run(void);
    22                
    23                 /* Close connection */
    24                 ipcarg_t ipc_m_phone_hungup(void);
    2519        protocol:
    2620                [loader.bp]
     
    3428                ns ns;
    3529        protocol:
    36                 [/uspace/lib/libc/protocol] +
     30                [/uspace/lib/libc/protocol] |
    3731                [loader_server.bp]
    3832};
  • contrib/arch/uspace/srv/ns/service.adl

    r57688fe2 rcf7b3e0  
    33                   (this call is forwarded from Naming Service or Device Mapper) */
    44                ipcarg_t ipc_m_connect_me_to(void);
     5               
     6                /* Close connection */
     7                ipcarg_t ipc_m_phone_hungup(void);
    58};
  • contrib/arch/uspace/srv/pci/pci.adl

    r57688fe2 rcf7b3e0  
    11interface pci extends service {
    2                 /* Establish connection */
    3                 ipcarg_t ipc_m_connect_me_to(void);
    4                
    5                 /* Close connection */
    6                 ipcarg_t ipc_m_phone_hungup(void);
    72        protocol:
    83                [pci.bp]
     
    1611                ns ns;
    1712        protocol:
    18                 [/uspace/lib/libc/protocol] +
     13                [/uspace/lib/libc/protocol] |
    1914                [pci_server.bp]
    2015};
  • contrib/arch/uspace/srv/vfs/vfs.adl

    r57688fe2 rcf7b3e0  
    11interface vfs extends service {
    2                 /* Establish connection */
    3                 ipcarg_t ipc_m_connect_me_to(void);
    4                
    52                /* Register a filesystem driver */
    63                ipcarg_t register(in_copy string name);
     
    5552
    5653interface fs extends service {
    57                 /* Establish connection */
    58                 ipcarg_t ipc_m_connect_me_to(void);
    59                
    6054                /* Notify filesystem that it was mounted */
    6155                ipcarg_t mounted(in ipcarg_t dev_handle, in_copy string opts);
     
    8781                /* Notify on file close */
    8882                ipcarg_t close(in ipcarg_t dev_handle, in ipcarg_t fs_index);
    89                
    90                 /* Close connection */
    91                 ipcarg_t ipc_m_phone_hungup(void);
    9283};
    9384
    94 frame vfs_manager {
     85frame dispatcher {
    9586        provides:
    9687                vfs vfs;
    9788        requires:
    9889                [/uspace/lib/libc/requires]
    99                 fs fs;
     90                tmpfs tmpfs;
     91                fat fat;
     92                devfs devfs;
    10093                ns ns;
    10194        protocol:
    102                 [/uspace/lib/libc/protocol] +
     95                [/uspace/lib/libc/protocol] |
    10396                [vfs_server.bp]
    10497};
    10598
    10699architecture vfs {
    107         inst vfs_manager vfs;
     100        inst dispatcher dispatcher;
    108101        inst tmpfs tmpfs;
    109102        inst fat fat;
    110103        inst devfs devfs;
    111104       
    112         bind vfs:fs to tmpfs:fs;
    113         bind vfs:fs to fat:fs;
    114         bind vfs:fs to devfs:fs;
     105        bind dispatcher:tmpfs to tmpfs:tmpfs;
     106        bind dispatcher:fat to fat:fat;
     107        bind dispatcher:devfs to devfs:devfs;
    115108       
    116         bind tmpfs:vfs to vfs:vfs;
    117         bind fat:vfs to vfs:vfs;
    118         bind devfs:vfs to vfs:vfs;
     109        bind tmpfs:vfs to dispatcher:vfs;
     110        bind fat:vfs to dispatcher:vfs;
     111        bind devfs:vfs to dispatcher:vfs;
    119112       
    120         delegate vfs to vfs:vfs;
     113        delegate vfs to dispatcher:vfs;
    121114       
    122         [/uspace/lib/libc/subsume%vfs]
     115        [/uspace/lib/libc/subsume%dispatcher]
    123116        [/uspace/lib/libc/subsume%tmpfs]
    124117        [/uspace/lib/libc/subsume%fat]
    125118        [/uspace/lib/libc/subsume%devfs]
    126119       
    127         subsume vfs:ns to ns;
     120        subsume dispatcher:ns to ns;
    128121        subsume tmpfs:ns to ns;
    129122        subsume fat:ns to ns;
    130123        subsume devfs:ns to ns;
    131124       
    132         subsume tmpfs:bd to bd;
    133         subsume fat:bd to bd;
     125        subsume tmpfs:rd to rd;
     126        subsume fat:rd to rd;
    134127       
    135128        subsume devfs:devmap_client to devmap_client;
  • contrib/arch/uspace/srv/vfs/vfs.bp

    r57688fe2 rcf7b3e0  
    2121                                                (
    2222                                                        /* root fs */
    23                                                         !fs.mounted ;
    24                                                         !fs.ipc_m_data_write /* mount options */
     23                                                        alternative fs tmpfs fat devfs {
     24                                                                !fs.mounted ;
     25                                                                !fs.ipc_m_data_write /* mount options */
     26                                                        }
    2527                                                ) +
    2628                                                (
    2729                                                        /* non-root fs */
    2830                                                        tentative {
    29                                                                 [fnc.vfs_lookup_internal] ;
    30                                                                 tentative {
    31                                                                         [fnc.vfs_grab_phone] ;
    32                                                                         [fnc.vfs_grab_phone] ;
    33                                                                         !fs.mount ;
    34                                                                         !fs.ipc_m_connection_clone ;
    35                                                                         [fnc.vfs_release_phone] ;
     31                                                                alternative fs tmpfs fat devfs {
     32                                                                        [fnc.vfs_lookup_internal] ;
    3633                                                                        tentative {
    37                                                                                 !fs.vfs_m_data_write /* mount options */
    38                                                                         } ;
    39                                                                         [fnc.vfs_release_phone]
     34                                                                                [fnc.vfs_grab_phone] ;
     35                                                                                [fnc.vfs_grab_phone] ;
     36                                                                                !fs.mount ;
     37                                                                                !fs.ipc_m_connection_clone ;
     38                                                                                [fnc.vfs_release_phone] ;
     39                                                                                tentative {
     40                                                                                        !fs.vfs_m_data_write /* mount options */
     41                                                                                } ;
     42                                                                                [fnc.vfs_release_phone]
     43                                                                        }
    4044                                                                }
    4145                                                        }
     
    5155                        ?ipc_m_data_write /* path */ ;
    5256                        tentative {
    53                                 [fnc.vfs_lookup_internal] ;
    54                                 tentative {
     57                                alternative fs tmpfs fat devfs {
     58                                        [fnc.vfs_lookup_internal] ;
     59                                        tentative {
     60                                                [fnc.vfs_grab_phone] ;
     61                                                !fs.truncate ;
     62                                                [fnc.vfs_release_phone]
     63                                        }
     64                                }
     65                        }
     66                }
     67        } +
     68       
     69        ?open_node {
     70                alternative fs tmpfs fat devfs {
     71                        [fnc.vfs_open_node_internal] ;
     72                        tentative {
     73                                [fnc.vfs_grab_phone] ;
     74                                !fs.truncate ;
     75                                [fnc.vfs_release_phone]
     76                        }
     77                }
     78        } +
     79       
     80        ?close {
     81                tentative {
     82                        alternative fs tmpfs fat devfs {
     83                                [fnc.vfs_grab_phone] ;
     84                                !fs.close ;
     85                                [fnc.vfs_release_phone]
     86                        }
     87                }
     88        } +
     89       
     90        ?read {
     91                tentative {
     92                        ?ipc_m_data_read {
     93                                alternative fs tmpfs fat devfs {
    5594                                        [fnc.vfs_grab_phone] ;
    56                                         !fs.truncate ;
     95                                        !fs.read ;
     96                                        !fs.ipc_m_data_read /* forward payload */ ;
    5797                                        [fnc.vfs_release_phone]
    5898                                }
     
    61101        } +
    62102       
    63         ?open_node {
    64                 [fnc.vfs_open_node_internal] ;
    65                 tentative {
    66                         [fnc.vfs_grab_phone] ;
    67                         !fs.truncate ;
    68                         [fnc.vfs_release_phone]
    69                 }
    70         } +
    71        
    72         ?close {
    73                 tentative {
    74                         [fnc.vfs_grab_phone] ;
    75                         !fs.close ;
    76                         [fnc.vfs_release_phone]
    77                 }
    78         } +
    79        
    80         ?read {
    81                 tentative {
    82                         ?ipc_m_data_read {
     103        ?write {
     104                tentative {
     105                        ?ipc_m_data_write {
     106                                alternative fs tmpfs fat devfs {
     107                                        [fnc.vfs_grab_phone] ;
     108                                        !fs.write ;
     109                                        !fs.ipc_m_data_write /* forward payload */ ;
     110                                        [fnc.vfs_release_phone]
     111                                }
     112                        }
     113                }
     114        } +
     115       
     116        ?truncate {
     117                tentative {
     118                        alternative fs tmpfs fat devfs {
    83119                                [fnc.vfs_grab_phone] ;
    84                                 !fs.read ;
    85                                 !fs.ipc_m_data_read /* forward payload */ ;
     120                                !fs.truncate ;
    86121                                [fnc.vfs_release_phone]
    87122                        }
     
    89124        } +
    90125       
    91         ?write {
    92                 tentative {
    93                         ?ipc_m_data_write {
    94                                 [fnc.vfs_grab_phone] ;
    95                                 !fs.write ;
    96                                 !fs.ipc_m_data_write /* forward payload */ ;
    97                                 [fnc.vfs_release_phone]
    98                         }
    99                 }
    100         } +
    101        
    102         ?truncate {
    103                 tentative {
    104                         [fnc.vfs_grab_phone] ;
    105                         !fs.truncate ;
    106                         [fnc.vfs_release_phone]
    107                 }
    108         } +
    109        
    110126        ?fstat {
    111127                tentative {
    112128                        ?ipc_m_data_read /* struct stat */ {
    113                                 [fnc.vfs_grab_phone] ;
    114                                 !fs.stat ;
    115                                 !fs.ipc_m_data_read /* forward struct stat */ ;
    116                                 [fnc.vfs_release_phone]
     129                                alternative fs tmpfs fat devfs {
     130                                        [fnc.vfs_grab_phone] ;
     131                                        !fs.stat ;
     132                                        !fs.ipc_m_data_read /* forward struct stat */ ;
     133                                        [fnc.vfs_release_phone]
     134                                }
    117135                        }
    118136                }
     
    123141                tentative {
    124142                        ?ipc_m_data_read /* struct stat */ {
    125                                 [fnc.vfs_lookup_internal] ;
    126                                 tentative {
    127                                         !fs.stat ;
    128                                         !fs.ipc_m_data_read /* forward struct stat */
     143                                alternative fs tmpfs fat devfs {
     144                                        [fnc.vfs_lookup_internal] ;
     145                                        tentative {
     146                                                !fs.stat ;
     147                                                !fs.ipc_m_data_read /* forward struct stat */
     148                                        }
    129149                                }
    130150                        }
     
    135155                ?ipc_m_data_write /* path */ ;
    136156                tentative {
    137                         [fnc.vfs_lookup_internal]
     157                        alternative fs tmpfs fat devfs {
     158                                [fnc.vfs_lookup_internal]
     159                        }
    138160                }
    139161        } +
     
    142164                ?ipc_m_data_write /* path */ ;
    143165                tentative {
    144                         [fnc.vfs_lookup_internal]
     166                        alternative fs tmpfs fat devfs {
     167                                [fnc.vfs_lookup_internal]
     168                        }
    145169                }
    146170        } +
     
    151175                        ?ipc_m_data_write /* new path */ ;
    152176                        tentative {
    153                                 [fnc.vfs_lookup_internal] /* lookup old path */ ;
    154                                 tentative {
    155                                         [fnc.vfs_lookup_internal] /* lookup parent of new path */ ;
    156                                         tentative {
    157                                                 [fnc.vfs_lookup_internal] /* destroy old link for the new path */ ;
     177                                alternative fs tmpfs fat devfs {
     178                                        [fnc.vfs_lookup_internal] /* lookup old path */ ;
     179                                        tentative {
     180                                                [fnc.vfs_lookup_internal] /* lookup parent of new path */ ;
    158181                                                tentative {
    159                                                         [fnc.vfs_lookup_internal] /* create new link for the new path */ ;
     182                                                        [fnc.vfs_lookup_internal] /* destroy old link for the new path */ ;
    160183                                                        tentative {
    161                                                                 [fnc.vfs_lookup_internal] /* destroy link for the old path */
     184                                                                [fnc.vfs_lookup_internal] /* create new link for the new path */ ;
     185                                                                tentative {
     186                                                                        [fnc.vfs_lookup_internal] /* destroy link for the old path */
     187                                                                }
    162188                                                        }
    163189                                                }
     
    170196        ?sync {
    171197                tentative {
    172                         !fs.sync
     198                        alternative fs tmpfs fat devfs {
     199                                !fs.sync
     200                        }
    173201                }
    174202        } +
Note: See TracChangeset for help on using the changeset viewer.