svn commit: r206974 - user/jmallett/octeon/sys/contrib/octeon-sdk

Juli Mallett jmallett at FreeBSD.org
Wed Apr 21 01:39:52 UTC 2010


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)


More information about the svn-src-user mailing list