- for (x = 0; rtos_types[x]; x++) {
- if (0 == strcmp(cp, rtos_types[x]->name)) {
- /* found */
- break;
- }
- }
- if (rtos_types[x] == NULL) {
- Jim_SetResultFormatted(goi->interp, "Unknown rtos type %s, try one of ",
- cp);
- for (x = 0; rtos_types[x]; x++) {
- if (rtos_types[x + 1]) {
- Jim_AppendStrings(goi->interp,
- Jim_GetResult(goi->interp),
- rtos_types[x]->name,
- ", ", NULL);
- } else {
- Jim_AppendStrings(goi->interp,
- Jim_GetResult(goi->interp),
- " or ",
- rtos_types[x]->name, NULL);
- }
- }
- return JIM_ERR;
- }
+ /* rtos_qsymbol() will iterate over all RTOSes. Allocate
+ * target->rtos here, and set it to the first RTOS type. */
+ return os_alloc(target, rtos_types[0]);