Print this page
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/test/os-tests/tests/xsave/xregs_dump.c
+++ new/usr/src/test/os-tests/tests/xsave/xregs_dump.c
1 1 /*
2 2 * This file and its contents are supplied under the terms of the
3 3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 4 * You may only use this file in accordance with the terms of version
5 5 * 1.0 of the CDDL.
6 6 *
7 7 * A full copy of the text of the CDDL should have accompanied this
8 8 * source. A copy of the CDDL is also available via the Internet at
9 9 * http://www.illumos.org/license/CDDL.
10 10 */
11 11
12 12 /*
13 13 * Copyright 2023 Oxide Computer Company
14 14 */
15 15
16 16 /*
17 17 * This is a simple program that is meant for use as other programs consuming
18 18 * it. It simply reads the extended registers and dumps them. The expectation
19 19 * is someone else is showing up and doing something ahead of that.
20 20 */
21 21
22 22 #include <err.h>
23 23 #include <stdio.h>
24 24 #include <stdlib.h>
25 25
26 26 #include "xsave_util.h"
27 27
28 28 static xsu_fpu_t fpu;
29 29
30 30 int
31 31 main(int argc, char *argv[])
32 32 {
33 33 FILE *f;
34 34 uint32_t hwsup;
35 35
36 36 if (argc != 2) {
37 37 errx(EXIT_FAILURE, "missing required filename to write to");
38 38 }
39 39
40 40 hwsup = xsu_hwsupport();
41 41 f = fopen(argv[1], "w+");
42 42 if (f == NULL) {
43 43 err(EXIT_FAILURE, "failed to open %s", argv[1]);
44 44 }
45 45
46 46 xsu_getfpu(&fpu, hwsup);
47 47 xsu_dump(f, &fpu, hwsup);
48 48
49 49 return (EXIT_SUCCESS);
50 50 }
|
↓ open down ↓ |
50 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX