]> rtime.felk.cvut.cz Git - frescor/fwp.git/blob - frsh_aquosa/cpu_contract.c
e71132e7904613d35c1b0225f4e0747eef8dfc55
[frescor/fwp.git] / frsh_aquosa / cpu_contract.c
1 #include "cpu_contract.h"
2
3 int get_cpu_vres(contract_t contract, qres_sid_t *vres)
4 {
5         return 0;
6 }
7
8 int set_cpu_vres(contract_t contract, qres_sid_t vres)
9 {
10         return 0;
11 }
12
13 int get_cpu_params(contract_t *contract, cpu_params_t *cpu_params)
14 {
15         /* core contract parameters */
16         cpu_params->Q_min = timespec_to_usec(contract->budget_min);
17         cpu_params->P = timespec_to_usec(contract->period_max);
18         /* non-core contract parameters */
19         cpu_params->Q = timespec_to_usec(contract->budget_max);
20         /* AQuoSA specific configuration */
21         cpu_params->flags = 0x000;
22         cpu_params->flags |= QOS_F_PERSISTENT;
23         /* if we're negotiating for the service thread create 
24          * a soft server */
25         if (contract == &service_th_contract) {
26                         qres_contract.flags |= QOS_F_SOFT;
27         }
28                         
29         cpu_params->timeout = 0;
30 }
31
32 int set_cpu_params(contract_t *contract, cpu_params_t *cpu_params)
33 {
34         return 0;
35 }