From 54c11ab660c45fb4a319020ff86475832de66e44 Mon Sep 17 00:00:00 2001 From: Geoffrey Challen Date: Thu, 31 Dec 2015 11:44:25 -0500 Subject: [PATCH] Kernel secret for automated testing. --- kern/include/kern/secret.h | 51 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 kern/include/kern/secret.h diff --git a/kern/include/kern/secret.h b/kern/include/kern/secret.h new file mode 100644 index 0000000..c055927 --- /dev/null +++ b/kern/include/kern/secret.h @@ -0,0 +1,51 @@ +/* + * NO NOT MODIFY THIS FILE + * + * All the contents of this file are overwritten during automated + * testing. Please consider this before changing anything in this file. + */ + +/* + * Copyright (c) 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009 + * The President and Fellows of Harvard College. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SECRET_H_ +#define _SECRET_H_ + +/* + * During automated testing this is set to a random 32-bit value, to ensure + * that the kernel is actually running the compiled binaries. A non-zero value + * can also be used as a flag to change test output. During normal testing + * this can be set to zero to disable printing the kernel secret and enable + * normal test output. + */ + +#define KERNEL_SECRET ((unsigned long long)1) // Cast for consistent printf +//#define KERNEL_SECRET ((unsigned long long)0) // Cast for consistent printf + +#endif /* _SECRET_H_ */