Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/amd64/stand/prekern Define utility functions as inl...
details: https://anonhg.NetBSD.org/src/rev/e123563b8849
branches: trunk
changeset: 827704:e123563b8849
user: maxv <maxv%NetBSD.org@localhost>
date: Thu Nov 09 15:56:56 2017 +0000
description:
Define utility functions as inlines in prekern.h.
diffstat:
sys/arch/amd64/stand/prekern/elf.c | 25 +------------------------
sys/arch/amd64/stand/prekern/prekern.h | 24 +++++++++++++++++++++++-
2 files changed, 24 insertions(+), 25 deletions(-)
diffs (77 lines):
diff -r ec0bf2070853 -r e123563b8849 sys/arch/amd64/stand/prekern/elf.c
--- a/sys/arch/amd64/stand/prekern/elf.c Thu Nov 09 15:53:40 2017 +0000
+++ b/sys/arch/amd64/stand/prekern/elf.c Thu Nov 09 15:56:56 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: elf.c,v 1.8 2017/11/09 15:24:39 maxv Exp $ */
+/* $NetBSD: elf.c,v 1.9 2017/11/09 15:56:56 maxv Exp $ */
/*
* Copyright (c) 2017 The NetBSD Foundation, Inc. All rights reserved.
@@ -49,29 +49,6 @@
static struct elfinfo eif;
static const char entrypoint[] = "start_prekern";
-/* XXX */
-static int
-memcmp(const char *a, const char *b, size_t c)
-{
- size_t i;
- for (i = 0; i < c; i++) {
- if (a[i] != b[i])
- return 1;
- }
- return 0;
-}
-static int
-strcmp(char *a, char *b)
-{
- size_t i;
- for (i = 0; a[i] != '\0'; i++) {
- if (a[i] != b[i])
- return 1;
- }
- return 0;
-}
-
-
static int
elf_check_header()
{
diff -r ec0bf2070853 -r e123563b8849 sys/arch/amd64/stand/prekern/prekern.h
--- a/sys/arch/amd64/stand/prekern/prekern.h Thu Nov 09 15:53:40 2017 +0000
+++ b/sys/arch/amd64/stand/prekern/prekern.h Thu Nov 09 15:56:56 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: prekern.h,v 1.5 2017/11/09 15:24:39 maxv Exp $ */
+/* $NetBSD: prekern.h,v 1.6 2017/11/09 15:56:56 maxv Exp $ */
/*
* Copyright (c) 2017 The NetBSD Foundation, Inc. All rights reserved.
@@ -69,6 +69,28 @@
}
}
+static inline int
+memcmp(const char *a, const char *b, size_t c)
+{
+ size_t i;
+ for (i = 0; i < c; i++) {
+ if (a[i] != b[i])
+ return 1;
+ }
+ return 0;
+}
+
+static inline int
+strcmp(char *a, char *b)
+{
+ size_t i;
+ for (i = 0; a[i] != '\0'; i++) {
+ if (a[i] != b[i])
+ return 1;
+ }
+ return 0;
+}
+
/* -------------------------------------------------------------------------- */
struct bootspace {
Home |
Main Index |
Thread Index |
Old Index