Changeset 8e7c9fe in mainline for uspace/app/init/init.c


Ignore:
Timestamp:
2014-09-12T03:45:25Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c53b58e
Parents:
3eb0c85 (diff), 105d8d6 (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

most usb changes were reverted. blink and usbmass were fixed
known problems:
ehci won't initialize
usbmast asserts on unmount (happens on mainline too)

File:
1 edited

Legend:

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

    r3eb0c85 r8e7c9fe  
    5959#define TMPFS_FS_TYPE      "tmpfs"
    6060#define TMPFS_MOUNT_POINT  "/tmp"
    61 
    62 #define DATA_FS_TYPE      "fat"
    63 #define DATA_DEVICE       "bd/ata1disk0"
    64 #define DATA_MOUNT_POINT  "/data"
    6561
    6662#define SRV_CONSOLE  "/srv/console"
     
    176172        va_start(ap, path);
    177173        task_id_t id;
    178         int rc = task_spawn(&id, path, cnt, ap);
     174        task_wait_t wait;
     175        int rc = task_spawn(&id, &wait, path, cnt, ap);
    179176        va_end(ap);
    180177       
     
    193190        task_exit_t texit;
    194191        int retval;
    195         rc = task_wait(id, &texit, &retval);
     192        rc = task_wait(&wait, &texit, &retval);
    196193        if (rc != EOK) {
    197194                printf("%s: Error waiting for %s (%s)\n", NAME, path,
     
    257254       
    258255        task_id_t id;
    259         int rc = task_spawnl(&id, app, app, winreg, NULL);
     256        task_wait_t wait;
     257        int rc = task_spawnl(&id, &wait, app, app, winreg, NULL);
    260258        if (rc != EOK) {
    261259                printf("%s: Error spawning %s %s (%s)\n", NAME, app,
     
    266264        task_exit_t texit;
    267265        int retval;
    268         rc = task_wait(id, &texit, &retval);
     266        rc = task_wait(&wait, &texit, &retval);
    269267        if ((rc != EOK) || (texit != TASK_EXIT_NORMAL)) {
    270268                printf("%s: Error retrieving retval from %s (%s)\n", NAME,
     
    276274}
    277275
    278 static void getterm(const char *svc, const char *app, bool wmsg)
    279 {
    280         char term[LOC_NAME_MAXLEN];
    281         snprintf(term, LOC_NAME_MAXLEN, "%s/%s", LOCFS_MOUNT_POINT, svc);
    282        
    283         printf("%s: Spawning %s %s %s\n", NAME, APP_GETTERM, term, app);
    284        
    285         /* Wait for the terminal service to be ready */
    286         service_id_t service_id;
    287         int rc = loc_service_get_id(svc, &service_id, IPC_FLAG_BLOCKING);
    288         if (rc != EOK) {
    289                 printf("%s: Error waiting on %s (%s)\n", NAME, term,
    290                     str_error(rc));
    291                 return;
    292         }
    293        
    294         if (wmsg) {
    295                 rc = task_spawnl(NULL, APP_GETTERM, APP_GETTERM, "-w", term,
    296                     app, NULL);
    297                 if (rc != EOK) {
    298                         printf("%s: Error spawning %s -w %s %s (%s)\n", NAME,
    299                             APP_GETTERM, term, app, str_error(rc));
    300                 }
     276static void getterm(const char *svc, const char *app, bool msg)
     277{
     278        if (msg) {
     279                printf("%s: Spawning %s %s %s --msg --wait -- %s\n", NAME,
     280                    APP_GETTERM, svc, LOCFS_MOUNT_POINT, app);
     281               
     282                int rc = task_spawnl(NULL, NULL, APP_GETTERM, APP_GETTERM, svc,
     283                    LOCFS_MOUNT_POINT, "--msg", "--wait", "--", app, NULL);
     284                if (rc != EOK)
     285                        printf("%s: Error spawning %s %s %s --msg --wait -- %s\n",
     286                            NAME, APP_GETTERM, svc, LOCFS_MOUNT_POINT, app);
    301287        } else {
    302                 rc = task_spawnl(NULL, APP_GETTERM, APP_GETTERM, term, app,
    303                     NULL);
    304                 if (rc != EOK) {
    305                         printf("%s: Error spawning %s %s %s (%s)\n", NAME,
    306                             APP_GETTERM, term, app, str_error(rc));
    307                 }
     288                printf("%s: Spawning %s %s %s --wait -- %s\n", NAME,
     289                    APP_GETTERM, svc, LOCFS_MOUNT_POINT, app);
     290               
     291                int rc = task_spawnl(NULL, NULL, APP_GETTERM, APP_GETTERM, svc,
     292                    LOCFS_MOUNT_POINT, "--wait", "--", app, NULL);
     293                if (rc != EOK)
     294                        printf("%s: Error spawning %s %s %s --wait -- %s\n",
     295                            NAME, APP_GETTERM, svc, LOCFS_MOUNT_POINT, app);
    308296        }
    309297}
     
    316304}
    317305
    318 static bool mount_data(void)
    319 {
    320         int rc = mount(DATA_FS_TYPE, DATA_MOUNT_POINT, DATA_DEVICE, "wtcache", 0, 0);
    321         return mount_report("Data filesystem", DATA_MOUNT_POINT, DATA_FS_TYPE,
    322             DATA_DEVICE, rc);
    323 }
    324 
    325306int main(int argc, char *argv[])
    326307{
     
    350331        srv_start("/srv/apic");
    351332        srv_start("/srv/i8259");
     333        srv_start("/srv/icp-ic");
    352334        srv_start("/srv/obio");
    353335        srv_start("/srv/cuda_adb");
     
    367349        srv_start("/srv/remcons");
    368350       
    369         /*
    370          * Start these synchronously so that mount_data() can be
    371          * non-blocking.
    372          */
    373 #ifdef CONFIG_START_BD
    374         srv_start("/srv/ata_bd");
    375 #endif
    376        
    377 #ifdef CONFIG_MOUNT_DATA
    378         /* Make sure fat is running. */
    379         if (str_cmp(STRING(RDFMT), "fat") != 0)
    380                 srv_start("/srv/fat");
    381        
    382         mount_data();
    383 #else
    384         (void) mount_data;
    385 #endif
    386        
    387351        srv_start("/srv/input", HID_INPUT);
    388352        srv_start("/srv/output", HID_OUTPUT);
     
    393357                gui_start("/app/vlaunch", HID_COMPOSITOR_SERVER);
    394358                gui_start("/app/vterm", HID_COMPOSITOR_SERVER);
    395         } else {
    396                 rc = console(HID_INPUT, HID_OUTPUT);
    397                 if (rc == EOK) {
    398                         getterm("term/vc0", "/app/bdsh", true);
    399                         getterm("term/vc1", "/app/bdsh", false);
    400                         getterm("term/vc2", "/app/bdsh", false);
    401                         getterm("term/vc3", "/app/bdsh", false);
    402                         getterm("term/vc4", "/app/bdsh", false);
    403                         getterm("term/vc5", "/app/bdsh", false);
    404                         getterm("term/vc6", "/app/klog", false);
    405                 }
     359        }
     360       
     361        rc = console(HID_INPUT, HID_OUTPUT);
     362        if (rc == EOK) {
     363                getterm("term/vc0", "/app/bdsh", true);
     364                getterm("term/vc1", "/app/bdsh", false);
     365                getterm("term/vc2", "/app/bdsh", false);
     366                getterm("term/vc3", "/app/bdsh", false);
     367                getterm("term/vc4", "/app/bdsh", false);
     368                getterm("term/vc5", "/app/bdsh", false);
    406369        }
    407370       
Note: See TracChangeset for help on using the changeset viewer.