===== xen/acm/acm_core.c 1.1 vs edited ===== --- 1.1/xen/acm/acm_core.c 2005-06-21 07:28:06 +09:00 +++ edited/xen/acm/acm_core.c 2005-06-23 16:53:17 +09:00 @@ -79,6 +79,8 @@ acm_bin_pol.secondary_binary_policy = secondary; } +#if (ACM_USE_SECURITY_POLICY != ACM_NULL_POLICY) + int acm_init(void) { @@ -129,6 +131,7 @@ return ACM_OK; } +#endif int acm_init_domain_ssid(domid_t id, ssidref_t ssidref) ===== xen/include/acm/acm_hooks.h 1.2 vs edited ===== --- 1.2/xen/include/acm/acm_hooks.h 2005-06-22 23:18:11 +09:00 +++ edited/xen/include/acm/acm_hooks.h 2005-06-23 16:30:48 +09:00 @@ -30,6 +30,44 @@ #include #include +struct acm_operations { + /* policy management functions (must always be defined!) */ + int (*init_domain_ssid) (void **ssid, ssidref_t ssidref); + void (*free_domain_ssid) (void *ssid); + int (*dump_binary_policy) (u8 *buffer, u16 buf_size); + int (*set_binary_policy) (u8 *buffer, u16 buf_size); + int (*dump_statistics) (u8 *buffer, u16 buf_size); + /* domain management control hooks (can be NULL) */ + int (*pre_domain_create) (void *subject_ssid, ssidref_t ssidref); + void (*post_domain_create) (domid_t domid, ssidref_t ssidref); + void (*fail_domain_create) (void *subject_ssid, ssidref_t ssidref); + void (*post_domain_destroy) (void *object_ssid, domid_t id); + /* event channel control hooks (can be NULL) */ + int (*pre_eventchannel_unbound) (domid_t id); + void (*fail_eventchannel_unbound) (domid_t id); + int (*pre_eventchannel_interdomain) (domid_t id1, domid_t id2); + int (*fail_eventchannel_interdomain) (domid_t id1, domid_t id2); + /* grant table control hooks (can be NULL) */ + int (*pre_grant_map_ref) (domid_t id); + void (*fail_grant_map_ref) (domid_t id); + int (*pre_grant_setup) (domid_t id); + void (*fail_grant_setup) (domid_t id); +}; + +/* global variables */ +extern struct acm_operations *acm_primary_ops; +extern struct acm_operations *acm_secondary_ops; + +/* if ACM_TRACE_MODE defined, all hooks should + * print a short trace message */ +/* #define ACM_TRACE_MODE */ + +#ifdef ACM_TRACE_MODE +# define traceprintk(fmt, args...) printk(fmt,## args) +#else +# define traceprintk(fmt, args...) +#endif + #if (ACM_USE_SECURITY_POLICY == ACM_NULL_POLICY) static inline int acm_pre_dom0_op(dom0_op_t *op, void **ssid) @@ -51,20 +89,6 @@ #else -/* if ACM_TRACE_MODE defined, all hooks should - * print a short trace message */ -/* #define ACM_TRACE_MODE */ - -#ifdef ACM_TRACE_MODE -# define traceprintk(fmt, args...) printk(fmt,## args) -#else -# define traceprintk(fmt, args...) -#endif - -/* global variables */ -extern struct acm_operations *acm_primary_ops; -extern struct acm_operations *acm_secondary_ops; - /********************************************************************* * HOOK structure and meaning (justifies a few words about our model): * @@ -123,30 +147,6 @@ * sys-ops error * ********************************************************************/ - -struct acm_operations { - /* policy management functions (must always be defined!) */ - int (*init_domain_ssid) (void **ssid, ssidref_t ssidref); - void (*free_domain_ssid) (void *ssid); - int (*dump_binary_policy) (u8 *buffer, u16 buf_size); - int (*set_binary_policy) (u8 *buffer, u16 buf_size); - int (*dump_statistics) (u8 *buffer, u16 buf_size); - /* domain management control hooks (can be NULL) */ - int (*pre_domain_create) (void *subject_ssid, ssidref_t ssidref); - void (*post_domain_create) (domid_t domid, ssidref_t ssidref); - void (*fail_domain_create) (void *subject_ssid, ssidref_t ssidref); - void (*post_domain_destroy) (void *object_ssid, domid_t id); - /* event channel control hooks (can be NULL) */ - int (*pre_eventchannel_unbound) (domid_t id); - void (*fail_eventchannel_unbound) (domid_t id); - int (*pre_eventchannel_interdomain) (domid_t id1, domid_t id2); - int (*fail_eventchannel_interdomain) (domid_t id1, domid_t id2); - /* grant table control hooks (can be NULL) */ - int (*pre_grant_map_ref) (domid_t id); - void (*fail_grant_map_ref) (domid_t id); - int (*pre_grant_setup) (domid_t id); - void (*fail_grant_setup) (domid_t id); -}; static inline int acm_pre_domain_create(void *subject_ssid, ssidref_t ssidref) {