From owner-svn-src-user@FreeBSD.ORG Wed Apr 21 01:39:52 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 707E4106564A; Wed, 21 Apr 2010 01:39:52 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 553798FC14; Wed, 21 Apr 2010 01:39:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3L1dqrF007527; Wed, 21 Apr 2010 01:39:52 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3L1dqJL007523; Wed, 21 Apr 2010 01:39:52 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201004210139.o3L1dqJL007523@svn.freebsd.org> From: Juli Mallett Date: Wed, 21 Apr 2010 01:39:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206974 - user/jmallett/octeon/sys/contrib/octeon-sdk X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2010 01:39:52 -0000 Author: jmallett Date: Wed Apr 21 01:39:52 2010 New Revision: 206974 URL: http://svn.freebsd.org/changeset/base/206974 Log: o) Fix one case of missing CVMX_DONT_INCLUDE_CONFIG. o) Add physical<->virtual mapping code for FreeBSD kernel. o) Define away CVMX_SHARED when building for FreeBSD kernel. Modified: user/jmallett/octeon/sys/contrib/octeon-sdk/cvmx-access-native.h user/jmallett/octeon/sys/contrib/octeon-sdk/cvmx-cmd-queue.h user/jmallett/octeon/sys/contrib/octeon-sdk/cvmx-platform.h Modified: user/jmallett/octeon/sys/contrib/octeon-sdk/cvmx-access-native.h ============================================================================== --- user/jmallett/octeon/sys/contrib/octeon-sdk/cvmx-access-native.h Wed Apr 21 01:13:08 2010 (r206973) +++ user/jmallett/octeon/sys/contrib/octeon-sdk/cvmx-access-native.h Wed Apr 21 01:39:52 2010 (r206974) @@ -122,6 +122,8 @@ static inline uint64_t cvmx_ptr_to_phys( return address + 0x400000000ull; /* 256MB-512MB is a virtual mapping for the 2nd 256MB */ else return address; /* Looks to be a 1:1 mapped userspace pointer */ +#elif defined(__FreeBSD__) && defined(_KERNEL) + return (pmap_kextract((vm_offset_t)ptr)); #else #if CVMX_USE_1_TO_1_TLB_MAPPINGS /* We are assumung we're running the Simple Executive standalone. In this @@ -201,6 +203,15 @@ static inline void *cvmx_phys_to_ptr(uin return CASTPTR(void, physical_address - 0x400000000ull); else return CASTPTR(void, physical_address); +#elif defined(__FreeBSD__) && defined(_KERNEL) +#if defined(__mips_n64) + return CASTPTR(void, CVMX_ADD_SEG(CVMX_MIPS_SPACE_XKPHYS, physical_address)); +#else + if (physical_address < 0x20000000) + return CASTPTR(void, CVMX_ADD_SEG32(CVMX_MIPS32_SPACE_KSEG0, physical_address)); + else + panic("%s: mapping high address (%#jx) not yet supported.\n", __func__, (uintmax_t)physical_address); +#endif #else #if CVMX_USE_1_TO_1_TLB_MAPPINGS Modified: user/jmallett/octeon/sys/contrib/octeon-sdk/cvmx-cmd-queue.h ============================================================================== --- user/jmallett/octeon/sys/contrib/octeon-sdk/cvmx-cmd-queue.h Wed Apr 21 01:13:08 2010 (r206973) +++ user/jmallett/octeon/sys/contrib/octeon-sdk/cvmx-cmd-queue.h Wed Apr 21 01:39:52 2010 (r206974) @@ -92,8 +92,10 @@ #ifndef __CVMX_CMD_QUEUE_H__ #define __CVMX_CMD_QUEUE_H__ +#ifndef CVMX_DONT_INCLUDE_CONFIG #include "executive-config.h" #include "cvmx-config.h" +#endif #include "cvmx-fpa.h" #ifdef __cplusplus Modified: user/jmallett/octeon/sys/contrib/octeon-sdk/cvmx-platform.h ============================================================================== --- user/jmallett/octeon/sys/contrib/octeon-sdk/cvmx-platform.h Wed Apr 21 01:13:08 2010 (r206973) +++ user/jmallett/octeon/sys/contrib/octeon-sdk/cvmx-platform.h Wed Apr 21 01:39:52 2010 (r206974) @@ -119,7 +119,11 @@ * This is for data structures use by software ONLY, * as it is not 1-1 VA-PA mapped. */ +#if defined(CVMX_BUILD_FOR_FREEBSD) +#define CVMX_SHARED +#else #define CVMX_SHARED __attribute__ ((cvmx_shared)) +#endif #if defined(CVMX_BUILD_FOR_UBOOT)