mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
The code has devating from the prevailing style in many ways. Adjust spacing, indentation, position of operators, layout of multiline comments, removal of superfluous comments, constness, trailing commas, and use of unqualified 'unsigned'. No functional change. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
54 lines
1.2 KiB
C
54 lines
1.2 KiB
C
#include "xc_sr_common_x86.h"
|
|
|
|
int write_x86_tsc_info(struct xc_sr_context *ctx)
|
|
{
|
|
xc_interface *xch = ctx->xch;
|
|
struct xc_sr_rec_x86_tsc_info tsc = {};
|
|
struct xc_sr_record rec = {
|
|
.type = REC_TYPE_X86_TSC_INFO,
|
|
.length = sizeof(tsc),
|
|
.data = &tsc,
|
|
};
|
|
|
|
if ( xc_domain_get_tsc_info(xch, ctx->domid, &tsc.mode,
|
|
&tsc.nsec, &tsc.khz, &tsc.incarnation) < 0 )
|
|
{
|
|
PERROR("Unable to obtain TSC information");
|
|
return -1;
|
|
}
|
|
|
|
return write_record(ctx, &rec);
|
|
}
|
|
|
|
int handle_x86_tsc_info(struct xc_sr_context *ctx, struct xc_sr_record *rec)
|
|
{
|
|
xc_interface *xch = ctx->xch;
|
|
struct xc_sr_rec_x86_tsc_info *tsc = rec->data;
|
|
|
|
if ( rec->length != sizeof(*tsc) )
|
|
{
|
|
ERROR("X86_TSC_INFO record wrong size: length %u, expected %zu",
|
|
rec->length, sizeof(*tsc));
|
|
return -1;
|
|
}
|
|
|
|
if ( xc_domain_set_tsc_info(xch, ctx->domid, tsc->mode,
|
|
tsc->nsec, tsc->khz, tsc->incarnation) )
|
|
{
|
|
PERROR("Unable to set TSC information");
|
|
return -1;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
/*
|
|
* Local variables:
|
|
* mode: C
|
|
* c-file-style: "BSD"
|
|
* c-basic-offset: 4
|
|
* tab-width: 4
|
|
* indent-tabs-mode: nil
|
|
* End:
|
|
*/
|