Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-6]: src/tests/lib/libc/arch/powerpc Pull up following revision(s)...
details: https://anonhg.NetBSD.org/src/rev/baf60b80cd77
branches: netbsd-6
changeset: 774109:baf60b80cd77
user: riz <riz%NetBSD.org@localhost>
date: Thu May 17 18:26:32 2012 +0000
description:
Pull up following revision(s) (requested by matt in ticket #252):
tests/lib/libc/arch/powerpc/exec_prot_support.c: revision 1.2
tests/lib/libc/arch/powerpc/return_one.S: revision 1.2
Allow testing of exec pages on PowerPC BookE.
Make return_one actually do the right thing.
diffstat:
tests/lib/libc/arch/powerpc/exec_prot_support.c | 21 ++++++++++++++++-----
tests/lib/libc/arch/powerpc/return_one.S | 11 +++++++----
2 files changed, 23 insertions(+), 9 deletions(-)
diffs (63 lines):
diff -r 618aa3a2192b -r baf60b80cd77 tests/lib/libc/arch/powerpc/exec_prot_support.c
--- a/tests/lib/libc/arch/powerpc/exec_prot_support.c Thu May 17 18:25:15 2012 +0000
+++ b/tests/lib/libc/arch/powerpc/exec_prot_support.c Thu May 17 18:26:32 2012 +0000
@@ -1,11 +1,11 @@
-/* $NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:10 jym Exp $ */
+/* $NetBSD: exec_prot_support.c,v 1.1.4.1 2012/05/17 18:26:32 riz Exp $ */
/*-
- * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
- * by Jean-Yves Migeon.
+ * by Matt Thomas of 3am Software Foundry.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,12 +30,23 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: exec_prot_support.c,v 1.1 2011/07/18 23:16:10 jym Exp $");
+__RCSID("$NetBSD: exec_prot_support.c,v 1.1.4.1 2012/05/17 18:26:32 riz Exp $");
#include "../../common/exec_prot.h"
+#include <sys/sysctl.h>
+
int
exec_prot_support(void)
{
- return NOTIMPL;
+ int execprot = 0;
+ size_t len = sizeof(execprot);
+
+ if (sysctlbyname("machdep.execprot", &execprot, &len, NULL, 0) < 0)
+ return NOTIMPL;
+
+ if (execprot)
+ return PERPAGE_XP;
+
+ return NO_XP;
}
diff -r 618aa3a2192b -r baf60b80cd77 tests/lib/libc/arch/powerpc/return_one.S
--- a/tests/lib/libc/arch/powerpc/return_one.S Thu May 17 18:25:15 2012 +0000
+++ b/tests/lib/libc/arch/powerpc/return_one.S Thu May 17 18:26:32 2012 +0000
@@ -1,8 +1,11 @@
-/* $NetBSD: return_one.S,v 1.1 2011/07/18 23:16:10 jym Exp $ */
+/* $NetBSD: return_one.S,v 1.1.4.1 2012/05/17 18:26:32 riz Exp $ */
#include <machine/asm.h>
-.globl return_one, return_one_end;
+.globl return_one, return_one_end
-return_one: return_one_end:
- nop
+_ENTRY(return_one)
+ li %r3, 1
+ blr
+return_one_end:
+END(return_one)
Home |
Main Index |
Thread Index |
Old Index