Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic dev/ic/tpm: Tidy up headers.
details: https://anonhg.NetBSD.org/src/rev/0b45c86f604c
branches: trunk
changeset: 958428:0b45c86f604c
user: riastradh <riastradh%NetBSD.org@localhost>
date: Mon Jan 04 18:22:19 2021 +0000
description:
dev/ic/tpm: Tidy up headers.
- Add include guards.
- Add necessary includes.
- Sort includes.
- Use _BYTE_ORDER, not BYTE_ORDER, for public header.
diffstat:
sys/dev/ic/tpm.c | 16 +++++++++-------
sys/dev/ic/tpmreg.h | 14 ++++++++++++--
sys/dev/ic/tpmvar.h | 13 ++++++++++++-
3 files changed, 33 insertions(+), 10 deletions(-)
diffs (105 lines):
diff -r 5d3b8a44c896 -r 0b45c86f604c sys/dev/ic/tpm.c
--- a/sys/dev/ic/tpm.c Mon Jan 04 18:19:53 2021 +0000
+++ b/sys/dev/ic/tpm.c Mon Jan 04 18:22:19 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tpm.c,v 1.16 2019/10/09 14:03:58 maxv Exp $ */
+/* $NetBSD: tpm.c,v 1.17 2021/01/04 18:22:19 riastradh Exp $ */
/*
* Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -48,17 +48,19 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tpm.c,v 1.16 2019/10/09 14:03:58 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tpm.c,v 1.17 2021/01/04 18:22:19 riastradh Exp $");
#include <sys/param.h>
-#include <sys/systm.h>
+#include <sys/types.h>
+
+#include <sys/bus.h>
+#include <sys/conf.h>
+#include <sys/device.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
+#include <sys/pmf.h>
#include <sys/proc.h>
-#include <sys/device.h>
-#include <sys/conf.h>
-#include <sys/bus.h>
-#include <sys/pmf.h>
+#include <sys/systm.h>
#include <dev/ic/tpmreg.h>
#include <dev/ic/tpmvar.h>
diff -r 5d3b8a44c896 -r 0b45c86f604c sys/dev/ic/tpmreg.h
--- a/sys/dev/ic/tpmreg.h Mon Jan 04 18:19:53 2021 +0000
+++ b/sys/dev/ic/tpmreg.h Mon Jan 04 18:22:19 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tpmreg.h,v 1.6 2019/10/09 07:30:58 maxv Exp $ */
+/* $NetBSD: tpmreg.h,v 1.7 2021/01/04 18:22:19 riastradh Exp $ */
/*
* Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -29,7 +29,15 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#if (BYTE_ORDER == LITTLE_ENDIAN)
+#ifndef DEV_IC_TPMREG_H
+#define DEV_IC_TPMREG_H
+
+#include <sys/types.h>
+
+#include <sys/cdefs.h>
+#include <sys/endian.h>
+
+#if (_BYTE_ORDER == _LITTLE_ENDIAN)
#define TPM_BE16(a) bswap16(a)
#define TPM_BE32(a) bswap32(a)
#else
@@ -105,3 +113,5 @@
* Five localities, 4K per locality.
*/
#define TPM_SPACE_SIZE 0x5000
+
+#endif /* DEV_IC_TPMREG_H */
diff -r 5d3b8a44c896 -r 0b45c86f604c sys/dev/ic/tpmvar.h
--- a/sys/dev/ic/tpmvar.h Mon Jan 04 18:19:53 2021 +0000
+++ b/sys/dev/ic/tpmvar.h Mon Jan 04 18:22:19 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tpmvar.h,v 1.7 2019/10/09 14:03:58 maxv Exp $ */
+/* $NetBSD: tpmvar.h,v 1.8 2021/01/04 18:22:19 riastradh Exp $ */
/*
* Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -29,6 +29,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#ifndef DEV_IC_TPMVAR_H
+#define DEV_IC_TPMVAR_H
+
+#include <sys/types.h>
+
#define TPM_API_VERSION 1
enum tpm_version {
@@ -54,6 +59,10 @@
#ifdef _KERNEL
+#include <sys/bus.h>
+#include <sys/device_if.h>
+#include <sys/mutex.h>
+
struct tpm_softc;
struct tpm_intf {
@@ -88,3 +97,5 @@
bool tpm_resume(device_t, const pmf_qual_t *);
#endif
+
+#endif /* DEV_IC_TPMVAR_H */
Home |
Main Index |
Thread Index |
Old Index