| 69 | ****************************************************************************/ |
| 70 | |
| 71 | static int builtin_loadbinary(FAR struct binary_s *binp, |
| 72 | FAR const char *filename, |
| 73 | FAR const struct symtab_s *exports, |
| 74 | int nexports) |
| 75 | { |
| 76 | FAR const struct builtin_s *builtin; |
| 77 | FAR char *name; |
| 78 | int index; |
| 79 | |
| 80 | binfo("Loading file: %s\n", filename); |
| 81 | |
| 82 | name = strrchr(filename, '/'); |
| 83 | if (name != NULL) |
| 84 | { |
| 85 | filename = name + 1; |
| 86 | } |
| 87 | |
| 88 | /* Looking up the index to this name in g_builtins[] */ |
| 89 | |
| 90 | index = builtin_isavail(filename); |
| 91 | if (index < 0) |
| 92 | { |
| 93 | berr("ERROR: %s is not a builtin application\n", filename); |
| 94 | return index; |
| 95 | } |
| 96 | |
| 97 | /* Return the load information. NOTE: that there is no way to configure |
| 98 | * the priority. That is a bug and needs to be fixed. |
| 99 | */ |
| 100 | |
| 101 | builtin = builtin_for_index(index); |
| 102 | if (builtin == NULL) |
| 103 | { |
| 104 | berr("ERROR: %s is not a builtin application\n", filename); |
| 105 | return -ENOENT; |
| 106 | } |
| 107 | |
| 108 | binp->entrypt = builtin->main; |
| 109 | binp->stacksize = builtin->stacksize; |
| 110 | binp->priority = builtin->priority; |
| 111 | #ifdef CONFIG_SCHED_USER_IDENTITY |
| 112 | binp->uid = builtin->uid; |
| 113 | binp->gid = builtin->gid; |
| 114 | binp->mode = builtin->mode; |
| 115 | #endif |
| 116 | |
| 117 | return OK; |
| 118 | } |
| 119 | |
| 120 | /**************************************************************************** |
| 121 | * Public Functions |
nothing calls this directly
no test coverage detected