Module Name:    src
Committed By:   riz
Date:           Thu May 17 18:26:33 UTC 2012

Modified Files:
        src/tests/lib/libc/arch/powerpc [netbsd-6]: exec_prot_support.c
            return_one.S

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.4.1 \
    src/tests/lib/libc/arch/powerpc/exec_prot_support.c \
    src/tests/lib/libc/arch/powerpc/return_one.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/arch/powerpc/exec_prot_support.c
diff -u src/tests/lib/libc/arch/powerpc/exec_prot_support.c:1.1 src/tests/lib/libc/arch/powerpc/exec_prot_support.c:1.1.4.1
--- src/tests/lib/libc/arch/powerpc/exec_prot_support.c:1.1	Mon Jul 18 23:16:10 2011
+++ src/tests/lib/libc/arch/powerpc/exec_prot_support.c	Thu May 17 18:26:32 2012
@@ -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;
 }
Index: src/tests/lib/libc/arch/powerpc/return_one.S
diff -u src/tests/lib/libc/arch/powerpc/return_one.S:1.1 src/tests/lib/libc/arch/powerpc/return_one.S:1.1.4.1
--- src/tests/lib/libc/arch/powerpc/return_one.S:1.1	Mon Jul 18 23:16:10 2011
+++ src/tests/lib/libc/arch/powerpc/return_one.S	Thu May 17 18:26:32 2012
@@ -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)

Reply via email to