Now, the framework can bi compiled with Aquosa supoprt, but test not
requring aquosa can run without aquosa kernel. Aquosa is initialized
just before the first contract for CPU is negotiated.
MSG(BLOCK_DUP);
MSG(NO_RESOURCE_ALLOCATOR);
MSG(ADMISSION_TEST);
MSG(BLOCK_DUP);
MSG(NO_RESOURCE_ALLOCATOR);
MSG(ADMISSION_TEST);
+ MSG(KERNEL_SUPPORT_MISSING);
}
if (s == NULL) return FRSH_ERR_BAD_ARGUMENT;
}
if (s == NULL) return FRSH_ERR_BAD_ARGUMENT;
FRES_ERR_BLOCK_DUP,
FRES_ERR_NO_RESOURCE_ALLOCATOR,
FRES_ERR_ADMISSION_TEST,
FRES_ERR_BLOCK_DUP,
FRES_ERR_NO_RESOURCE_ALLOCATOR,
FRES_ERR_ADMISSION_TEST,
+ FRES_ERR_KERNEL_SUPPORT_MISSING,
};
int fres_strerror (int error, char *message, size_t size);
};
int fres_strerror (int error, char *message, size_t size);
+int aqcpu_fra_activate(forb_orb orb)
+{
+ qos_rv qrv;
+ if ((qrv = qres_init()) != QOS_OK) {
+ if (qrv == QOS_E_MISSING_COMPONENT) {
+ return FRES_ERR_KERNEL_SUPPORT_MISSING;
+ } else
+ return FRSH_ERR_INTERNAL_ERROR;
+ }
+
+ /* install the cleanup function of th AQuoSA framework as an exit
+ * handler function (quite futile but, for now, it's sufficent) */
+ if (atexit(aqcpu_cleanup_wrapper))
+ return(FRSH_ERR_INTERNAL_ERROR);
+
+ aqcpu_initialized = 1;
+
+ return 0;
+}
+
static struct fres_allocator aqcpu_allocator = {
.res_type = FRSH_RT_PROCESSOR,
.res_id = 0, /* CPU ID 0 */
static struct fres_allocator aqcpu_allocator = {
.res_type = FRSH_RT_PROCESSOR,
.res_id = 0, /* CPU ID 0 */
.get_desired_budget = fra_CPU_get_desired_budget,
.set_desired_budget = fra_CPU_set_desired_budget,
.get_actual_budget = fra_CPU_get_actual_budget,
.get_desired_budget = fra_CPU_get_desired_budget,
.set_desired_budget = fra_CPU_set_desired_budget,
.get_actual_budget = fra_CPU_get_actual_budget,
+
+ .activate_callback = aqcpu_fra_activate,
*/
int aqcpu_fra_init(void)
{
*/
int aqcpu_fra_init(void)
{
- if ((qrv = qres_init()) != QOS_OK) {
- return -1;
- }
-
if ((rv = fra_register(&aqcpu_allocator))) {
qres_cleanup();
return rv;
}
if ((rv = fra_register(&aqcpu_allocator))) {
qres_cleanup();
return rv;
}
- /* install the cleanup function of th AQuoSA framework as an exit
- * handler function (quite futile but, for now, it's sufficent) */
- if (atexit(aqcpu_cleanup_wrapper))
- return(FRSH_ERR_INTERNAL_ERROR);
-
- aqcpu_initialized = 1;
-