This source file includes following definitions.
- main
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #include <sys/types.h>
20
21 #include <err.h>
22 #include <fcntl.h>
23 #include <stdio.h>
24 #include <unistd.h>
25
26 #include "microcode.h"
27
28 #define THT_FW_NAME "tht"
29
30 int
31 main(int argc, char *argv[])
32 {
33 ssize_t len;
34 int fd;
35 int i;
36
37 fd = open(THT_FW_NAME, O_WRONLY | O_CREAT | O_TRUNC, 0644);
38 if (fd == -1)
39 err(1, "%s", THT_FW_NAME);
40
41 for (i = 0; i < (sizeof(tht_fw) / sizeof(tht_fw[0])); i++)
42 tht_fw[i] = htole32(tht_fw[i]);
43
44 len = write(fd, tht_fw, sizeof(tht_fw));
45 if (len == -1)
46 err(1, "%s write", THT_FW_NAME);
47 if (len != sizeof(tht_fw))
48 errx(1, "%s: short write", THT_FW_NAME);
49
50 close(fd);
51
52 return (0);
53 }