From owner-svn-soc-all@FreeBSD.ORG Fri Jul 18 07:47:48 2014 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F3D2695 for ; Fri, 18 Jul 2014 07:47:48 +0000 (UTC) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 611CC2507 for ; Fri, 18 Jul 2014 07:47:48 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6I7lmmq052725 for ; Fri, 18 Jul 2014 07:47:48 GMT (envelope-from op@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.8/8.14.8/Submit) id s6I7llCU052698 for svn-soc-all@FreeBSD.org; Fri, 18 Jul 2014 07:47:47 GMT (envelope-from op@FreeBSD.org) Date: Fri, 18 Jul 2014 07:47:47 GMT Message-Id: <201407180747.s6I7llCU052698@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to op@FreeBSD.org using -f From: op@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r271053 - in soc2014/op/freebsd-base/sys: conf kern sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 07:47:48 -0000 Author: op Date: Fri Jul 18 07:47:46 2014 New Revision: 271053 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=271053 Log: KSP: added basic structures and files git: https://github.com/opntr/opBSD/tree/op/gsoc2014/kpatch Signed-off-by: Oliver Pinter --- sys/conf/files.amd64 | 1 + sys/kern/kern_selfpatch.c | 39 +++++++++++++++++++++++++++++++++++++++ sys/sys/selfpatch.h | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 sys/kern/kern_selfpatch.c create mode 100644 sys/sys/selfpatch.h Added: soc2014/op/freebsd-base/sys/kern/kern_selfpatch.c soc2014/op/freebsd-base/sys/sys/selfpatch.h Modified: soc2014/op/freebsd-base/sys/conf/files.amd64 Modified: soc2014/op/freebsd-base/sys/conf/files.amd64 ============================================================================== --- soc2014/op/freebsd-base/sys/conf/files.amd64 Fri Jul 18 07:41:07 2014 (r271052) +++ soc2014/op/freebsd-base/sys/conf/files.amd64 Fri Jul 18 07:47:46 2014 (r271053) @@ -439,6 +439,7 @@ isa/syscons_isa.c optional sc isa/vga_isa.c optional vga kern/kern_clocksource.c standard +kern/kern_selfpatch.c standard kern/link_elf_obj.c standard # # IA32 binary support Added: soc2014/op/freebsd-base/sys/kern/kern_selfpatch.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2014/op/freebsd-base/sys/kern/kern_selfpatch.c Fri Jul 18 07:47:46 2014 (r271053) @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2014, by Oliver Pinter + * All rights reserved. + * + * 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. + * + * $FreeBSD$ + */ + +#include + +#include +#include +#include +#include + +#include +#include + +#include Added: soc2014/op/freebsd-base/sys/sys/selfpatch.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2014/op/freebsd-base/sys/sys/selfpatch.h Fri Jul 18 07:47:46 2014 (r271053) @@ -0,0 +1,35 @@ +/*- + * Copyright (c) 2014, by Oliver Pinter + * All rights reserved. + * + * 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. + * + * $FreeBSD$ + */ + +typedef struct lf_selfpatch { + void *patchable; + void *patch; + short feature_selector; + int feature; + char *comment; +} lf_selfpatch_t;