From 49290fec5b79ea4464b7b6db018bc1f03e4b6e49 Mon Sep 17 00:00:00 2001 From: Vishal Mahaveer Date: Mon, 10 Jun 2013 15:28:26 -0500 Subject: [PATCH] proprietary-open: jacinto6: add graphics kernel module sources Adding kernel module sources. Branch: origin/1.9/j6-wip Commit: 6708c05 Change-Id: I01a2ed673a2ad790bf2f15d86d947aca4fe26f6c Signed-off-by: Vishal Mahaveer --- jacinto6/sgx_src/eurasia_km/GPL-COPYING | 344 + jacinto6/sgx_src/eurasia_km/INSTALL | 72 + jacinto6/sgx_src/eurasia_km/MIT-COPYING | 41 + jacinto6/sgx_src/eurasia_km/README | 49 + .../eurasiacon/build/linux2/bits.mk | 112 + .../eurasiacon/build/linux2/buildvars.mk | 217 + .../eurasiacon/build/linux2/commands.mk | 219 + .../linux2/common/android/arch_common.mk | 61 + .../build/linux2/common/android/armv7-a.mk | 68 + .../linux2/common/android/extra_config.mk | 47 + .../build/linux2/common/android/features.mk | 326 + .../build/linux2/common/android/paths.mk | 53 + .../linux2/common/android/platform_version.mk | 156 + .../eurasiacon/build/linux2/common/dridrm.mk | 63 + .../eurasiacon/build/linux2/common/omap4.mk | 43 + .../eurasiacon/build/linux2/common/opencl.mk | 40 + .../eurasiacon/build/linux2/config/core.mk | 604 ++ .../eurasiacon/build/linux2/defs.mk | 140 + .../build/linux2/kbuild/Makefile.template | 92 + .../build/linux2/kbuild/external_tarball.mk | 49 + .../eurasiacon/build/linux2/kbuild/kbuild.mk | 91 + .../eurasiacon/build/linux2/kernel_module.mk | 75 + .../eurasiacon/build/linux2/kernel_version.mk | 100 + .../eurasiacon/build/linux2/moduledefs.mk | 96 + .../eurasiacon/build/linux2/modules.mk | 49 + .../build/linux2/omap4430_android/Makefile | 193 + .../build/linux2/omap4430_android/products.mk | 46 + .../eurasiacon/build/linux2/prepare_tree.mk | 60 + .../eurasiacon/build/linux2/this_makefile.mk | 68 + .../eurasiacon/build/linux2/tools/cc-check.sh | 99 + .../eurasiacon/build/linux2/toplevel.mk | 226 + .../sgx_src/eurasia_km/include4/dbgdrvif.h | 381 ++ .../sgx_src/eurasia_km/include4/img_defs.h | 153 + .../sgx_src/eurasia_km/include4/img_types.h | 214 + .../sgx_src/eurasia_km/include4/pdumpdefs.h | 126 + .../sgx_src/eurasia_km/include4/pvr_debug.h | 235 + .../sgx_src/eurasia_km/include4/pvrmodule.h | 48 + .../sgx_src/eurasia_km/include4/pvrversion.h | 69 + .../sgx_src/eurasia_km/include4/services.h | 1870 ++++++ .../sgx_src/eurasia_km/include4/servicesext.h | 965 +++ .../sgx_src/eurasia_km/include4/sgx_options.h | 258 + .../sgx_src/eurasia_km/include4/sgxapi_km.h | 524 ++ .../sgx_src/eurasia_km/include4/sgxscript.h | 99 + .../services4/3rdparty/dc_nohw/Kbuild.mk | 47 + .../services4/3rdparty/dc_nohw/Linux.mk | 45 + .../services4/3rdparty/dc_nohw/dc_nohw.h | 288 + .../3rdparty/dc_nohw/dc_nohw_displayclass.c | 982 +++ .../3rdparty/dc_nohw/dc_nohw_linux.c | 376 ++ .../3rdparty/dc_omapfb3_linux/Kbuild.mk | 48 + .../3rdparty/dc_omapfb3_linux/Linux.mk | 45 + .../3rdparty/dc_omapfb3_linux/omaplfb.h | 323 + .../dc_omapfb3_linux/omaplfb_displayclass.c | 1722 +++++ .../3rdparty/dc_omapfb3_linux/omaplfb_linux.c | 1165 ++++ .../services4/include/kernelbuffer.h | 97 + .../services4/include/kerneldisplay.h | 243 + .../eurasia_km/services4/include/pdump.h | 51 + .../eurasia_km/services4/include/pvr_bridge.h | 2255 +++++++ .../services4/include/pvr_bridge_km.h | 409 ++ .../eurasia_km/services4/include/pvrmmap.h | 81 + .../services4/include/pvrsrv_errors.h | 311 + .../services4/include/servicesint.h | 555 ++ .../eurasia_km/services4/include/sgx_bridge.h | 779 +++ .../services4/include/sgx_mkif_km.h | 476 ++ .../include/sgx_ukernel_status_codes.h | 966 +++ .../eurasia_km/services4/include/sgxinfo.h | 489 ++ .../srvkm/bridged/bridged_pvr_bridge.c | 5512 +++++++++++++++++ .../srvkm/bridged/bridged_pvr_bridge.h | 257 + .../services4/srvkm/bridged/bridged_support.c | 117 + .../services4/srvkm/bridged/bridged_support.h | 72 + .../srvkm/bridged/sgx/bridged_sgx_bridge.c | 3819 ++++++++++++ .../srvkm/bridged/sgx/bridged_sgx_bridge.h | 61 + .../services4/srvkm/common/buffer_manager.c | 3573 +++++++++++ .../services4/srvkm/common/deviceclass.c | 2864 +++++++++ .../services4/srvkm/common/deviceid.h | 51 + .../services4/srvkm/common/devicemem.c | 2592 ++++++++ .../services4/srvkm/common/handle.c | 2689 ++++++++ .../eurasia_km/services4/srvkm/common/hash.c | 738 +++ .../eurasia_km/services4/srvkm/common/lists.c | 156 + .../eurasia_km/services4/srvkm/common/mem.c | 175 + .../services4/srvkm/common/mem_debug.c | 272 + .../services4/srvkm/common/metrics.c | 209 + .../services4/srvkm/common/osfunc_common.c | 48 + .../services4/srvkm/common/pdump_common.c | 2967 +++++++++ .../services4/srvkm/common/perproc.c | 398 ++ .../eurasia_km/services4/srvkm/common/power.c | 996 +++ .../services4/srvkm/common/pvrsrv.c | 1846 ++++++ .../eurasia_km/services4/srvkm/common/queue.c | 1503 +++++ .../eurasia_km/services4/srvkm/common/ra.c | 2427 ++++++++ .../services4/srvkm/common/refcount.c | 588 ++ .../services4/srvkm/common/resman.c | 985 +++ .../services4/srvkm/common/ttrace.c | 597 ++ .../services4/srvkm/devices/sgx/mmu.c | 4600 ++++++++++++++ .../services4/srvkm/devices/sgx/mmu.h | 501 ++ .../services4/srvkm/devices/sgx/pb.c | 493 ++ .../srvkm/devices/sgx/sgx_bridge_km.h | 279 + .../services4/srvkm/devices/sgx/sgxconfig.h | 481 ++ .../services4/srvkm/devices/sgx/sgxinfokm.h | 606 ++ .../services4/srvkm/devices/sgx/sgxinit.c | 3431 ++++++++++ .../services4/srvkm/devices/sgx/sgxkick.c | 918 +++ .../services4/srvkm/devices/sgx/sgxpower.c | 660 ++ .../services4/srvkm/devices/sgx/sgxreset.c | 808 +++ .../services4/srvkm/devices/sgx/sgxtransfer.c | 814 +++ .../services4/srvkm/devices/sgx/sgxutils.c | 1914 ++++++ .../services4/srvkm/devices/sgx/sgxutils.h | 195 + .../services4/srvkm/env/linux/Kbuild.mk | 166 + .../services4/srvkm/env/linux/Linux.mk | 45 + .../services4/srvkm/env/linux/env_data.h | 93 + .../services4/srvkm/env/linux/env_perproc.h | 79 + .../services4/srvkm/env/linux/event.c | 414 ++ .../services4/srvkm/env/linux/event.h | 48 + .../services4/srvkm/env/linux/gc_bvmapping.c | 147 + .../services4/srvkm/env/linux/gc_bvmapping.h | 27 + .../services4/srvkm/env/linux/ion.c | 363 ++ .../services4/srvkm/env/linux/ion.h | 74 + .../services4/srvkm/env/linux/linkage.h | 72 + .../services4/srvkm/env/linux/lock.h | 56 + .../eurasia_km/services4/srvkm/env/linux/mm.c | 2946 +++++++++ .../eurasia_km/services4/srvkm/env/linux/mm.h | 751 +++ .../services4/srvkm/env/linux/mmap.c | 1655 +++++ .../services4/srvkm/env/linux/mmap.h | 240 + .../services4/srvkm/env/linux/module.c | 1211 ++++ .../services4/srvkm/env/linux/mutex.c | 163 + .../services4/srvkm/env/linux/mutex.h | 97 + .../services4/srvkm/env/linux/mutils.c | 166 + .../services4/srvkm/env/linux/mutils.h | 119 + .../services4/srvkm/env/linux/osfunc.c | 4714 ++++++++++++++ .../services4/srvkm/env/linux/osperproc.c | 146 + .../services4/srvkm/env/linux/pdump.c | 804 +++ .../services4/srvkm/env/linux/private_data.h | 95 + .../services4/srvkm/env/linux/proc.c | 1414 +++++ .../services4/srvkm/env/linux/proc.h | 127 + .../services4/srvkm/env/linux/pvr_bridge_k.c | 524 ++ .../services4/srvkm/env/linux/pvr_debug.c | 506 ++ .../services4/srvkm/env/linux/pvr_uaccess.h | 88 + .../services4/srvkm/env/linux/sysfs.c | 90 + .../services4/srvkm/env/linux/sysfs.h | 22 + .../services4/srvkm/hwdefs/mnemedefs.h | 117 + .../services4/srvkm/hwdefs/ocpdefs.h | 308 + .../services4/srvkm/hwdefs/sgx520defs.h | 555 ++ .../services4/srvkm/hwdefs/sgx530defs.h | 542 ++ .../services4/srvkm/hwdefs/sgx531defs.h | 601 ++ .../services4/srvkm/hwdefs/sgx535defs.h | 739 +++ .../services4/srvkm/hwdefs/sgx540defs.h | 605 ++ .../srvkm/hwdefs/sgx543_v1.164defs.h | 1396 +++++ .../services4/srvkm/hwdefs/sgx543defs.h | 1487 +++++ .../services4/srvkm/hwdefs/sgx544defs.h | 1487 +++++ .../services4/srvkm/hwdefs/sgx545defs.h | 1290 ++++ .../services4/srvkm/hwdefs/sgxdefs.h | 112 + .../services4/srvkm/hwdefs/sgxerrata.h | 495 ++ .../services4/srvkm/hwdefs/sgxfeaturedefs.h | 274 + .../services4/srvkm/hwdefs/sgxmmu.h | 99 + .../services4/srvkm/hwdefs/sgxmpdefs.h | 365 ++ .../services4/srvkm/include/buffer_manager.h | 674 ++ .../services4/srvkm/include/device.h | 409 ++ .../services4/srvkm/include/handle.h | 567 ++ .../eurasia_km/services4/srvkm/include/hash.h | 277 + .../services4/srvkm/include/lists.h | 349 ++ .../services4/srvkm/include/metrics.h | 146 + .../services4/srvkm/include/osfunc.h | 799 +++ .../services4/srvkm/include/osperproc.h | 94 + .../services4/srvkm/include/pdump_int.h | 100 + .../services4/srvkm/include/pdump_km.h | 441 ++ .../services4/srvkm/include/pdump_osfunc.h | 337 + .../services4/srvkm/include/perfkm.h | 53 + .../services4/srvkm/include/perproc.h | 150 + .../services4/srvkm/include/power.h | 140 + .../services4/srvkm/include/queue.h | 145 + .../eurasia_km/services4/srvkm/include/ra.h | 293 + .../services4/srvkm/include/refcount.h | 203 + .../services4/srvkm/include/resman.h | 152 + .../srvkm/include/services_headers.h | 68 + .../services4/srvkm/include/srvkm.h | 129 + .../services4/srvkm/include/ttrace.h | 200 + .../services4/srvkm/include/ttrace_common.h | 146 + .../services4/srvkm/include/ttrace_tokens.h | 119 + .../services4/system/include/syscommon.h | 397 ++ .../services4/system/omap4/oemfuncs.h | 80 + .../services4/system/omap4/sgxfreq.c | 590 ++ .../services4/system/omap4/sgxfreq.h | 97 + .../system/omap4/sgxfreq_activeidle.c | 181 + .../services4/system/omap4/sgxfreq_cool.c | 104 + .../system/omap4/sgxfreq_on3demand.c | 324 + .../services4/system/omap4/sgxfreq_onoff.c | 180 + .../system/omap4/sgxfreq_userspace.c | 124 + .../services4/system/omap4/sysconfig.c | 1333 ++++ .../services4/system/omap4/sysconfig.h | 110 + .../services4/system/omap4/sysinfo.h | 64 + .../services4/system/omap4/syslocal.h | 265 + .../services4/system/omap4/sysutils.c | 59 + .../services4/system/omap4/sysutils_linux.c | 750 +++ .../tools/intern/debug/client/linuxsrv.h | 64 + .../tools/intern/debug/dbgdriv/Kbuild.mk | 51 + .../tools/intern/debug/dbgdriv/Linux.mk | 45 + .../intern/debug/dbgdriv/common/dbgdriv.c | 2883 +++++++++ .../intern/debug/dbgdriv/common/dbgdriv.h | 155 + .../debug/dbgdriv/common/dbgdriv_ioctl.h | 57 + .../intern/debug/dbgdriv/common/handle.c | 141 + .../intern/debug/dbgdriv/common/hostfunc.h | 82 + .../intern/debug/dbgdriv/common/hotkey.c | 199 + .../intern/debug/dbgdriv/common/hotkey.h | 82 + .../tools/intern/debug/dbgdriv/common/ioctl.c | 827 +++ .../intern/debug/dbgdriv/linux/hostfunc.c | 395 ++ .../tools/intern/debug/dbgdriv/linux/main.c | 355 ++ 203 files changed, 115725 insertions(+) create mode 100644 jacinto6/sgx_src/eurasia_km/GPL-COPYING create mode 100644 jacinto6/sgx_src/eurasia_km/INSTALL create mode 100644 jacinto6/sgx_src/eurasia_km/MIT-COPYING create mode 100644 jacinto6/sgx_src/eurasia_km/README create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/bits.mk create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/buildvars.mk create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/commands.mk create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/arch_common.mk create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/armv7-a.mk create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/extra_config.mk create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/features.mk create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/paths.mk create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/platform_version.mk create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/dridrm.mk create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/omap4.mk create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/opencl.mk create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/core.mk create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/defs.mk create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kbuild/Makefile.template create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kbuild/external_tarball.mk create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kbuild/kbuild.mk create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kernel_module.mk create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kernel_version.mk create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/moduledefs.mk create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/modules.mk create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap4430_android/Makefile create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap4430_android/products.mk create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/prepare_tree.mk create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/this_makefile.mk create mode 100755 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/tools/cc-check.sh create mode 100644 jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/toplevel.mk create mode 100644 jacinto6/sgx_src/eurasia_km/include4/dbgdrvif.h create mode 100644 jacinto6/sgx_src/eurasia_km/include4/img_defs.h create mode 100644 jacinto6/sgx_src/eurasia_km/include4/img_types.h create mode 100644 jacinto6/sgx_src/eurasia_km/include4/pdumpdefs.h create mode 100644 jacinto6/sgx_src/eurasia_km/include4/pvr_debug.h create mode 100644 jacinto6/sgx_src/eurasia_km/include4/pvrmodule.h create mode 100644 jacinto6/sgx_src/eurasia_km/include4/pvrversion.h create mode 100644 jacinto6/sgx_src/eurasia_km/include4/services.h create mode 100644 jacinto6/sgx_src/eurasia_km/include4/servicesext.h create mode 100644 jacinto6/sgx_src/eurasia_km/include4/sgx_options.h create mode 100644 jacinto6/sgx_src/eurasia_km/include4/sgxapi_km.h create mode 100644 jacinto6/sgx_src/eurasia_km/include4/sgxscript.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/Kbuild.mk create mode 100644 jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/Linux.mk create mode 100644 jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/dc_nohw.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/dc_nohw_displayclass.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/dc_nohw_linux.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_omapfb3_linux/Kbuild.mk create mode 100644 jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_omapfb3_linux/Linux.mk create mode 100644 jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_omapfb3_linux/omaplfb.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_omapfb3_linux/omaplfb_displayclass.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_omapfb3_linux/omaplfb_linux.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/include/kernelbuffer.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/include/kerneldisplay.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/include/pdump.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/include/pvr_bridge.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/include/pvr_bridge_km.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/include/pvrmmap.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/include/pvrsrv_errors.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/include/servicesint.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/include/sgx_bridge.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/include/sgx_mkif_km.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/include/sgx_ukernel_status_codes.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/include/sgxinfo.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/bridged/bridged_pvr_bridge.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/bridged/bridged_pvr_bridge.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/bridged/bridged_support.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/bridged/bridged_support.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/bridged/sgx/bridged_sgx_bridge.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/bridged/sgx/bridged_sgx_bridge.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/common/buffer_manager.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/common/deviceclass.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/common/deviceid.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/common/devicemem.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/common/handle.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/common/hash.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/common/lists.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/common/mem.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/common/mem_debug.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/common/metrics.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/common/osfunc_common.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/common/pdump_common.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/common/perproc.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/common/power.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/common/pvrsrv.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/common/queue.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/common/ra.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/common/refcount.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/common/resman.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/common/ttrace.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/mmu.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/mmu.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/pb.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgx_bridge_km.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxconfig.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxinfokm.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxinit.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxkick.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxpower.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxreset.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxtransfer.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxutils.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxutils.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/Kbuild.mk create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/Linux.mk create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/env_data.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/env_perproc.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/event.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/event.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/gc_bvmapping.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/gc_bvmapping.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/ion.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/ion.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/linkage.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/lock.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mm.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mm.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mmap.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mmap.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/module.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mutex.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mutex.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mutils.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/mutils.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/osfunc.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/osperproc.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pdump.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/private_data.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/proc.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/proc.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_bridge_k.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_debug.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/pvr_uaccess.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/sysfs.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/env/linux/sysfs.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/hwdefs/mnemedefs.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/hwdefs/ocpdefs.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/hwdefs/sgx520defs.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/hwdefs/sgx530defs.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/hwdefs/sgx531defs.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/hwdefs/sgx535defs.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/hwdefs/sgx540defs.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/hwdefs/sgx543_v1.164defs.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/hwdefs/sgx543defs.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/hwdefs/sgx544defs.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/hwdefs/sgx545defs.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/hwdefs/sgxdefs.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/hwdefs/sgxerrata.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/hwdefs/sgxfeaturedefs.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/hwdefs/sgxmmu.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/hwdefs/sgxmpdefs.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/include/buffer_manager.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/include/device.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/include/handle.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/include/hash.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/include/lists.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/include/metrics.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/include/osfunc.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/include/osperproc.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/include/pdump_int.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/include/pdump_km.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/include/pdump_osfunc.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/include/perfkm.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/include/perproc.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/include/power.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/include/queue.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/include/ra.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/include/refcount.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/include/resman.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/include/services_headers.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/include/srvkm.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/include/ttrace.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/include/ttrace_common.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/srvkm/include/ttrace_tokens.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/system/include/syscommon.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/system/omap4/oemfuncs.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/system/omap4/sgxfreq.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/system/omap4/sgxfreq.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/system/omap4/sgxfreq_activeidle.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/system/omap4/sgxfreq_cool.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/system/omap4/sgxfreq_on3demand.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/system/omap4/sgxfreq_onoff.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/system/omap4/sgxfreq_userspace.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/system/omap4/sysconfig.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/system/omap4/sysconfig.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/system/omap4/sysinfo.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/system/omap4/syslocal.h create mode 100644 jacinto6/sgx_src/eurasia_km/services4/system/omap4/sysutils.c create mode 100644 jacinto6/sgx_src/eurasia_km/services4/system/omap4/sysutils_linux.c create mode 100644 jacinto6/sgx_src/eurasia_km/tools/intern/debug/client/linuxsrv.h create mode 100644 jacinto6/sgx_src/eurasia_km/tools/intern/debug/dbgdriv/Kbuild.mk create mode 100644 jacinto6/sgx_src/eurasia_km/tools/intern/debug/dbgdriv/Linux.mk create mode 100644 jacinto6/sgx_src/eurasia_km/tools/intern/debug/dbgdriv/common/dbgdriv.c create mode 100644 jacinto6/sgx_src/eurasia_km/tools/intern/debug/dbgdriv/common/dbgdriv.h create mode 100644 jacinto6/sgx_src/eurasia_km/tools/intern/debug/dbgdriv/common/dbgdriv_ioctl.h create mode 100644 jacinto6/sgx_src/eurasia_km/tools/intern/debug/dbgdriv/common/handle.c create mode 100644 jacinto6/sgx_src/eurasia_km/tools/intern/debug/dbgdriv/common/hostfunc.h create mode 100644 jacinto6/sgx_src/eurasia_km/tools/intern/debug/dbgdriv/common/hotkey.c create mode 100644 jacinto6/sgx_src/eurasia_km/tools/intern/debug/dbgdriv/common/hotkey.h create mode 100644 jacinto6/sgx_src/eurasia_km/tools/intern/debug/dbgdriv/common/ioctl.c create mode 100644 jacinto6/sgx_src/eurasia_km/tools/intern/debug/dbgdriv/linux/hostfunc.c create mode 100644 jacinto6/sgx_src/eurasia_km/tools/intern/debug/dbgdriv/linux/main.c diff --git a/jacinto6/sgx_src/eurasia_km/GPL-COPYING b/jacinto6/sgx_src/eurasia_km/GPL-COPYING new file mode 100644 index 0000000..83d1261 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/GPL-COPYING @@ -0,0 +1,344 @@ +------------------------------------------------------------------------- + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. + +------------------------------------------------------------------------- + diff --git a/jacinto6/sgx_src/eurasia_km/INSTALL b/jacinto6/sgx_src/eurasia_km/INSTALL new file mode 100644 index 0000000..aefa6c3 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/INSTALL @@ -0,0 +1,72 @@ + +SGX Embedded Systems DDK for the Linux kernel. +Copyright (C) Imagination Technologies Ltd. All rights reserved. +====================================================================== + +This file covers how to build and install the Imagination Technologies +SGX DDK for the Linux kernel. + + +Build System Environment Variables +------------------------------------------- + +The SGX DDK Build scripts depend on a number of environment variables +being setup before compilation or installation of DDK software can +commence: + +$DISCIMAGE +The DDK Build scripts install files to the location specified by the +DISCIMAGE environment variable, when the make install target is used. +This should point to the target filesystem. +$ export DISCIMAGE=/path/to/filesystem + +$KERNELDIR +When building the SGX DDK kernel module, the build needs access +to the headers of the Linux kernel +$ export KERNELDIR=/path/to/kernel + +$PATH +If a cross compiler is being used make sure the PATH environment variable +includes the path to the toolchain +$ export PATH=$PATH:/path/to/toolchain + +$CROSS_COMPILE +Since the SGX DDK Build scripts are geared toward a cross-compilation +workflow, the CROSS_COMPILE environment variable needs to be set +$ export CROSS_COMPILE=toolchain-prefix- + + +Build and Install Instructions +------------------------------------------- + +The SGX DDK configures different target builds within directories under +eurasiacon/build/linux/. + +The supported build targets are: + + all Makes everything + clean Removes all intermediate files created by a build. + clobber Removes all binaries for all builds as well. + install Runs the install script generated by the build. + +The following variables may be set on the command line to influence a build. + + BUILD The type of build being performed. + Alternatives are release, timing or debug. + CFLAGS Build dependent optimisations and debug information flags. + SILENT Determines whether text of commands is produced during build. + +To build for, change to the appropriate target directory, e.g.: +$ cd eurasiacon/build/linux/platform/kbuild + +Issue the make command: +$ make BUILD=debug all + +The DDK software must be installed by the root user. Become the root user: +$ su + +Install the DDK software: +$ make install + +Become an ordinary user again: +$ exit diff --git a/jacinto6/sgx_src/eurasia_km/MIT-COPYING b/jacinto6/sgx_src/eurasia_km/MIT-COPYING new file mode 100644 index 0000000..0cbd14e --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/MIT-COPYING @@ -0,0 +1,41 @@ + +This software is Copyright (C) Imagination Technologies Ltd. + +You may use, distribute and copy this software under the terms of the MIT +license displayed below. + +----------------------------------------------------------------------------- + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, this Software may be used under the terms of the GNU General +Public License Version 2 ("GPL") in which case the provisions of GPL are +applicable instead of those above. + +If you wish to allow use of your version of this Software only under the terms +of GPL, and not to allow others to use your version of this file under the +terms of the MIT license, indicate your decision by deleting from each file +the provisions above and replace them with the notice and other provisions +required by GPL as set out in the file called "GPL-COPYING" included in this +distribution. If you do not delete the provisions above, a recipient may use +your version of this file under the terms of either the MIT license or GPL. + +----------------------------------------------------------------------------- + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +----------------------------------------------------------------------------- diff --git a/jacinto6/sgx_src/eurasia_km/README b/jacinto6/sgx_src/eurasia_km/README new file mode 100644 index 0000000..2eae109 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/README @@ -0,0 +1,49 @@ + +SGX Embedded Systems DDK for Linux kernel. +Copyright (C) Imagination Technologies Ltd. All rights reserved. +====================================================================== + + +About +------------------------------------------- + +This is the Imagination Technologies SGX DDK for the Linux kernel. + + +License +------------------------------------------- + +You may use, distribute and copy this software under the terms of the MIT +license. Details of this license can be found in the file "MIT-COPYING". + +Alternatively, you may use, distribute and copy this software under the terms +of the GNU General Public License version 2. The full GNU General Public +License version 2 can be found in the file "GPL-COPYING". + + +Build and Install Instructions +------------------------------------------- + +For details see the "INSTALL" file. + +To build for, change to the appropriate target directory, e.g.: +$ cd eurasiacon/build/linux/platform/kbuild + +Issue the make command: +$ make BUILD=debug all + +The DDK software must be installed by the root user. Become the root user: +$ su + +Install the DDK software: +# make install + +Become an ordinary user again: +$ exit + + +Contact information: +------------------------------------------- + +Imagination Technologies Ltd. +Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/bits.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/bits.mk new file mode 100644 index 0000000..a1a7eef --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/bits.mk @@ -0,0 +1,112 @@ +########################################################################### ### +#@Title Useful special targets which don't build anything +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +ifneq ($(filter dumpvar-%,$(MAKECMDGOALS)),) +dumpvar-%: ; +$(foreach _var_to_dump,$(patsubst dumpvar-%,%,$(filter dumpvar-%,$(MAKECMDGOALS))),$(info $(if $(filter undefined,$(origin $(_var_to_dump))),# $$($(_var_to_dump)) is not set,$(_var_to_dump) := $($(_var_to_dump))))) +endif + +ifneq ($(filter whereis-%,$(MAKECMDGOALS)),) +whereis-%: ; +$(foreach _module_to_find,$(patsubst whereis-%,%,$(filter whereis-%,$(MAKECMDGOALS))),$(info $(if $(INTERNAL_MAKEFILE_FOR_MODULE_$(_module_to_find)),$(INTERNAL_MAKEFILE_FOR_MODULE_$(_module_to_find)),# No module $(_module_to_find)))) +endif + +ifneq ($(filter whatis-%,$(MAKECMDGOALS)),) +whatis-$(RELATIVE_OUT)/target/%: ; +whatis-$(RELATIVE_OUT)/host/%: ; +$(foreach _file_to_find,$(patsubst whatis-%,%,$(filter whatis-%,$(MAKECMDGOALS))),$(info $(strip $(foreach _m,$(ALL_MODULES),$(if $(filter $(_file_to_find),$(INTERNAL_TARGETS_FOR_$(_m))),$(_file_to_find) is in $(_m) which is defined in $(INTERNAL_MAKEFILE_FOR_MODULE_$(_m)),))))) +endif + +.PHONY: ls-modules +ls-modules: + @: $(foreach _m,$(ALL_MODULES),$(info $($(_m)_type) $(_m) $(patsubst $(TOP)/%,%,$(INTERNAL_MAKEFILE_FOR_MODULE_$(_m))))) + +ifeq ($(strip $(MAKECMDGOALS)),visualise) +FORMAT ?= xlib +GRAPHVIZ ?= neato +visualise: $(OUT)/MAKE_RULES.dot + $(GRAPHVIZ) -T$(FORMAT) -o $(OUT)/MAKE_RULES.$(FORMAT) $< +$(OUT)/MAKE_RULES.dot: $(OUT)/MAKE_RULES + perl $(MAKE_TOP)/tools/depgraph.pl -t $(TOP) -g $(firstword $(GRAPHVIZ)) $(OUT)/MAKE_RULES >$(OUT)/MAKE_RULES.dot +$(OUT)/MAKE_RULES: $(ALL_MAKEFILES) + -$(MAKE) -C $(TOP) -f $(MAKE_TOP)/toplevel.mk TOP=$(TOP) OUT=$(OUT) ls-modules -qp >$(OUT)/MAKE_RULES 2>&1 +else +visualise: + @: $(error visualise specified along with other goals. This is not supported) +endif + +.PHONY: help +help: + @echo 'Build targets' + @echo ' make, make build Build all components of the build' + @echo ' make components Build only the user-mode components' + @echo ' make kbuild Build only the kernel-mode components' + @echo ' make MODULE Build the module MODULE and all of its dependencies' + @echo ' make eurasiacon/binary2_.../target/libsomething.so' + @echo ' Build a particular file (including intermediates)' + @echo 'Variables' + @echo ' make V=1 ... Print the commands that are executed' + @echo ' make W=1 ... Enable extra compiler warnings' + @echo ' make D=opt ... Set build system debug option (D=help for a list)' + @echo ' make OUT=dir ... Place output+intermediates in specified directory' + @echo ' EXCLUDED_APIS=... List of APIs to remove from the build' + @echo ' make SOMEOPTION=1 ... Set configuration options (see config/core.mk)' + @echo ' Defaults are set by $(PVR_BUILD_DIR)/Makefile' + @echo 'Clean targets' + @echo ' make clean Remove only intermediates for the current build' + @echo ' make clobber As "make clean", but remove output files too' + @echo ' make clean-MODULE Clean (or clobber) only files for MODULE' + @echo '' + @echo 'Special targets' + @echo ' make whereis-MODULE Show the path to the Linux.mk defining MODULE' + @echo ' make whatis-FILE Show which module builds an output FILE' + @echo ' make ls-modules List all modules defined by makefiles' + +ifneq ($(filter help,$(D)),) +empty := +space := $(empty) $(empty) +$(info Debug options) +$(info $(space)D=modules dump module info) +$(info $(space)D=freeze-config prevent config changes) +$(info $(space)D=config-changes dump diffs when config changes) +$(info Options may be combined: make D=freeze-config,config-changes) +$(error D=help given) +endif diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/buildvars.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/buildvars.mk new file mode 100644 index 0000000..24fa829 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/buildvars.mk @@ -0,0 +1,217 @@ +########################################################################### ### +#@Title Define global variables +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@Description This file is read once at the start of the build, after reading +# in config.mk. It should define the non-MODULE_* variables used +# in commands, like ALL_CFLAGS +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +ifeq ($(BUILD),debug) +COMMON_USER_FLAGS := -O0 +else +OPTIM ?= -O2 +COMMON_USER_FLAGS := $(OPTIM) +endif + +# FIXME: We should probably audit the driver for aliasing +# +COMMON_USER_FLAGS += -fno-strict-aliasing + +# We always enable debugging. Either the release binaries are stripped +# and the symbols put in the symbolpackage, or we're building debug. +# +COMMON_USER_FLAGS += -g + +# These flags are used for kernel, User C and User C++ +# +COMMON_FLAGS = -W -Wall + +# Some GCC warnings are C only, so we must mask them from C++ +# +COMMON_CFLAGS := $(COMMON_FLAGS) \ + -Wdeclaration-after-statement -Wno-format-zero-length \ + -Wmissing-prototypes -Wstrict-prototypes + +# Additional warnings, and optional warnings. +# +WARNING_CFLAGS := \ + -Wpointer-arith -Wunused-parameter \ + -Wmissing-format-attribute \ + $(call cc-option,-Wno-missing-field-initializers) \ + $(call cc-option,-fdiagnostics-show-option) + +ifeq ($(W),1) +WARNING_CFLAGS += \ + $(call cc-option,-Wbad-function-cast) \ + $(call cc-option,-Wcast-qual) \ + $(call cc-option,-Wcast-align) \ + $(call cc-option,-Wconversion) \ + $(call cc-option,-Wdisabled-optimization) \ + $(call cc-option,-Wlogical-op) \ + $(call cc-option,-Wmissing-declarations) \ + $(call cc-option,-Wmissing-include-dirs) \ + $(call cc-option,-Wnested-externs) \ + $(call cc-option,-Wold-style-definition) \ + $(call cc-option,-Woverlength-strings) \ + $(call cc-option,-Wpacked) \ + $(call cc-option,-Wpacked-bitfield-compat) \ + $(call cc-option,-Wpadded) \ + $(call cc-option,-Wredundant-decls) \ + $(call cc-option,-Wshadow) \ + $(call cc-option,-Wswitch-default) \ + $(call cc-option,-Wvla) \ + $(call cc-option,-Wwrite-strings) +endif + +WARNING_CFLAGS += \ + $(call cc-optional-warning,-Wunused-but-set-variable) + +HOST_WARNING_CFLAGS := \ + -Wpointer-arith -Wunused-parameter \ + -Wmissing-format-attribute \ + $(call host-cc-option,-Wno-missing-field-initializers) \ + $(call host-cc-option,-fdiagnostics-show-option) + +ifeq ($(W),1) +HOST_WARNING_CFLAGS += \ + $(call host-cc-option,-Wbad-function-cast) \ + $(call host-cc-option,-Wcast-qual) \ + $(call host-cc-option,-Wcast-align) \ + $(call host-cc-option,-Wconversion) \ + $(call host-cc-option,-Wdisabled-optimization) \ + $(call host-cc-option,-Wlogical-op) \ + $(call host-cc-option,-Wmissing-declarations) \ + $(call host-cc-option,-Wmissing-include-dirs) \ + $(call host-cc-option,-Wnested-externs) \ + $(call host-cc-option,-Wold-style-definition) \ + $(call host-cc-option,-Woverlength-strings) \ + $(call host-cc-option,-Wpacked) \ + $(call host-cc-option,-Wpacked-bitfield-compat) \ + $(call host-cc-option,-Wpadded) \ + $(call host-cc-option,-Wredundant-decls) \ + $(call host-cc-option,-Wshadow) \ + $(call host-cc-option,-Wswitch-default) \ + $(call host-cc-option,-Wvla) \ + $(call host-cc-option,-Wwrite-strings) +endif + +HOST_WARNING_CFLAGS += \ + $(call host-cc-optional-warning,-Wunused-but-set-variable) + +KBUILD_WARNING_CFLAGS := \ + -Wno-unused-parameter -Wno-sign-compare +KBUILD_WARNING_CFLAGS += \ + $(call kernel-cc-optional-warning,-Wbad-function-cast) \ + $(call kernel-cc-optional-warning,-Wcast-qual) \ + $(call kernel-cc-optional-warning,-Wcast-align) \ + $(call kernel-cc-optional-warning,-Wconversion) \ + $(call kernel-cc-optional-warning,-Wdisabled-optimization) \ + $(call kernel-cc-optional-warning,-Wlogical-op) \ + $(call kernel-cc-optional-warning,-Wmissing-declarations) \ + $(call kernel-cc-optional-warning,-Wmissing-include-dirs) \ + $(call kernel-cc-optional-warning,-Wnested-externs) \ + $(call kernel-cc-optional-warning,-Wno-missing-field-initializers) \ + $(call kernel-cc-optional-warning,-Wold-style-definition) \ + $(call kernel-cc-optional-warning,-Woverlength-strings) \ + $(call kernel-cc-optional-warning,-Wpacked) \ + $(call kernel-cc-optional-warning,-Wpacked-bitfield-compat) \ + $(call kernel-cc-optional-warning,-Wpadded) \ + $(call kernel-cc-optional-warning,-Wredundant-decls) \ + $(call kernel-cc-optional-warning,-Wshadow) \ + $(call kernel-cc-optional-warning,-Wswitch-default) \ + $(call kernel-cc-optional-warning,-Wvla) \ + $(call kernel-cc-optional-warning,-Wwrite-strings) + +# User C only +# +ALL_CFLAGS := \ + $(COMMON_USER_FLAGS) $(COMMON_CFLAGS) $(WARNING_CFLAGS) \ + $(SYS_CFLAGS) + +ALL_HOST_CFLAGS := \ + $(COMMON_USER_FLAGS) $(COMMON_CFLAGS) $(HOST_WARNING_CFLAGS) + +# User C++ only +# +ALL_CXXFLAGS := \ + $(COMMON_USER_FLAGS) $(COMMON_FLAGS) \ + -fno-rtti -fno-exceptions \ + -Wpointer-arith -Wunused-parameter \ + $(SYS_CXXFLAGS) + +ALL_HOST_CXXFLAGS := \ + $(COMMON_USER_FLAGS) $(COMMON_CFLAGS) -Wall + +# User C and C++ +# +# NOTE: ALL_HOST_LDFLAGS should probably be using -rpath-link too, and if we +# ever need to support building host shared libraries, it's required. +# +# We can't use it right now because we want to support non-GNU-compatible +# linkers like the Darwin 'ld' which doesn't support -rpath-link. +# +ALL_HOST_LDFLAGS := -L$(HOST_OUT) +ALL_LDFLAGS := -L$(TARGET_OUT) -Xlinker -rpath-link=$(TARGET_OUT) + +ifneq ($(strip $(TOOLCHAIN)),) +ALL_LDFLAGS += -L$(TOOLCHAIN)/lib -Xlinker -rpath-link=$(TOOLCHAIN)/lib +endif + +ifneq ($(strip $(LINKER_RPATH)),) +ALL_LDFLAGS += $(addprefix -Xlinker -rpath=,$(LINKER_RPATH)) +endif + +ALL_LDFLAGS += $(SYS_LDFLAGS) + +# Kernel C only +# +ALL_KBUILD_CFLAGS := $(COMMON_CFLAGS) $(KBUILD_WARNING_CFLAGS) \ + $(call kernel-cc-option,-Wno-type-limits) \ + $(call kernel-cc-option,-Wno-pointer-arith) \ + $(call kernel-cc-option,-Wno-aggregate-return) \ + $(call kernel-cc-option,-Wno-unused-but-set-variable) + +# This variable contains a list of all modules built by kbuild +ALL_KBUILD_MODULES := + +# This variable contains a list of all modules which contain C++ source files +ALL_CXX_MODULES := + +# Toolchain triple for cross environment +CROSS_TRIPLE := $(patsubst %-,%,$(CROSS_COMPILE)) diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/commands.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/commands.mk new file mode 100644 index 0000000..25e5ed1 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/commands.mk @@ -0,0 +1,219 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +# from-one-* recipes make a thing from one source file, so they use $<. Others +# use $(MODULE_something) instead of $^ + +# We expect that MODULE_*FLAGS contains all the flags we need, including the +# flags for all modules (like $(ALL_CFLAGS) and $(ALL_HOST_CFLAGS)), and +# excluding flags for include search dirs or for linking libraries. The +# exceptions are ALL_EXE_LDFLAGS and ALL_LIB_LDFLAGS, since they depend on the +# type of thing being linked, so they appear in the commands below + +define host-o-from-one-c +$(if $(V),,@echo " HOST_CC " $(call relative-to-top,$<)) +$(HOST_CC) -MD -c $(MODULE_HOST_CFLAGS) $(MODULE_INCLUDE_FLAGS) \ + -include $(CONFIG_H) $< -o $@ +endef + +define target-o-from-one-c +$(if $(V),,@echo " CC " $(call relative-to-top,$<)) +$(CC) -MD -c $(MODULE_CFLAGS) $(MODULE_INCLUDE_FLAGS) \ + -include $(CONFIG_H) $< -o $@ +endef + +# We use $(CC) to compile C++ files, and expect it to detect that it's +# compiling C++ +define host-o-from-one-cxx +$(if $(V),,@echo " HOST_CC " $(call relative-to-top,$<)) +$(HOST_CC) -MD -c $(MODULE_HOST_CXXFLAGS) $(MODULE_INCLUDE_FLAGS) \ + -include $(CONFIG_H) $< -o $@ +endef + +define target-o-from-one-cxx +$(if $(V),,@echo " CC " $(call relative-to-top,$<)) +$(CC) -MD -c $(MODULE_CXXFLAGS) $(MODULE_INCLUDE_FLAGS) \ + -include $(CONFIG_H) $< -o $@ +endef + +define host-executable-from-o +$(if $(V),,@echo " HOST_LD " $(call relative-to-top,$@)) +$(HOST_CC) $(MODULE_HOST_LDFLAGS) \ + -o $@ $(sort $(MODULE_ALL_OBJECTS)) $(MODULE_LIBRARY_DIR_FLAGS) \ + $(MODULE_LIBRARY_FLAGS) +endef + +define host-executable-cxx-from-o +$(if $(V),,@echo " HOST_LD " $(call relative-to-top,$@)) +$(HOST_CXX) $(MODULE_HOST_LDFLAGS) \ + -o $@ $(sort $(MODULE_ALL_OBJECTS)) $(MODULE_LIBRARY_DIR_FLAGS) \ + $(MODULE_LIBRARY_FLAGS) +endef + +define target-executable-from-o +$(if $(V),,@echo " LD " $(call relative-to-top,$@)) +$(CC) \ + $(SYS_EXE_LDFLAGS) $(MODULE_LDFLAGS) -o $@ \ + $(SYS_EXE_CRTBEGIN) $(sort $(MODULE_ALL_OBJECTS)) $(SYS_EXE_CRTEND) \ + $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(LIBGCC) +endef + +define target-executable-cxx-from-o +$(if $(V),,@echo " LD " $(call relative-to-top,$@)) +$(CXX) \ + $(SYS_EXE_LDFLAGS) $(MODULE_LDFLAGS) -o $@ \ + $(SYS_EXE_CRTBEGIN) $(sort $(MODULE_ALL_OBJECTS)) $(SYS_EXE_CRTEND) \ + $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(LIBGCC) +endef + +define target-shared-library-from-o +$(if $(V),,@echo " LD " $(call relative-to-top,$@)) +$(CC) -shared -Wl,-Bsymbolic \ + $(SYS_LIB_LDFLAGS) $(MODULE_LDFLAGS) -o $@ \ + $(SYS_LIB_CRTBEGIN) $(sort $(MODULE_ALL_OBJECTS)) $(SYS_LIB_CRTEND) \ + $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(LIBGCC) +endef + +# If there were any C++ source files in a shared library, we use this recipe, +# which runs the C++ compiler to link the final library +define target-shared-library-cxx-from-o +$(if $(V),,@echo " LD " $(call relative-to-top,$@)) +$(CXX) -shared -Wl,-Bsymbolic \ + $(SYS_LIB_LDFLAGS) $(MODULE_LDFLAGS) -o $@ \ + $(SYS_LIB_CRTBEGIN) $(sort $(MODULE_ALL_OBJECTS)) $(SYS_LIB_CRTEND) \ + $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(LIBGCC) +endef + +define target-copy-debug-information +$(OBJCOPY) --only-keep-debug $@ $(basename $@).dbg +endef + +define host-strip-debug-information +$(HOST_STRIP) --strip-unneeded $@ +endef + +define target-strip-debug-information +$(STRIP) --strip-unneeded $@ +endef + +define target-add-debuglink +$(if $(V),,@echo " DBGLINK " $(call relative-to-top,$(basename $@).dbg)) +$(OBJCOPY) --add-gnu-debuglink=$(basename $@).dbg $@ +endef + +define host-static-library-from-o +$(if $(V),,@echo " HOST_AR " $(call relative-to-top,$@)) +$(HOST_AR) cru $@ $(sort $(MODULE_ALL_OBJECTS)) +endef + +define target-static-library-from-o +$(if $(V),,@echo " AR " $(call relative-to-top,$@)) +$(AR) cru $@ $(sort $(MODULE_ALL_OBJECTS)) +endef + +define tab-c-from-y +$(if $(V),,@echo " BISON " $(call relative-to-top,$<)) +$(BISON) $(MODULE_BISON_FLAGS) -o $@ -d $< +endef + +define l-c-from-l +$(if $(V),,@echo " FLEX " $(call relative-to-top,$<)) +$(FLEX) $(MODULE_FLEX_FLAGS) -o$@ $< +endef + +define clean-dirs +$(if $(V),,@echo " RM " $(call relative-to-top,$(MODULE_DIRS_TO_REMOVE))) +$(RM) -rf $(MODULE_DIRS_TO_REMOVE) +endef + +define make-directory +$(MKDIR) -p $@ +endef + +define check-exports +endef + +# Programs used in recipes + +BISON ?= bison +CC ?= gcc +CXX ?= g++ +HOST_CC ?= gcc +HOST_CXX ?= g++ +JAR ?= jar +JAVA ?= java +JAVAC ?= javac +ZIP ?= zip + +override AR := $(if $(V),,@)$(CROSS_COMPILE)ar +override BISON := $(if $(V),,@)$(BISON) +override BZIP2 := $(if $(V),,@)bzip2 -9 +override CC := $(if $(V),,@)$(CROSS_COMPILE)$(CC) +override CC_CHECK := $(if $(V),,@)$(MAKE_TOP)/tools/cc-check.sh +override CXX := $(if $(V),,@)$(CROSS_COMPILE)$(CXX) +override CHMOD := $(if $(V),,@)chmod +override CP := $(if $(V),,@)cp +override ECHO := $(if $(V),,@)echo +override FLEX := $(if $(V),,@)flex +override GAWK := $(if $(V),,@)gawk +override GREP := $(if $(V),,@)grep +override HOST_AR := $(if $(V),,@)ar +override HOST_CC := $(if $(V),,@)$(HOST_CC) +override HOST_CXX := $(if $(V),,@)$(HOST_CXX) +override HOST_STRIP := $(if $(V),,@)strip +override INSTALL := $(if $(V),,@)install +override JAR := $(if $(V),,@)$(JAR) +override JAVA := $(if $(V),,@)$(JAVA) +override JAVAC := $(if $(V),,@)$(JAVAC) +override M4 := $(if $(V),,@)m4 +override MKDIR := $(if $(V),,@)mkdir +override MV := $(if $(V),,@)mv +override OBJCOPY := $(if $(V),,@)$(CROSS_COMPILE)objcopy +override PDSASM := $(if $(V),,@)$(HOST_OUT)/pdsasm +override RANLIB := $(if $(V),,@)$(CROSS_COMPILE)ranlib +override RM := $(if $(V),,@)rm -f +override SED := $(if $(V),,@)sed +override STRIP := $(if $(V),,@)$(CROSS_COMPILE)strip +override TAR := $(if $(V),,@)tar +override TOUCH := $(if $(V),,@)touch +override USEASM := $(if $(V),,@)$(HOST_OUT)/useasm +override USELINK := $(if $(V),,@)$(HOST_OUT)/uselink +override VHD2INC := $(if $(V),,@)$(HOST_OUT)/vhd2inc +override ZIP := $(if $(V),,@)$(ZIP) diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/arch_common.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/arch_common.mk new file mode 100644 index 0000000..23f9175 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/arch_common.mk @@ -0,0 +1,61 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +SYS_CFLAGS := \ + -fno-short-enums \ + -funwind-tables \ + -D__linux__ \ + -I$(ANDROID_ROOT)/bionic/libc/arch-$(ANDROID_ARCH)/include \ + -I$(ANDROID_ROOT)/bionic/libc/include \ + -I$(ANDROID_ROOT)/bionic/libc/kernel/common \ + -I$(ANDROID_ROOT)/bionic/libc/kernel/arch-$(ANDROID_ARCH) \ + -I$(ANDROID_ROOT)/bionic/libm/include \ + -I$(ANDROID_ROOT)/bionic/libm/include/$(ANDROID_ARCH) \ + -I$(ANDROID_ROOT)/bionic/libthread_db/include \ + -I$(ANDROID_ROOT)/frameworks/base/include \ + -isystem $(ANDROID_ROOT)/system/core/include \ + -I$(ANDROID_ROOT)/hardware/libhardware/include \ + -I$(ANDROID_ROOT)/external/openssl/include + +SYS_EXE_LDFLAGS := \ + -Bdynamic -nostdlib -Wl,-dynamic-linker,/system/bin/linker \ + -lc -ldl -lcutils + +SYS_LIB_LDFLAGS := $(SYS_EXE_LDFLAGS) diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/armv7-a.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/armv7-a.mk new file mode 100644 index 0000000..8c3f937 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/armv7-a.mk @@ -0,0 +1,68 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +OPTIM := -Os + +ANDROID_ARCH := arm +include ../common/android/arch_common.mk + +SYS_CFLAGS += -march=armv7-a + +SYS_EXE_CRTBEGIN := $(TOOLCHAIN)/lib/crtbegin_dynamic.o +SYS_EXE_CRTEND := $(TOOLCHAIN)/lib/crtend_android.o + +# Handle the removal of the armelf.x and armelf.xsc linker scripts. +ifeq ($(strip $(wildcard $(ANDROID_ROOT)/build/core/armelf.x)),) +# The linker scripts have been removed. We need to use these options +# instead. +SYS_EXE_LDFLAGS += -Wl,-z,relro -Wl,-z,now +SYS_LIB_LDFLAGS += -Wl,-z,relro -Wl,-z,now +else +# The linker scripts are still present in the Android tree, so we need to +# use them. +SYS_EXE_LDFLAGS += -Wl,-T$(ANDROID_ROOT)/build/core/armelf.x +SYS_LIB_LDFLAGS += -Wl,-T$(ANDROID_ROOT)/build/core/armelf.xsc +endif + +JNI_CPU_ABI := armeabi + +# Android builds are usually GPL +# +LDM_PLATFORM ?= 1 diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/extra_config.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/extra_config.mk new file mode 100644 index 0000000..320804e --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/extra_config.mk @@ -0,0 +1,47 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + + +$(eval $(call BothConfigC,ANDROID,)) + + + + + diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/features.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/features.mk new file mode 100644 index 0000000..8a60fb7 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/features.mk @@ -0,0 +1,326 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +include ../common/android/platform_version.mk + +# Basic support option tuning for Android +# +SUPPORT_ANDROID_PLATFORM := 1 +SUPPORT_OPENGLES1_V1_ONLY := 1 + +# Meminfo IDs are required for buffer stamps +# +SUPPORT_MEMINFO_IDS := 1 + +# Need multi-process support in PDUMP +# +SUPPORT_PDUMP_MULTI_PROCESS := 1 + +# Always print debugging after 5 seconds of no activity +# +CLIENT_DRIVER_DEFAULT_WAIT_RETRIES := 50 + +# Android WSEGL is always the same +# +OPK_DEFAULT := libpvrANDROID_WSEGL.so + +# srvkm is always built, but bufferclass_example is only built +# before EGL_image_external was generally available. +# +KERNEL_COMPONENTS := srvkm +ifeq ($(is_at_least_honeycomb),0) +KERNEL_COMPONENTS += bufferclass_example +endif + +# Kernel modules are always installed here under Android +# +PVRSRV_MODULE_BASEDIR := /system/modules/ + +# Use the new PVR_DPF implementation to allow lower message levels +# to be stripped from production drivers +# +PVRSRV_NEW_PVR_DPF := 1 + +# Production Android builds don't want PVRSRVGetDCSystemBuffer +# +SUPPORT_PVRSRV_GET_DC_SYSTEM_BUFFER := 0 + +# Prefer to limit the 3D parameters heap to <16MB and move the +# extra 48MB to the general heap. This only affects cores with +# 28bit MMUs (520, 530, 531, 540). +# +SUPPORT_LARGE_GENERAL_HEAP := 1 + +# Enable a page pool for uncached memory allocations. This improves +# the performance of such allocations because the pages are temporarily +# not returned to Linux and therefore do not have to be re-invalidated +# (fewer cache invalidates are needed). +# +# Default the cache size to a maximum of 5400 pages (~21MB). If using +# newer Linux kernels (>=3.0) the cache may be reclaimed and become +# smaller than this maximum during runtime. +# +PVR_LINUX_MEM_AREA_POOL_MAX_PAGES ?= 5400 + +############################################################################## +# EGL connect/disconnect hooks only available since Froyo +# Obsolete in future versions +# +ifeq ($(is_at_least_froyo),1) +ifeq ($(is_at_least_icecream_sandwich),0) +PVR_ANDROID_HAS_CONNECT_DISCONNECT := 1 +endif +endif + +############################################################################## +# Override surface field name for older versions +# +ifeq ($(is_at_least_gingerbread),0) +PVR_ANDROID_SURFACE_FIELD_NAME := \"mSurface\" +endif + +############################################################################## +# Provide ANativeWindow{Buffer,} typedefs for older versions +# +ifeq ($(is_at_least_gingerbread),0) +PVR_ANDROID_NEEDS_ANATIVEWINDOW_TYPEDEF := 1 +endif +ifeq ($(is_at_least_icecream_sandwich),0) +PVR_ANDROID_NEEDS_ANATIVEWINDOWBUFFER_TYPEDEF := 1 +endif + +############################################################################## +# Handle various platform includes for unittests +# +UNITTEST_INCLUDES := eurasiacon/android + +ifeq ($(is_at_least_gingerbread),1) +UNITTEST_INCLUDES += $(ANDROID_ROOT)/frameworks/base/native/include +endif + +ifeq ($(is_at_least_jellybean),1) +UNITTEST_INCLUDES += \ + $(ANDROID_ROOT)/frameworks/native/include \ + $(ANDROID_ROOT)/frameworks/native/opengl/include \ + $(ANDROID_ROOT)/libnativehelper/include +# FIXME: This is the old location for the JNI header. +UNITTEST_INCLUDES += $(ANDROID_ROOT)/dalvik/libnativehelper/include +else +UNITTEST_INCLUDES += \ + $(ANDROID_ROOT)/frameworks/base/opengl/include \ + $(ANDROID_ROOT)/dalvik/libnativehelper/include +endif + +# But it doesn't have OpenVG headers +# +UNITTEST_INCLUDES += eurasiacon/unittests/include + +############################################################################## +# Future versions moved proprietary libraries to a vendor directory +# +ifeq ($(is_at_least_gingerbread),1) +SHLIB_DESTDIR := /system/vendor/lib +DEMO_DESTDIR := /system/vendor/bin +else +SHLIB_DESTDIR := /system/lib +DEMO_DESTDIR := /system/bin +endif + +# EGL libraries go in a special place +# +EGL_DESTDIR := $(SHLIB_DESTDIR)/egl + +############################################################################## +# We can support OpenCL in the build since Froyo (stlport was added in 2.2) +# +ifeq ($(is_at_least_froyo),1) +SYS_CXXFLAGS := \ + -fuse-cxa-atexit \ + $(SYS_CFLAGS) \ + -I$(ANDROID_ROOT)/bionic \ + -I$(ANDROID_ROOT)/external/stlport/stlport +else +SYS_CXXFLAGS := \ + $(SYS_CFLAGS) \ + -I$(ANDROID_ROOT)/bionic/libstdc++/include +endif + +############################################################################## +# Composition bypass feature, supported since Froyo. +# In ICS, hardware composer (HWC) should be used instead. +# +ifeq ($(is_at_least_froyo),1) +ifeq ($(is_at_least_honeycomb),0) +PVR_ANDROID_HAS_NATIVE_BUFFER_TRANSFORM := 1 +SUPPORT_ANDROID_COMPOSITION_BYPASS := 1 +endif +endif + +############################################################################## +# In ICS, we have hardware composer (HWC) support. +# +# SUPPORT_ANDROID_COMPOSER_HAL adds Post2() to the framebuffer HAL interface +# and is intended for inter-op with external HWC modules. It is always +# enabled (but we allow it to be compiled out just in case). +# +# SUPPORT_ANDROID_COMPOSITION_BYPASS adds a new buffer type (client buffers +# allocated from the framebuffer pool) which maximizes compatibility with +# most 3rdparty display controllers. It is orthogonal to HWC support. +# +ifeq ($(is_at_least_honeycomb),1) +SUPPORT_ANDROID_COMPOSER_HAL := 1 +endif + +############################################################################## +# We have some extra GRALLOC_USAGE bits we need to handle in ICS +# +ifeq ($(is_at_least_honeycomb),1) +PVR_ANDROID_HAS_GRALLOC_USAGE_EXTERNAL_DISP := 1 +PVR_ANDROID_HAS_GRALLOC_USAGE_PROTECTED := 1 +PVR_ANDROID_HAS_GRALLOC_USAGE_PRIVATE := 1 +endif + +############################################################################## +# Support the new OES_EGL_image_external extension + YV12 buffers +# +ifeq ($(is_at_least_honeycomb),1) +PVR_ANDROID_HAS_HAL_PIXEL_FORMAT_YV12 := 1 +GLES1_EXTENSION_EGL_IMAGE_EXTERNAL := 1 +GLES2_EXTENSION_EGL_IMAGE_EXTERNAL := 1 +endif + +############################################################################## +# Gingerbread adds the native window cancelBuffer operation +# +ifeq ($(is_at_least_gingerbread),1) +PVR_ANDROID_HAS_CANCELBUFFER := 1 +endif + +############################################################################## +# Versions prior to ICS have another header we must include +# +ifeq ($(is_at_least_icecream_sandwich),0) +PVR_ANDROID_HAS_ANDROID_NATIVE_BUFFER_H := 1 +endif + +############################################################################## +# ICS added dump() hook to gralloc alloc_device_t API +# +ifeq ($(is_at_least_honeycomb),1) +PVR_ANDROID_HAS_GRALLOC_DUMP := 1 +endif + +############################################################################## +# ICS added support for the BGRX pixel format, and allows drivers to advertise +# configs in this format instead of RGBX. +# +# The DDK provides a private definition of HAL_PIXEL_FORMAT_BGRX_8888. This +# option exposes it as the native visual for 8888 configs with alpha ignored +# +ifeq ($(is_at_least_icecream_sandwich),1) +SUPPORT_HAL_PIXEL_FORMAT_BGRX := 1 +endif + +############################################################################## +# ICS added the ability for GL clients to pre-rotate their rendering to the +# orientation desired by the compositor. The SGX DDK can use TRANSFORM_HINT +# to access this functionality. +# +# This is required by some HWC implementations that cannot use the display +# to rotate buffers, otherwise the HWC optimization cannot be used when +# rotating the device. +# +ifeq ($(is_at_least_icecream_sandwich),1) +PVR_ANDROID_HAS_WINDOW_TRANSFORM_HINT := 1 +endif + +############################################################################## +# ICS requires that at least one driver EGLConfig advertises the +# EGL_RECORDABLE_ANDROID attribute. The platform requires that surfaces +# rendered with this config can be consumed by an OMX video encoder. +# +ifeq ($(is_at_least_icecream_sandwich),1) +EGL_EXTENSION_ANDROID_RECORDABLE := 1 +endif + +############################################################################## +# ICS added a new usage bit. USAGE_HW_COMPOSER indicates that a buffer might +# be used with HWComposer. In practice this is all non-MM buffers. +# +ifeq ($(is_at_least_icecream_sandwich),1) +PVR_ANDROID_HAS_GRALLOC_USAGE_HW_COMPOSER := 1 +endif + +############################################################################## +# ICS added the EGL_ANDROID_blob_cache extension. Enable support for this +# extension in EGL/GLESv2. +# +ifeq ($(is_at_least_icecream_sandwich),1) +EGL_EXTENSION_ANDROID_BLOB_CACHE := 1 +endif + +############################################################################## +# ICS MR1 added a new usage bit. USAGE_HW_VIDEO_ENCODER indicates that a +# buffer might be used with the video encoder. +# +ifeq ($(is_at_least_icecream_sandwich_mr1),1) +PVR_ANDROID_HAS_GRALLOC_USAGE_HW_VIDEO_ENCODER := 1 +endif + +############################################################################## +# ICS and earlier should rate-limit composition by waiting for 3D renders +# to complete in the compositor's eglSwapBuffers(). +# +ifeq ($(is_at_least_jellybean),0) +PVR_ANDROID_COMPOSITOR_WAIT_FOR_RENDER := 1 +endif + +############################################################################## +# JB added a new corkscrew API for userland backtracing. +# +ifeq ($(is_at_least_jellybean),1) +PVR_ANDROID_HAS_CORKSCREW_API := 1 +endif + +# Placeholder for future version handling +# +ifeq ($(is_future_version),1) +-include ../common/android/future_version.mk +endif diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/paths.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/paths.mk new file mode 100644 index 0000000..5c8f000 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/paths.mk @@ -0,0 +1,53 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +TARGET_BUILD_TYPE ?= release + +OUT_DIR ?= $(ANDROID_ROOT)/out + +ifeq ($(TARGET_BUILD_TYPE),debug) +TARGET_ROOT := $(OUT_DIR)/debug/target +else +TARGET_ROOT := $(OUT_DIR)/target +endif + +TOOLCHAIN ?= $(TARGET_ROOT)/product/$(TARGET_PRODUCT)/obj + +LIBGCC := $(shell $(CROSS_COMPILE)gcc -print-libgcc-file-name) diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/platform_version.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/platform_version.mk new file mode 100644 index 0000000..698efa3 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/android/platform_version.mk @@ -0,0 +1,156 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +# Figure out the version of Android we're building against. +# +PLATFORM_VERSION := $(shell \ + if [ -f $(TARGET_ROOT)/product/$(TARGET_PRODUCT)/system/build.prop ]; then \ + cat $(TARGET_ROOT)/product/$(TARGET_PRODUCT)/system/build.prop | \ + grep ^ro.build.version.release | cut -f2 -d'=' | cut -f1 -d'-'; \ + else \ + echo 4.0.3; \ + fi) + +define version-starts-with +$(shell echo $(PLATFORM_VERSION) | grep -q ^$(1); \ + [ "$$?" = "0" ] && echo 1 || echo 0) +endef + +# ro.build.version.release contains the version number for release builds, or +# the version codename otherwise. In this case we need to assume that the +# version of Android we're building against has the features that are in the +# final release of that version, so we set PLATFORM_VERSION to the +# corresponding release number. +# +ifeq ($(call version-starts-with,Eclair),1) +PLATFORM_VERSION := 2.0 +else ifeq ($(call version-starts-with,Froyo),1) +PLATFORM_VERSION := 2.2 +else ifeq ($(call version-starts-with,Gingerbread),1) +PLATFORM_VERSION := 2.3 +else ifeq ($(call version-starts-with,Honeycomb),1) +PLATFORM_VERSION := 3.0 +else ifeq ($(call version-starts-with,IceCreamSandwichMR),1) +PLATFORM_VERSION := 4.0.3 +else ifeq ($(call version-starts-with,IceCreamSandwich),1) +PLATFORM_VERSION := 4.0 +else ifeq ($(call version-starts-with,JellyBean),1) +PLATFORM_VERSION := 4.1 +else ifeq ($(shell echo $(PLATFORM_VERSION) | grep -qE "[A-Za-z]+"; echo $$?),0) +PLATFORM_VERSION := 5.0 +endif + +PLATFORM_VERSION_MAJ := $(shell echo $(PLATFORM_VERSION) | cut -f1 -d'.') +PLATFORM_VERSION_MIN := $(shell echo $(PLATFORM_VERSION) | cut -f2 -d'.') +PLATFORM_VERSION_PATCH := $(shell echo $(PLATFORM_VERSION) | cut -f3 -d'.') + +# Not all versions have a patchlevel; fix that up here +# +ifeq ($(PLATFORM_VERSION_PATCH),) +PLATFORM_VERSION_PATCH := 0 +endif + +# Macros to help categorize support for features and API_LEVEL for tests. +# +is_at_least_eclair := \ + $(shell ( test $(PLATFORM_VERSION_MAJ) -gt 2 || \ + ( test $(PLATFORM_VERSION_MAJ) -eq 2 && \ + test $(PLATFORM_VERSION_MIN) -ge 0 ) ) && echo 1 || echo 0) +is_at_least_froyo := \ + $(shell ( test $(PLATFORM_VERSION_MAJ) -gt 2 || \ + ( test $(PLATFORM_VERSION_MAJ) -eq 2 && \ + test $(PLATFORM_VERSION_MIN) -ge 2 ) ) && echo 1 || echo 0) +is_at_least_gingerbread := \ + $(shell ( test $(PLATFORM_VERSION_MAJ) -gt 2 || \ + ( test $(PLATFORM_VERSION_MAJ) -eq 2 && \ + test $(PLATFORM_VERSION_MIN) -ge 3 ) ) && echo 1 || echo 0) +is_at_least_honeycomb := \ + $(shell test $(PLATFORM_VERSION_MAJ) -ge 3 && echo 1 || echo 0) +is_at_least_icecream_sandwich := \ + $(shell test $(PLATFORM_VERSION_MAJ) -ge 4 && echo 1 || echo 0) +is_at_least_icecream_sandwich_mr1 := \ + $(shell ( test $(PLATFORM_VERSION_MAJ) -gt 4 || \ + ( test $(PLATFORM_VERSION_MAJ) -eq 4 && \ + ( test $(PLATFORM_VERSION_MIN) -ge 1 || \ + test $(PLATFORM_VERSION_PATCH) -ge 3 ) ) ) && echo 1 || echo 0) +is_at_least_jellybean := \ + $(shell ( test $(PLATFORM_VERSION_MAJ) -gt 4 || \ + ( test $(PLATFORM_VERSION_MAJ) -eq 4 && \ + test $(PLATFORM_VERSION_MIN) -ge 1 ) ) && echo 1 || echo 0) + +# FIXME: Assume "future versions" are >=5.0, but we don't really know +is_future_version := \ + $(shell ( test $(PLATFORM_VERSION_MAJ) -ge 5 ) && echo 1 || echo 0) + +# Picking an exact match of API_LEVEL for the platform we're building +# against can avoid compatibility theming and affords better integration. +# +ifeq ($(is_future_version),1) +API_LEVEL := 17 +else ifeq ($(is_at_least_jellybean),1) +API_LEVEL := 16 +else ifeq ($(is_at_least_icecream_sandwich),1) +# MR1 15 +API_LEVEL := 14 +else ifeq ($(is_at_least_honeycomb),1) +# MR2 13 +# MR1 12 +API_LEVEL := 11 +else ifeq ($(is_at_least_gingerbread),1) +# MR1 10 +API_LEVEL := 9 +else ifeq ($(is_at_least_froyo),1) +API_LEVEL := 8 +else ifeq ($(is_at_least_eclair),1) +# MR1 7 +# 2.0.1 6 +API_LEVEL := 5 +else +$(error Must build against Android >= 2.0) +endif + +# Each DDK is tested against only a single version of the platform. +# Warn if a different platform version is used. +# +ifeq ($(is_future_version),1) +$(info WARNING: Android version is newer than this DDK supports) +else ifneq ($(is_at_least_icecream_sandwich),1) +$(info WARNING: Android version is older than this DDK supports) +endif diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/dridrm.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/dridrm.mk new file mode 100644 index 0000000..5d0289f --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/dridrm.mk @@ -0,0 +1,63 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +$(eval $(call TunableBothConfigC,SUPPORT_DRI_DRM,)) +$(eval $(call TunableBothConfigC,SUPPORT_DRI_DRM_EXT,)) +$(eval $(call TunableKernelConfigC,SUPPORT_DRI_DRM_PLUGIN,)) + + +$(eval $(call TunableBothConfigMake,SUPPORT_DRI_DRM,)) + +ifeq ($(SUPPORT_DRI_DRM),1) +ifeq ($(SUPPORT_DRI_DRM_NO_LIBDRM),1) +endif +$(eval $(call TunableKernelConfigC,PVR_SECURE_DRM_AUTH_EXPORT,)) +$(eval $(call TunableKernelConfigC,SUPPORT_DRM_MODESET,)) +endif + +$(eval $(call TunableKernelConfigC,PVR_DISPLAY_CONTROLLER_DRM_IOCTL,)) + +$(eval $(call TunableBothConfigC,PVR_DRI_DRM_NOT_PCI)) +$(eval $(call TunableBothConfigMake,PVR_DRI_DRM_NOT_PCI)) + +$(eval $(call TunableKernelConfigC,PVR_DRI_DRM_PLATFORM_DEV,)) + + +export EXTERNAL_3PDD_TARBALL diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/omap4.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/omap4.mk new file mode 100644 index 0000000..153159a --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/omap4.mk @@ -0,0 +1,43 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +$(eval $(call TunableKernelConfigC,PVR_NO_OMAP_TIMER,)) +$(eval $(call TunableKernelConfigC,PVR_OMAPLFB_DONT_USE_FB_PAN_DISPLAY,)) +$(eval $(call TunableKernelConfigC,PVR_OMAPLFB_DRM_FB,)) diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/opencl.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/opencl.mk new file mode 100644 index 0000000..b5f84d4 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/common/opencl.mk @@ -0,0 +1,40 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/core.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/core.mk new file mode 100644 index 0000000..247d1e1 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/core.mk @@ -0,0 +1,604 @@ +########################################################################### ### +#@Title Root build configuration. +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +# Configuration wrapper for new build system. This file deals with +# configuration of the build. Add to this file anything that deals +# with switching driver options on/off and altering the defines or +# objects the build uses. +# +# At the end of this file is an exhaustive list of all variables +# that are passed between the platform/config stage and the generic +# build. PLEASE refrain from adding more variables than necessary +# to this stage -- almost all options can go through config.h. +# + +################################# MACROS #################################### + +# Write out a kernel GNU make option. +# +define KernelConfigMake +$$(shell echo "override $(1) := $(2)" >>$(CONFIG_KERNEL_MK).new) +endef + +# Write out a GNU make option for both user & kernel +# +define BothConfigMake +$$(eval $$(call KernelConfigMake,$(1),$(2))) +endef + +# Conditionally write out a kernel GNU make option +# +define TunableKernelConfigMake +ifneq ($$($(1)),) +ifneq ($$($(1)),0) +$$(eval $$(call KernelConfigMake,$(1),$$($(1)))) +endif +else +ifneq ($(2),) +$$(eval $$(call KernelConfigMake,$(1),$(2))) +endif +endif +endef + +# Conditionally write out a GNU make option for both user & kernel +# +define TunableBothConfigMake +$$(eval $$(call TunableKernelConfigMake,$(1),$(2))) +endef + +# Write out a kernel-only option +# +define KernelConfigC +$$(shell echo "#define $(1) $(2)" >>$(CONFIG_KERNEL_H).new) +endef + +# Write out an option for both user & kernel +# +define BothConfigC +$$(eval $$(call KernelConfigC,$(1),$(2))) +endef + +# Conditionally write out a kernel-only option +# +define TunableKernelConfigC +ifneq ($$($(1)),) +ifneq ($$($(1)),0) +ifeq ($$($(1)),1) +$$(eval $$(call KernelConfigC,$(1),)) +else +$$(eval $$(call KernelConfigC,$(1),$$($(1)))) +endif +endif +else +ifneq ($(2),) +ifeq ($(2),1) +$$(eval $$(call KernelConfigC,$(1),)) +else +$$(eval $$(call KernelConfigC,$(1),$(2))) +endif +endif +endif +endef + +# Conditionally write out an option for both user & kernel +# +define TunableBothConfigC +$$(eval $$(call TunableKernelConfigC,$(1),$(2))) +endef + +############################### END MACROS ################################## + +# Check we have a new enough version of GNU make. +# +need := 3.81 +ifeq ($(filter $(need),$(firstword $(sort $(MAKE_VERSION) $(need)))),) +$(error A version of GNU make >= $(need) is required - this is version $(MAKE_VERSION)) +endif + +# Try to guess EURASIAROOT if it wasn't set. Check this location. +# +_GUESSED_EURASIAROOT := $(abspath ../../../..) +ifneq ($(strip $(EURASIAROOT)),) +# We don't want to warn about EURASIAROOT if it's empty: this might mean that +# it's not set at all anywhere, but it could also mean that it's set like +# "export EURASIAROOT=" or "make EURASIAROOT= sometarget". If it is set but +# empty, we'll act as if it's unset and not warn. +ifneq ($(strip $(EURASIAROOT)),$(_GUESSED_EURASIAROOT)) +nothing := +space := $(nothing) $(nothing) +$(warning EURASIAROOT is set (via: $(origin EURASIAROOT)), but its value does not) +$(warning match the root of this source tree, so it is being ignored) +$(warning EURASIAROOT is set to: $(EURASIAROOT)) +$(warning $(space)The detected root is: $(_GUESSED_EURASIAROOT)) +$(warning To suppress this message, unset EURASIAROOT or set it empty) +endif +# else, EURASIAROOT matched the actual root of the source tree: don't warn +endif +override EURASIAROOT := $(_GUESSED_EURASIAROOT) +TOP := $(EURASIAROOT) + +ifneq ($(words $(TOP)),1) +$(warning This source tree is located in a path which contains whitespace,) +$(warning which is not supported.) +$(warning $(space)The root is: $(TOP)) +$(error Whitespace found in $$(TOP)) +endif + +$(call directory-must-exist,$(TOP)) + +include ../defs.mk + +# Infer PVR_BUILD_DIR from the directory configuration is launched from. +# Check anyway that such a directory exists. +# +PVR_BUILD_DIR := $(notdir $(abspath .)) +$(call directory-must-exist,$(TOP)/eurasiacon/build/linux2/$(PVR_BUILD_DIR)) + +# Output directory for configuration, object code, +# final programs/libraries, and install/rc scripts. +# +BUILD ?= release +# TI: Added SGX type to binary build location so builds for different GPUs +# with the same build directory are put in different places +OUT ?= $(TOP)/eurasiacon/binary2_$(SGXCORE)_$(SGX_CORE_REV)_$(PVR_BUILD_DIR)_$(BUILD) +override OUT := $(if $(filter /%,$(OUT)),$(OUT),$(TOP)/$(OUT)) + +CONFIG_MK := $(OUT)/config.mk +CONFIG_H := $(OUT)/config.h +CONFIG_KERNEL_MK := $(OUT)/config_kernel.mk +CONFIG_KERNEL_H := $(OUT)/config_kernel.h + +# Create the OUT directory and delete any previous intermediary files +# +$(shell mkdir -p $(OUT)) +$(shell \ + for file in $(CONFIG_MK).new $(CONFIG_H).new \ + $(CONFIG_KERNEL_MK).new $(CONFIG_KERNEL_H).new; do \ + rm -f $$file; \ + done) + +# Some targets don't need information about any modules. If we only specify +# these targets on the make command line, set INTERNAL_CLOBBER_ONLY to +# indicate that toplevel.mk shouldn't read any makefiles +CLOBBER_ONLY_TARGETS := clean clobber help install +INTERNAL_CLOBBER_ONLY := +ifneq ($(strip $(MAKECMDGOALS)),) +INTERNAL_CLOBBER_ONLY := \ +$(if \ + $(strip $(foreach _cmdgoal,$(MAKECMDGOALS),\ + $(if $(filter $(_cmdgoal),$(CLOBBER_ONLY_TARGETS)),,x))),,true) +endif + +# For a clobber-only build, we shouldn't regenerate any config files, or +# require things like SGXCORE to be set +ifneq ($(INTERNAL_CLOBBER_ONLY),true) + +-include ../config/user-defs.mk + +# FIXME: Backwards compatibility remaps. +# +ifeq ($(SUPPORT_SLC),1) +SGX_FEATURE_SYSTEM_CACHE := 1 +endif +ifeq ($(BYPASS_SLC),1) +SGX_BYPASS_SYSTEM_CACHE := 1 +endif +ifeq ($(BYPASS_DCU),1) +SGX_BYPASS_DCU := 1 +endif +ifneq ($(SGXCOREREV),) +SGX_CORE_REV := $(SGXCOREREV) +endif + +# Core handling +# +ifeq ($(SGXCORE),) +$(error Must specify SGXCORE) +endif +ifeq ($(SGX_CORE_REV),) +override USE_SGX_CORE_REV_HEAD := 1 +else ifeq ($(SGX_CORE_REV),000) +override USE_SGX_CORE_REV_HEAD := 1 +override SGX_CORE_REV := +else +override USE_SGX_CORE_REV_HEAD := 0 +endif + +# Enforced dependencies. Move this to an include. +# +ifeq ($(SUPPORT_LINUX_USING_WORKQUEUES),1) +override PVR_LINUX_USING_WORKQUEUES := 1 +override PVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE := 1 +override PVR_LINUX_TIMERS_USING_WORKQUEUES := 1 +override SYS_CUSTOM_POWERLOCK_WRAP := 1 +else ifeq ($(SUPPORT_LINUX_USING_SHARED_WORKQUEUES),1) +override PVR_LINUX_USING_WORKQUEUES := 1 +override PVR_LINUX_MISR_USING_WORKQUEUE := 1 +override PVR_LINUX_TIMERS_USING_SHARED_WORKQUEUE := 1 +override SYS_CUSTOM_POWERLOCK_WRAP := 1 +endif + +ifneq ($(PDUMP),1) +override SUPPORT_PDUMP_MULTI_PROCESS := 0 +endif + +ifeq ($(SUPPORT_HYBRID_PB),1) +override SUPPORT_SHARED_PB := 1 +override SUPPORT_PERCONTEXT_PB := 1 +else ifeq ($(SUPPORT_PERCONTEXT_PB),1) +override SUPPORT_SHARED_PB := 0 +endif + +ifeq ($(NO_HARDWARE),1) +override SYS_USING_INTERRUPTS := 0 +override SUPPORT_HW_RECOVERY := 0 +override SUPPORT_ACTIVE_POWER_MANAGEMENT := 0 +endif + +# We're bumping against USSE limits on older cores because the ukernel +# is too large when building both SGX_DISABLE_VISTEST_SUPPORT=0 and +# PVRSRV_USSE_EDM_STATUS_DEBUG=1. +# +# Automatically disable vistest support if debugging the ukernel to +# prevent build failures. +# +ifneq ($(filter 520 530 531 535 540,$(SGXCORE)),) +ifneq ($(SGX_DISABLE_VISTEST_SUPPORT),1) +SGX_DISABLE_VISTEST_SUPPORT ?= not-overridden +ifeq ($(SGX_DISABLE_VISTEST_SUPPORT),not-overridden) +$(warning Setting SGX_DISABLE_VISTEST_SUPPORT=1 because PVRSRV_USSE_EDM_STATUS_DEBUG=1) +SGX_DISABLE_VISTEST_SUPPORT := 1 +endif +endif +endif + +ifeq ($(SGXCORE),535) +ifeq ($(PVRSRV_USSE_EDM_STATUS_DEBUG),1) +SUPPORT_SGX_HWPERF ?= not-overridden +ifeq ($(SUPPORT_SGX_HWPERF),not-overridden) +$(warning Setting SUPPORT_SGX_HWPERF=0 because PVRSRV_USSE_EDM_STATUS_DEBUG=1) +SUPPORT_SGX_HWPERF := 0 +endif +endif +PVR2D_ALT_2DHW ?= 0 +endif + +# Multi-core handling must be done separately to other options +# Also do some sanity checks +# +ifeq ($(SGX_FEATURE_MP),1) +ifeq ($(SGX_FEATURE_MP_CORE_COUNT),) +ifeq ($(SGX_FEATURE_MP_CORE_COUNT_TA),) +$(error Must specify SGX_FEATURE_MP_CORE_COUNT or both SGX_FEATURE_MP_CORE_COUNT_TA and SGX_FEATURE_MP_CORE_COUNT_3D with SGX_FEATURE_MP) +else +$(eval $(call BothConfigC,SGX_FEATURE_MP_CORE_COUNT_TA,$(SGX_FEATURE_MP_CORE_COUNT_TA))) +endif +ifeq ($(SGX_FEATURE_MP_CORE_COUNT_3D),) +$(error Must specify SGX_FEATURE_MP_CORE_COUNT or both SGX_FEATURE_MP_CORE_COUNT_TA and SGX_FEATURE_MP_CORE_COUNT_3D with SGX_FEATURE_MP) +else +$(eval $(call BothConfigC,SGX_FEATURE_MP_CORE_COUNT_3D,$(SGX_FEATURE_MP_CORE_COUNT_3D))) +endif +else +$(eval $(call BothConfigC,SGX_FEATURE_MP_CORE_COUNT,$(SGX_FEATURE_MP_CORE_COUNT))) +endif +endif + +# Rather than requiring the user to have to define two variables (one quoted, +# one not), make PVRSRV_MODNAME a non-tunable and give it an overridable +# default here. +# +PVRSRV_MODNAME ?= pvrsrvkm + +# The user didn't set CROSS_COMPILE. There's probably nothing wrong +# with that, but we'll let them know anyway. +# +ifeq ($(CROSS_COMPILE),) +$(warning CROSS_COMPILE is not set. Target components will be built with the host compiler) +endif + +# The user is trying to set one of the old SUPPORT_ options on the +# command line or in the environment. This isn't supported any more +# and will often break the build. The user is generally only trying +# to remove a component from the list of targets to build, so we'll +# point them at the new way of doing this. +define sanity-check-support-option-origin +ifeq ($$(filter undefined file,$$(origin $(1))),) +$$(warning *** Setting $(1) via $$(origin $(1)) is deprecated) +$$(error If you are trying to disable a component, use e.g. EXCLUDED_APIS="opengles1 opengl") +endif +endef +$(foreach _o,SYS_CFLAGS SYS_CXXFLAGS SYS_EXE_LDFLAGS SYS_LIB_LDFLAGS SUPPORT_EWS SUPPORT_OPENGLES1 SUPPORT_OPENGLES2 SUPPORT_OPENVG SUPPORT_OPENCL SUPPORT_OPENGL SUPPORT_UNITTESTS SUPPORT_XORG,$(eval $(call sanity-check-support-option-origin,$(_o)))) + +# Check for words in EXCLUDED_APIS that aren't understood by the +# common/apis/*.mk files. This should be kept in sync with all the tests on +# EXCLUDED_APIS in those files +_excludable_apis := opencl opengl opengles1 opengles2 openvg ews unittests xorg xorg_unittests scripts +_unrecognised := $(strip $(filter-out $(_excludable_apis),$(EXCLUDED_APIS))) +ifneq ($(_unrecognised),) +$(warning *** Unrecognised entries in EXCLUDED_APIS: $(_unrecognised)) +$(warning *** EXCLUDED_APIS was set via: $(origin EXCLUDED_APIS)) +$(error Excludable APIs are: $(_excludable_apis)) +endif + +# Build's selected list of components +# +-include components.mk + +# PDUMP needs extra components +# +ifeq ($(PDUMP),1) +ifneq ($(COMPONENTS),) +COMPONENTS += pdump +endif +ifeq ($(SUPPORT_DRI_DRM),1) +EXTRA_PVRSRVKM_COMPONENTS += dbgdrv +else +KERNEL_COMPONENTS += dbgdrv +endif +endif + +ifeq ($(SUPPORT_PVR_REMOTE),1) +ifneq ($(filter pvr2d,$(COMPONENTS)),) +COMPONENTS += null_pvr2d_remote +endif +COMPONENTS += pvrvncsrv +endif + +# If KERNELDIR is set, write it out to the config.mk, with +# KERNEL_COMPONENTS and KERNEL_ID +# +ifneq ($(strip $(KERNELDIR)),) +include ../kernel_version.mk +PVRSRV_MODULE_BASEDIR ?= /lib/modules/$(KERNEL_ID)/extra/ +$(eval $(call KernelConfigMake,KERNELDIR,$(KERNELDIR))) +# Needed only by install script +$(eval $(call KernelConfigMake,KERNEL_COMPONENTS,$(KERNEL_COMPONENTS))) +$(eval $(call TunableKernelConfigMake,EXTRA_PVRSRVKM_COMPONENTS,)) +$(eval $(call TunableKernelConfigMake,EXTRA_KBUILD_SOURCE,)) + +# If KERNEL_CROSS_COMPILE is set to "undef", this is magically +# equivalent to being unset. If it is unset, we use CROSS_COMPILE +# (which might also be unset). If it is set, use it directly. +ifneq ($(KERNEL_CROSS_COMPILE),undef) +KERNEL_CROSS_COMPILE ?= $(CROSS_COMPILE) +$(eval $(call TunableBothConfigMake,KERNEL_CROSS_COMPILE,)) +endif + +# Check the KERNELDIR has a kernel built and also check that it is +# not 64-bit, which we do not support. +VMLINUX := $(strip $(wildcard $(KERNELDIR)/vmlinux)) +ifneq ($(VMLINUX),) +VMLINUX_IS_64BIT := $(shell file $(VMLINUX) | grep -q 64-bit || echo false) +ifneq ($(VMLINUX_IS_64BIT),false) +$(warning $$(KERNELDIR)/vmlinux is 64-bit, which is not supported. Kbuild may fail.) +endif +else +$(warning $$(KERNELDIR)/vmlinux does not exist. Kbuild may fail.) +endif +endif + + +# Ideally configured by platform Makefiles, as necessary +# + +# Invariant options for Linux +# +$(eval $(call BothConfigC,LINUX,)) + +$(eval $(call BothConfigC,PVR_BUILD_DIR,"\"$(PVR_BUILD_DIR)\"")) +$(eval $(call BothConfigC,PVR_BUILD_TYPE,"\"$(BUILD)\"")) +$(eval $(call BothConfigC,PVRSRV_MODNAME,"\"$(PVRSRV_MODNAME)\"")) + +$(eval $(call TunableBothConfigC,SGXCORE,)) +$(eval $(call BothConfigC,SGX$(SGXCORE),)) +$(eval $(call BothConfigC,SUPPORT_SGX$(SGXCORE),)) + +$(eval $(call TunableBothConfigC,SUPPORT_SGX,1)) +$(eval $(call TunableBothConfigC,SGX_CORE_REV,)) +$(eval $(call TunableBothConfigC,USE_SGX_CORE_REV_HEAD,)) + +$(eval $(call BothConfigC,TRANSFER_QUEUE,)) +$(eval $(call BothConfigC,PVR_SECURE_HANDLES,)) + +ifneq ($(DISPLAY_CONTROLLER),) +$(eval $(call BothConfigC,DISPLAY_CONTROLLER,$(DISPLAY_CONTROLLER))) +endif + +PVR_LINUX_MEM_AREA_POOL_MAX_PAGES ?= 0 +ifneq ($(PVR_LINUX_MEM_AREA_POOL_MAX_PAGES),0) +PVR_LINUX_MEM_AREA_USE_VMAP ?= 1 +include ../kernel_version.mk +ifeq ($(call kernel-version-at-least,3,0),true) +PVR_LINUX_MEM_AREA_POOL_ALLOW_SHRINK ?= 1 +endif +endif +$(eval $(call KernelConfigC,PVR_LINUX_MEM_AREA_POOL_MAX_PAGES,$(PVR_LINUX_MEM_AREA_POOL_MAX_PAGES))) +$(eval $(call TunableKernelConfigC,PVR_LINUX_MEM_AREA_USE_VMAP,)) +$(eval $(call TunableKernelConfigC,PVR_LINUX_MEM_AREA_POOL_ALLOW_SHRINK,)) + + +$(eval $(call BothConfigMake,PVR_SYSTEM,$(PVR_SYSTEM))) + + +# Build-type dependent options +# +$(eval $(call BothConfigMake,BUILD,$(BUILD))) + +ifeq ($(BUILD),debug) +$(eval $(call BothConfigC,DEBUG,)) +$(eval $(call KernelConfigC,DEBUG_LINUX_MEMORY_ALLOCATIONS,)) +$(eval $(call KernelConfigC,DEBUG_LINUX_MEM_AREAS,)) +$(eval $(call KernelConfigC,DEBUG_LINUX_MMAP_AREAS,)) +$(eval $(call KernelConfigC,DEBUG_BRIDGE_KM,)) +else ifeq ($(BUILD),release) +$(eval $(call BothConfigC,RELEASE,)) +$(eval $(call TunableBothConfigMake,DEBUGLINK,1)) +else ifeq ($(BUILD),timing) +$(eval $(call BothConfigC,TIMING,)) +$(eval $(call TunableBothConfigMake,DEBUGLINK,1)) +else +$(error BUILD= must be either debug, release or timing) +endif + +# User-configurable options +# +$(eval $(call TunableBothConfigC,SUPPORT_PERCONTEXT_PB,1)) +$(eval $(call TunableBothConfigC,SUPPORT_SHARED_PB,)) +$(eval $(call TunableBothConfigC,SUPPORT_HYBRID_PB,)) +$(eval $(call TunableBothConfigC,SUPPORT_HW_RECOVERY,1)) +$(eval $(call TunableBothConfigC,SUPPORT_ACTIVE_POWER_MANAGEMENT,1)) +$(eval $(call TunableBothConfigC,SUPPORT_SGX_HWPERF,1)) +$(eval $(call TunableBothConfigC,SUPPORT_SGX_LOW_LATENCY_SCHEDULING,1)) +$(eval $(call TunableBothConfigC,SUPPORT_MEMINFO_IDS,)) +$(eval $(call TunableBothConfigC,SUPPORT_SGX_NEW_STATUS_VALS,1)) +$(eval $(call TunableBothConfigC,SUPPORT_PDUMP_MULTI_PROCESS,)) +$(eval $(call TunableBothConfigC,SUPPORT_DBGDRV_EVENT_OBJECTS,1)) +$(eval $(call TunableBothConfigC,SGX_FEATURE_SYSTEM_CACHE,)) +$(eval $(call TunableBothConfigC,SGX_BYPASS_SYSTEM_CACHE,)) +$(eval $(call TunableBothConfigC,SGX_BYPASS_DCU,)) +$(eval $(call TunableBothConfigC,SGX_FAST_DPM_INIT,)) +$(eval $(call TunableBothConfigC,SGX_FEATURE_MP,)) +$(eval $(call TunableBothConfigC,SGX_FEATURE_MP_PLUS,)) +$(eval $(call TunableBothConfigC,FPGA,)) +$(eval $(call TunableBothConfigC,PDUMP,)) +$(eval $(call TunableBothConfigC,NO_HARDWARE,)) +$(eval $(call TunableBothConfigC,PDUMP_DEBUG_OUTFILES,)) +$(eval $(call TunableBothConfigC,PVRSRV_USSE_EDM_STATUS_DEBUG,)) +$(eval $(call TunableBothConfigC,SGX_DISABLE_VISTEST_SUPPORT,)) +$(eval $(call TunableBothConfigC,PVRSRV_RESET_ON_HWTIMEOUT,)) +$(eval $(call TunableBothConfigC,SYS_USING_INTERRUPTS,1)) +$(eval $(call TunableBothConfigC,SUPPORT_EXTERNAL_SYSTEM_CACHE,)) +$(eval $(call TunableBothConfigC,PVRSRV_NEW_PVR_DPF,)) +$(eval $(call TunableBothConfigC,PVRSRV_NEED_PVR_DPF,)) +$(eval $(call TunableBothConfigC,PVRSRV_NEED_PVR_ASSERT,)) +$(eval $(call TunableBothConfigC,PVRSRV_NEED_PVR_TRACE,)) +$(eval $(call TunableBothConfigC,SUPPORT_SECURE_33657_FIX,)) +$(eval $(call TunableBothConfigC,SUPPORT_ION,)) +$(eval $(call TunableBothConfigC,SUPPORT_HWRECOVERY_TRACE_LIMIT,)) +$(eval $(call TunableBothConfigC,SUPPORT_PVRSRV_GET_DC_SYSTEM_BUFFER,1)) +$(eval $(call TunableBothConfigC,SUPPORT_NV12_FROM_2_HWADDRS,)) + +$(eval $(call TunableKernelConfigC,SUPPORT_LINUX_X86_WRITECOMBINE,1)) +$(eval $(call TunableKernelConfigC,SUPPORT_LINUX_X86_PAT,1)) +$(eval $(call TunableKernelConfigC,SGX_DYNAMIC_TIMING_INFO,)) +$(eval $(call TunableKernelConfigC,SYS_SGX_ACTIVE_POWER_LATENCY_MS,)) +$(eval $(call TunableKernelConfigC,SYS_CUSTOM_POWERLOCK_WRAP,)) +$(eval $(call TunableKernelConfigC,PVR_LINUX_USING_WORKQUEUES,)) +$(eval $(call TunableKernelConfigC,PVR_LINUX_MISR_USING_WORKQUEUE,)) +$(eval $(call TunableKernelConfigC,PVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE,)) +$(eval $(call TunableKernelConfigC,PVR_LINUX_TIMERS_USING_WORKQUEUES,)) +$(eval $(call TunableKernelConfigC,PVR_LINUX_TIMERS_USING_SHARED_WORKQUEUE,)) +$(eval $(call TunableKernelConfigC,LDM_PLATFORM,)) +$(eval $(call TunableKernelConfigC,PVR_LDM_PLATFORM_PRE_REGISTERED,)) +$(eval $(call TunableKernelConfigC,PVR_LDM_PLATFORM_PRE_REGISTERED_DEV,)) +$(eval $(call TunableKernelConfigC,PVR_LDM_DRIVER_REGISTRATION_NAME,"\"$(PVRSRV_MODNAME)\"")) +$(eval $(call TunableKernelConfigC,LDM_PCI,)) +$(eval $(call TunableKernelConfigC,PVRSRV_DUMP_MK_TRACE,)) +$(eval $(call TunableKernelConfigC,PVRSRV_DUMP_KERNEL_CCB,)) +$(eval $(call TunableKernelConfigC,PVRSRV_REFCOUNT_DEBUG,)) +$(eval $(call TunableKernelConfigC,PVRSRV_MMU_MAKE_READWRITE_ON_DEMAND,)) +$(eval $(call TunableKernelConfigC,HYBRID_SHARED_PB_SIZE,)) +$(eval $(call TunableKernelConfigC,SUPPORT_LARGE_GENERAL_HEAP,)) +$(eval $(call TunableKernelConfigC,TTRACE,)) + +ifeq ($(BUILD),debug) +$(eval $(call TunableKernelConfigC,CONFIG_PVR_PROC_FS,1)) +else +$(eval $(call TunableKernelConfigC,CONFIG_PVR_PROC_FS,)) +endif + +$(eval $(call TunableKernelConfigC,CONFIG_PVR_PROC_FS_HEAP_ALLOC_DEBUG,)) + +$(eval $(call TunableBothConfigMake,SUPPORT_ION,)) + + +$(eval $(call TunableBothConfigMake,OPTIM,)) + + +$(eval $(call TunableKernelConfigMake,TTRACE,)) + +endif # INTERNAL_CLOBBER_ONLY + +export INTERNAL_CLOBBER_ONLY +export TOP +export OUT + +MAKE_ETC := -Rr --no-print-directory -C $(TOP) TOP=$(TOP) OUT=$(OUT) \ + -f eurasiacon/build/linux2/toplevel.mk + +# This must match the default value of MAKECMDGOALS below, and the default +# goal in toplevel.mk +.DEFAULT_GOAL := build + +ifeq ($(MAKECMDGOALS),) +MAKECMDGOALS := build +else +# We can't pass autogen to toplevel.mk +MAKECMDGOALS := $(filter-out autogen,$(MAKECMDGOALS)) +endif + +.PHONY: autogen +autogen: +ifeq ($(INTERNAL_CLOBBER_ONLY),) + @$(MAKE) -s --no-print-directory -C $(EURASIAROOT) \ + -f eurasiacon/build/linux2/prepare_tree.mk \ + LDM_PCI=$(LDM_PCI) LDM_PLATFORM=$(LDM_PLATFORM) +else + @: +endif + +# This deletes built-in suffix rules. Otherwise the submake isn't run when +# saying e.g. "make thingy.a" +.SUFFIXES: + +# Because we have a match-anything rule below, we'll run the main build when +# we're actually trying to remake various makefiles after they're read in. +# These rules try to prevent that +%.mk: ; +Makefile%: ; +Makefile: ; + +.PHONY: build kbuild install +build kbuild install: autogen + @$(if $(MAKECMDGOALS),$(MAKE) $(MAKE_ETC) $(MAKECMDGOALS) $(eval MAKECMDGOALS :=),:) + +%: autogen + @$(if $(MAKECMDGOALS),$(MAKE) $(MAKE_ETC) $(MAKECMDGOALS) $(eval MAKECMDGOALS :=),:) diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/defs.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/defs.mk new file mode 100644 index 0000000..621e03e --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/defs.mk @@ -0,0 +1,140 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +define must-be-defined +$(if $(filter undefined,$(origin $(1))),$(error In makefile $(THIS_MAKEFILE): $$($(1)) must be defined),) +endef + +define must-be-nonempty +$(if $(strip $($(1))),,$(error In makefile $(THIS_MAKEFILE): $$($(1)) must contain a value)) +endef + +define directory-must-exist +$(if $(wildcard $(abspath $(1)/)),,$(error Directory $(1) must exist)) +endef + +define one-word-only +$(if $(filter-out $(firstword $($(1))),$($(1))),$(error In makefile $(THIS_MAKEFILE): $$($(1)) must contain only one word),) +endef + +define target-intermediates-of +$(addprefix $(TARGET_OUT)/intermediates/$(1)/,$(2)) +endef + +define host-intermediates-of +$(addprefix $(HOST_OUT)/intermediates/$(1)/,$(2)) +endef + +define module-library +$(patsubst lib%.so,%,$(if $($(1)_target),$($(1)_target),$(1).so)) +endef + +# This is done to allow module type makefiles to use $(THIS_MAKEFILE) +define register-module +INTERNAL_MAKEFILE_FOR_MODULE_$(1) := $(THIS_MAKEFILE) +endef + +define process-module +THIS_MODULE := $(1) +THIS_MAKEFILE := $(INTERNAL_MAKEFILE_FOR_MODULE_$(1)) +include $$(MAKE_TOP)/this_makefile.mk +$$(call must-be-nonempty,THIS_MAKEFILE) +$$(call must-be-nonempty,$(1)_type) +MODULE_HOST_BUILD := $$(if $(filter host_%,$($(1)_type)),true,) +include $$(MAKE_TOP)/moduledefs.mk +include $$(MAKE_TOP)/$$(patsubst host_%,%,$($(1)_type)).mk +INTERNAL_TARGETS_FOR_$(THIS_MODULE) := $(MODULE_TARGETS) +endef + +# This can be used by module_type.mk files to indicate that they can't be +# built as host_module_type +define target-build-only +$(if $(filter true,$(MODULE_HOST_BUILD)),$(error In makefile $(THIS_MAKEFILE): Module $(THIS_MODULE) attempted to build a host $(1), which is not supported)) +endef + +define relative-to-top +$(patsubst $(TOP)/%,%,$(1)) +endef + +define cc-check +$(shell \ + CC_CHECK=$(patsubst @%,%,$(CC_CHECK)) && \ + $(patsubst @%,%,$(CHMOD)) +x $$CC_CHECK && \ + $$CC_CHECK --cc "$(1)" --out "$(2)" $(3)) +endef + +define cc-is-64bit +$(call cc-check,$(1),$(OUT),--64) +endef + +define cc-option +$(call cc-check,$(patsubst @%,%,$(CC)),$(OUT),$(1)) +endef + +define cxx-option +$(call cc-check,$(patsubst @%,%,$(CXX)),$(OUT),$(1)) +endef + +define host-cc-option +$(call cc-check,$(patsubst @%,%,$(HOST_CC)),$(OUT),$(1)) +endef + +define kernel-cc-option +$(call cc-check,$(KERNEL_CROSS_COMPILE)gcc,$(OUT),$(1)) +endef + +# Turn a particular warning on, or explicitly turn it off, depending on +# the value of W. The "-W" or "-Wno-" part of the warning need not be +# specified. +define cc-optional-warning +$(call cc-option,-W$(if $(W),,no-)$(patsubst -W%,%,$(patsubst -Wno-%,%,$(1)))) +endef + +define host-cc-optional-warning +$(call host-cc-option,-W$(if $(W),,no-)$(patsubst -W%,%,$(patsubst -Wno-%,%,$(1)))) +endef + +define kernel-cc-optional-warning +$(call kernel-cc-option,-W$(if $(W),,no-)$(patsubst -W%,%,$(patsubst -Wno-%,%,$(1)))) +endef + +define module-info-line +$(if $(filter modules,$(D)),$(info $(1)),) +endef diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kbuild/Makefile.template b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kbuild/Makefile.template new file mode 100644 index 0000000..9d88941 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kbuild/Makefile.template @@ -0,0 +1,92 @@ +########################################################################### ### +#@Title Root kernel makefile +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +# This top-level kbuild makefile builds all the Linux kernel modules in the +# DDK. To run kbuild, this makefile is copied to $(TARGET_OUT)/kbuild/Makefile +# and make is invoked in $(TARGET_OUT)/kbuild. + +# This makefile doesn't define any kbuild special variables apart from +# ccflags-y and obj-m. The variables for objects are picked up by including +# the kbuild makefile fragments named in $(INTERNAL_KBUILD_MAKEFILES). The +# list of objects that these fragments make is collected in +# $(INTERNAL_KBUILD_OBJECTS) and $(INTERNAL_EXTRA_KBUILD_OBJECTS). These +# variables are set according to the build's $(KERNEL_COMPONENTS) and +# $(EXTRA_PVRSRVKM_COMPONENTS). To add a new kernel module to the build, edit +# these variables in the per-build Makefile. + +include $(OUT)/config_kernel.mk + +.SECONDARY: + +$(OUT)/target/kbuild/external/%.c: $(EXTRA_KBUILD_SOURCE)/%.c + @if [ ! -e $(dir $@) ]; then mkdir -p $(dir $@); fi + @if [ ! -h $@ ]; then ln -sf $< $@; fi + +$(OUT)/target/kbuild/%.c: $(TOP)/%.c + @if [ ! -e $(dir $@) ]; then mkdir -p $(dir $@); fi + @if [ ! -h $@ ]; then ln -sf $< $@; fi + +ccflags-y += -D__linux__ -include $(OUT)/config_kernel.h \ + -DDEBUG_LOG_PATH_TRUNCATE="\"$(OUT)/target/kbuild\"" \ + -I$(OUT)/include \ + -I$(TOP)/include4 \ + -I$(TOP)/services4/include \ + -I$(TOP)/services4/system/$(PVR_SYSTEM) \ + -I$(TOP)/services4/system/include \ + -I$(TOP)/services4/srvkm/bridged \ + -I$(TOP)/services4/srvkm/bridged/sgx \ + -I$(TOP)/services4/srvkm/common \ + -I$(TOP)/services4/srvkm/devices/sgx \ + -I$(TOP)/services4/srvkm/env/linux \ + -I$(TOP)/services4/srvkm/include + +ifeq ($(PVR_LOCAL_HWDEFS),) +ccflags-y += -I$(TOP)/services4/srvkm/hwdefs +else +ccflags-y += -I$(TOP)/hwdefs +endif + +include $(INTERNAL_KBUILD_MAKEFILES) + +$(if $(pvrsrvkm_sgx$(SGXCORE)_$(SGX_CORE_REV)-y),,$(error pvrsrvkm_sgx$(SGXCORE)_$(SGX_CORE_REV)-y was empty, which could mean that srvkm is missing from $$(KERNEL_COMPONENTS))) +pvrsrvkm-y += $(foreach _m,$(INTERNAL_EXTRA_KBUILD_OBJECTS:.o=),$($(_m)-y)) + +obj-m += $(INTERNAL_KBUILD_OBJECTS) diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kbuild/external_tarball.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kbuild/external_tarball.mk new file mode 100644 index 0000000..d3aa147 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kbuild/external_tarball.mk @@ -0,0 +1,49 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +ifneq ($(EXTERNAL_3PDD_TARBALL),) +TAR_OPT_STRIP_COMPONENTS ?= --strip-components +prepare_tree: $(OUT)/target/kbuild/external +$(OUT)/target/kbuild/external: eurasiacon/external/$(EXTERNAL_3PDD_TARBALL) + @echo "Extracting $<.." + @mkdir -p $@ + @tar $(TAR_OPT_STRIP_COMPONENTS) 1 --touch -jxf $< -C $@ + @touch $(OUT)/target/kbuild/external +endif diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kbuild/kbuild.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kbuild/kbuild.mk new file mode 100644 index 0000000..94e2100 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kbuild/kbuild.mk @@ -0,0 +1,91 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +$(if $(strip $(KERNELDIR)),,$(error KERNELDIR must be set)) +$(call directory-must-exist,$(KERNELDIR)) + +$(TARGET_OUT)/kbuild/Makefile: $(MAKE_TOP)/kbuild/Makefile.template + @[ ! -e $(dir $@) ] && mkdir -p $(dir $@) || true + $(CP) -f $< $@ + +# We need to make INTERNAL_KBUILD_MAKEFILES absolute because the files will be +# read while chdir'd into $(KERNELDIR) +INTERNAL_KBUILD_MAKEFILES := $(abspath $(foreach _m,$(KERNEL_COMPONENTS) $(EXTRA_PVRSRVKM_COMPONENTS),$(if $(INTERNAL_KBUILD_MAKEFILE_FOR_$(_m)),$(INTERNAL_KBUILD_MAKEFILE_FOR_$(_m)),$(error Unknown kbuild module "$(_m)")))) +INTERNAL_KBUILD_OBJECTS := $(foreach _m,$(KERNEL_COMPONENTS),$(if $(INTERNAL_KBUILD_OBJECTS_FOR_$(_m)),$(INTERNAL_KBUILD_OBJECTS_FOR_$(_m)),$(error BUG: Unknown kbuild module "$(_m)" should have been caught earlier))) +INTERNAL_EXTRA_KBUILD_OBJECTS := $(foreach _m,$(EXTRA_PVRSRVKM_COMPONENTS),$(if $(INTERNAL_KBUILD_OBJECTS_FOR_$(_m)),$(INTERNAL_KBUILD_OBJECTS_FOR_$(_m)),$(error BUG: Unknown kbuild module "$(_m)" should have been caught earlier))) +.PHONY: kbuild kbuild_clean + +kbuild: $(TARGET_OUT)/kbuild/Makefile + @$(MAKE) -Rr --no-print-directory -C $(KERNELDIR) M=$(abspath $(TARGET_OUT)/kbuild) \ + INTERNAL_KBUILD_MAKEFILES="$(INTERNAL_KBUILD_MAKEFILES)" \ + INTERNAL_KBUILD_OBJECTS="$(INTERNAL_KBUILD_OBJECTS)" \ + INTERNAL_EXTRA_KBUILD_OBJECTS="$(INTERNAL_EXTRA_KBUILD_OBJECTS)" \ + EXTRA_KBUILD_SOURCE="$(EXTRA_KBUILD_SOURCE)" \ + CROSS_COMPILE="$(KERNEL_CROSS_COMPILE)" \ + EXTRA_CFLAGS="$(ALL_KBUILD_CFLAGS)" \ + V=$(V) W=$(W) \ + TOP=$(TOP) + @for kernel_module in $(addprefix $(TARGET_OUT)/kbuild/,$(INTERNAL_KBUILD_OBJECTS:.o=.ko)); do \ + cp $$kernel_module $(TARGET_OUT); \ + done + +kbuild_clean: $(TARGET_OUT)/kbuild/Makefile + @$(MAKE) -Rr --no-print-directory -C $(KERNELDIR) M=$(abspath $(TARGET_OUT)/kbuild) \ + INTERNAL_KBUILD_MAKEFILES="$(INTERNAL_KBUILD_MAKEFILES)" \ + INTERNAL_KBUILD_OBJECTS="$(INTERNAL_KBUILD_OBJECTS)" \ + INTERNAL_EXTRA_KBUILD_OBJECTS="$(INTERNAL_EXTRA_KBUILD_OBJECTS)" \ + EXTRA_KBUILD_SOURCE="$(EXTRA_KBUILD_SOURCE)" \ + CROSS_COMPILE="$(KERNEL_CROSS_COMPILE)" \ + EXTRA_CFLAGS="$(ALL_KBUILD_CFLAGS)" \ + V=$(V) W=$(W) \ + TOP=$(TOP) clean + +kbuild_install: $(TARGET_OUT)/kbuild/Makefile + @: $(if $(strip $(DISCIMAGE)),,$(error $$(DISCIMAGE) was empty or unset while trying to use it to set INSTALL_MOD_PATH for modules_install)) + @$(MAKE) -Rr --no-print-directory -C $(KERNELDIR) M=$(abspath $(TARGET_OUT)/kbuild) \ + INTERNAL_KBUILD_MAKEFILES="$(INTERNAL_KBUILD_MAKEFILES)" \ + INTERNAL_KBUILD_OBJECTS="$(INTERNAL_KBUILD_OBJECTS)" \ + INTERNAL_EXTRA_KBUILD_OBJECTS="$(INTERNAL_EXTRA_KBUILD_OBJECTS)" \ + EXTRA_KBUILD_SOURCE="$(EXTRA_KBUILD_SOURCE)" \ + CROSS_COMPILE="$(KERNEL_CROSS_COMPILE)" \ + EXTRA_CFLAGS="$(ALL_KBUILD_CFLAGS)" \ + INSTALL_MOD_PATH="$(DISCIMAGE)" \ + V=$(V) W=$(W) \ + TOP=$(TOP) modules_install diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kernel_module.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kernel_module.mk new file mode 100644 index 0000000..a0a1289 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kernel_module.mk @@ -0,0 +1,75 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +# Rules for making kernel modules with kbuild. This makefile doesn't define +# any rules that build the modules, it only copies the kbuild Makefile into +# the right place and then invokes kbuild to do the actual build + +$(call target-build-only,kernel module) + +MODULE_KBUILD_DIR := $(MODULE_OUT)/kbuild + +# $(THIS_MODULE)_makefile names the kbuild makefile fragment used to build +# this module's objects +$(call must-be-nonempty,$(THIS_MODULE)_makefile) +MODULE_KBUILD_MAKEFILE := $($(THIS_MODULE)_makefile) +$(if $(wildcard $(abspath $(MODULE_KBUILD_MAKEFILE))),,$(error In makefile $(THIS_MAKEFILE): Module $(THIS_MODULE) requires kbuild makefile $(MODULE_KBUILD_MAKEFILE), which is missing)) + +# $(THIS_MODULE)_target specifies the name of the kernel module +$(call must-be-nonempty,$(THIS_MODULE)_target) +MODULE_KBUILD_OBJECTS := $($(THIS_MODULE)_target:.ko=.o) + +# Here we could maybe include $(MODULE_KBUILD_MAKEFILE) and look at +# $(MODULE_KBUILD_OBJECTS)-y to see which source files might be built + +.PHONY: $(THIS_MODULE) +$(THIS_MODULE): MODULE_KBUILD_MAKEFILE := $(MODULE_KBUILD_MAKEFILE) +$(THIS_MODULE): MODULE_KBUILD_OBJECTS := $(MODULE_KBUILD_OBJECTS) +$(THIS_MODULE): + @echo "kbuild module '$@'" + @echo " MODULE_KBUILD_MAKEFILE := $(MODULE_KBUILD_MAKEFILE)" + @echo " MODULE_KBUILD_OBJECTS := $(MODULE_KBUILD_OBJECTS)" + @echo ' Being built:' $(if $(filter $@,$(KERNEL_COMPONENTS)),"yes (separate module)",$(if $(filter $@,$(EXTRA_PVRSRVKM_COMPONENTS)),"yes (into pvrsrvkm)","no")) + @echo "Module $@ is a kbuild module. Run 'make kbuild' to make it" + @false + +ALL_KBUILD_MODULES += $(THIS_MODULE) +INTERNAL_KBUILD_MAKEFILE_FOR_$(THIS_MODULE) := $(MODULE_KBUILD_MAKEFILE) +INTERNAL_KBUILD_OBJECTS_FOR_$(THIS_MODULE) := $(MODULE_KBUILD_OBJECTS) diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kernel_version.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kernel_version.mk new file mode 100644 index 0000000..35ecceb --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/kernel_version.mk @@ -0,0 +1,100 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +$(if $(KERNELDIR),,$(error KERNELDIR must be set to obtain a version)) + +override KERNEL_VERSION := \ + $(shell grep "^VERSION = " $(KERNELDIR)/Makefile | cut -f3 -d' ') +override KERNEL_PATCHLEVEL := \ + $(shell grep "^PATCHLEVEL = " $(KERNELDIR)/Makefile | cut -f3 -d' ') +override KERNEL_SUBLEVEL := \ + $(shell grep "^SUBLEVEL = " $(KERNELDIR)/Makefile | cut -f3 -d' ') +override KERNEL_EXTRAVERSION := \ + $(shell grep "^EXTRAVERSION = " $(KERNELDIR)/Makefile | cut -f3 -d' ') + +# Break the kernel version up into a space separated list +kernel_version_as_list := $(KERNEL_VERSION) \ + $(KERNEL_PATCHLEVEL) \ + $(KERNEL_SUBLEVEL) \ + $(patsubst .%,%,$(KERNEL_EXTRAVERSION)) + +# The base ID doesn't have to be accurate; we only use it for +# feature checks which will not care about extraversion bits +# +override KERNEL_BASE_ID := \ + $(KERNEL_VERSION).$(KERNEL_PATCHLEVEL).$(KERNEL_SUBLEVEL) + +# Try to get the kernel ID from the kernel.release file. +# +KERNEL_ID ?= \ + $(shell cat $(KERNELDIR)/include/config/kernel.release 2>/dev/null) + +# If the kernel ID isn't set yet, try to set it from the UTS_RELEASE +# macro. +# +ifeq ($(strip $(KERNEL_ID)),) +KERNEL_ID := \ + $(shell grep -h '\#define UTS_RELEASE' \ + $(KERNELDIR)/include/linux/* | cut -f3 -d' ' | sed s/\"//g) +endif + +ifeq ($(strip $(KERNEL_ID)),) +KERNEL_ID := \ + $(KERNEL_VERSION).$(KERNEL_PATCHLEVEL).$(KERNEL_SUBLEVEL)$(KERNEL_EXTRAVERSION) +endif + +# Return 1 if the kernel version is at least the value passed to the +# function, else return nothing. +# Examples +# $(call kernel-version-at-least,2,6,35) +# $(call kernel-version-at-least,2,6,35,7) +# +define kernel-version-at-least +$(shell set -- $(kernel_version_as_list) 0 0 0 0; \ + Y=true; \ + for D in $1 $2 $3 $4; \ + do \ + [ $$1 ] || break; \ + [ $$1 -eq $$D ] && { shift; continue; };\ + [ $$1 -lt $$D ] && Y=; \ + break; \ + done; \ + echo $$Y) +endef diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/moduledefs.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/moduledefs.mk new file mode 100644 index 0000000..869026f --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/moduledefs.mk @@ -0,0 +1,96 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +MODULE_TARGETS := +MODULE_CFLAGS := $(ALL_CFLAGS) $($(THIS_MODULE)_cflags) +MODULE_CXXFLAGS := $(ALL_CXXFLAGS) $($(THIS_MODULE)_cxxflags) +MODULE_HOST_CFLAGS := $(ALL_HOST_CFLAGS) $($(THIS_MODULE)_cflags) +MODULE_HOST_CXXFLAGS := $(ALL_HOST_CXXFLAGS) $($(THIS_MODULE)_cxxflags) +MODULE_LDFLAGS := $(ALL_LDFLAGS) $($(THIS_MODULE)_ldflags) +MODULE_HOST_LDFLAGS := $(ALL_HOST_LDFLAGS) $($(THIS_MODULE)_ldflags) +MODULE_BISON_FLAGS := $(ALL_BISON_FLAGS) $($(THIS_MODULE)_bisonflags) +MODULE_FLEX_FLAGS := $(ALL_FLEX_FLAGS) $($(THIS_MODULE)_flexflags) + +# -L flags for library search dirs +MODULE_LIBRARY_DIR_FLAGS := $(foreach _path,$($(THIS_MODULE)_libpaths),$(if $(filter /%,$(_path)),-L$(call relative-to-top,$(_path)),-L$(_path))) +# -I flags for header search dirs +MODULE_INCLUDE_FLAGS := $(foreach _path,$($(THIS_MODULE)_includes),$(if $(filter /%,$(_path)),-I$(call relative-to-top,$(_path)),-I$(_path))) + +# Variables used to differentiate between host/target builds +MODULE_OUT := $(if $(MODULE_HOST_BUILD),$(HOST_OUT),$(TARGET_OUT)) +MODULE_INTERMEDIATES_DIR := $(if $(MODULE_HOST_BUILD),$(HOST_INTERMEDIATES)/$(THIS_MODULE),$(TARGET_INTERMEDIATES)/$(THIS_MODULE)) + +.SECONDARY: $(MODULE_INTERMEDIATES_DIR) +$(MODULE_INTERMEDIATES_DIR): + $(make-directory) + +Host_or_target := $(if $(MODULE_HOST_BUILD),Host,Target) + +# These define the rules for finding source files. +# - If a name begins with a slash, we strip $(TOP) off the front if it begins +# with $(TOP). This is so that we don't get really long error messages from +# the compiler if the source tree is in a deeply nested directory, but we +# still do get absolute paths if you say "make OUT=/tmp/somewhere" +# - Otherwise, if a name contains a slash and begins with $(OUT), we leave it +# as it is. This is so you can say "module_src := +# $(TARGET_INTERMEDIATES)/something/generated.c" +# - Otherwise, we assume it's a path referring to somewhere under the +# directory containing Linux.mk, and add $(THIS_DIR) to it +_SOURCES_WITHOUT_SLASH := $(strip $(foreach _s,$($(THIS_MODULE)_src),$(if $(findstring /,$(_s)),,$(_s)))) +_SOURCES_WITH_SLASH := $(strip $(foreach _s,$($(THIS_MODULE)_src),$(if $(findstring /,$(_s)),$(_s),))) +MODULE_SOURCES := $(addprefix $(THIS_DIR)/,$(_SOURCES_WITHOUT_SLASH)) +MODULE_SOURCES += $(call relative-to-top,$(filter /%,$(_SOURCES_WITH_SLASH))) +_RELATIVE_SOURCES_WITH_SLASH := $(filter-out /%,$(_SOURCES_WITH_SLASH)) +_OUTDIR_RELATIVE_SOURCES_WITH_SLASH := $(filter $(RELATIVE_OUT)/%,$(_RELATIVE_SOURCES_WITH_SLASH)) +_THISDIR_RELATIVE_SOURCES_WITH_SLASH := $(filter-out $(RELATIVE_OUT)/%,$(_RELATIVE_SOURCES_WITH_SLASH)) +MODULE_SOURCES += $(_OUTDIR_RELATIVE_SOURCES_WITH_SLASH) +MODULE_SOURCES += $(addprefix $(THIS_DIR)/,$(_THISDIR_RELATIVE_SOURCES_WITH_SLASH)) +MODULE_SOURCES += $(addprefix $(MODULE_OUT)/intermediates/,$($(THIS_MODULE)_gensrc)) +MODULE_GENERATED_HEADERS := $(addprefix $(MODULE_OUT)/intermediates/,$($(THIS_MODULE)_genheaders)) + +# -l flags for each library +MODULE_LIBRARY_FLAGS := $(addprefix -l, $($(THIS_MODULE)_staticlibs)) $(addprefix -l,$($(THIS_MODULE)_libs)) $(foreach _lib,$($(THIS_MODULE)_extlibs),$(if $(filter undefined,$(origin lib$(_lib)_ldflags)),-l$(_lib),$(lib$(_lib)_ldflags))) + +# pkg-config integration; primarily used by X.org +# FIXME: We don't support arbitrary CFLAGS yet (just includes) +$(foreach _package,$($(THIS_MODULE)_packages),\ + $(eval MODULE_INCLUDE_FLAGS += `pkg-config --cflags-only-I $(_package)`)\ + $(eval MODULE_LIBRARY_FLAGS += `pkg-config --libs-only-l $(_package)`)\ + $(eval MODULE_LIBRARY_DIR_FLAGS += `pkg-config --libs-only-L $(_package)`)) diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/modules.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/modules.mk new file mode 100644 index 0000000..1576590 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/modules.mk @@ -0,0 +1,49 @@ +########################################################################### ### +#@Title Module processing +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +# Bits for processing $(modules) after reading in each Linux.mk + +#$(info ---- $(modules) ----) +$(call must-be-nonempty,modules) + +$(foreach _m,$(modules),$(if $(filter $(_m),$(ALL_MODULES)),$(error In makefile $(THIS_MAKEFILE): Duplicate module $(_m) (first seen in $(INTERNAL_MAKEFILE_FOR_MODULE_$(_m))) listed in $$(modules)),$(eval $(call register-module,$(_m))))) + +ALL_MODULES += $(modules) diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap4430_android/Makefile b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap4430_android/Makefile new file mode 100644 index 0000000..cf143fe --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap4430_android/Makefile @@ -0,0 +1,193 @@ +########################################################################### ### +#@Title Root makefile for omap4430 Android. Builds everything else. +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +ifeq ($(TARGET_SGX),544sc) + SGXCORE := 544 + SGX_CORE_REV := 112 +else ifeq ($(TARGET_SGX),540) + SGXCORE := 540 + SGX_CORE_REV := 120 +else ifeq ($(TARGET_SGX),544) + SGXCORE := 544 + SGX_CORE_REV := 105 + HAL_VARIANT := omap5 + SGX_FEATURE_MP := 1 + SGX_FEATURE_SYSTEM_CACHE := 1 + SGX_FEATURE_MP_CORE_COUNT := 2 +else ifeq ($(TARGET_SGX),544es2) + SGXCORE := 544 + SGX_CORE_REV := 116 + HAL_VARIANT := omap5 + SGX_FEATURE_MP := 1 + SGX_FEATURE_SYSTEM_CACHE := 1 + SGX_FEATURE_MP_CORE_COUNT := 2 +else + #default config + SGXCORE := 540 + SGX_CORE_REV := 120 +endif +export SGXCORE +export SGX_CORE_REV + +SGX_DYNAMIC_TIMING_INFO := 1 +SUPPORT_ACTIVE_POWER_MANAGEMENT := 0 + +SUPPORT_LINUX_USING_WORKQUEUES := 1 + +DISPLAY_CONTROLLER := omaplfb + +PVR_SYSTEM := omap4 +HAL_VARIANT := $(PVR_SYSTEM) + +# We have more memory on OMAP platforms, so we can spare to make the +# pool larger, and have higher resolutions which benefit from it. +# +PVR_LINUX_MEM_AREA_POOL_MAX_PAGES ?= 10800 + +include ../common/android/paths.mk +include ../common/android/armv7-a.mk +include ../common/android/features.mk + +ifneq ($(strip $(KERNELDIR)),) + include ../kernel_version.mk + ifeq ($(call kernel-version-at-least,2,6,35),true) + PVR_NO_OMAP_TIMER := 1 + endif + ifeq ($(call kernel-version-at-least,2,6,39),true) + ifeq ($(LDM_PLATFORM),1) + PVR_LDM_PLATFORM_PRE_REGISTERED := 1 + PVR_LDM_PLATFORM_PRE_REGISTERED_DEV := "\"pvrsrvkm\"" + endif + endif + ifeq ($(is_at_least_icecream_sandwich),1) + ifeq ($(call kernel-version-at-least,3,0),true) + SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED := 1 + PVR_ANDROID_NEEDS_ACCUM_SYNC_WORKAROUND := 1 + SYS_OMAP4_HAS_DVFS_FRAMEWORK := 0 + endif + endif +else + ifeq ($(is_at_least_icecream_sandwich),1) + $(warning "KERNELDIR is not set, so can't feature check DVFS or dsscomp.") + $(warning "Assuming we want DVFS and dsscomp support.") + SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED := 1 + PVR_ANDROID_NEEDS_ACCUM_SYNC_WORKAROUND := 1 + SYS_OMAP4_HAS_DVFS_FRAMEWORK := 0 + endif +endif + +ifneq ($(LDM_PLATFORM),1) +SUPPORT_LINUX_USING_WORKQUEUES := 0 +SUPPORT_LINUX_USING_SHARED_WORKQUEUES := 1 +SUPPORT_ACTIVE_POWER_MANAGEMENT := 0 +DISPLAY_CONTROLLER := pvrlfb +DISPLAY_CONTROLLER_COMPONENT := linux_framebuffer +OMAP_NON_FLIP_DISPLAY := 1 + +# The code for the omaplfb component is now hosted on a +# different repository. No need to compile this now +# +# DISPLAY_CONTROLLER_COMPONENT := dc_omapfb3_linux + +endif + +ifeq ($(SUPPORT_DRI_DRM),1) +ifeq ($(PVR_LDM_PLATFORM_PRE_REGISTERED),1) +PVR_DRI_DRM_PLATFORM_DEV := 1 +PVR_DRI_DRM_STATIC_BUS_ID := 1 +PVR_DRI_DRM_DEV_BUS_ID := "\"platform:pvrsrvkm"\" +else +PVR_DRI_DRM_NOT_PCI := 1 +KERNEL_COMPONENTS += linux_drm +endif +EXTRA_PVRSRVKM_COMPONENTS += $(DISPLAY_CONTROLLER_COMPONENT) +EXTRA_KBUILD_SOURCE := $(KERNELDIR) +# FIXME: Only required for comparison with X's KM +PVR_SECURE_DRM_AUTH_EXPORT := 1 +ifneq ($(OMAP_NON_FLIP_DISPLAY),1) +PVR_DISPLAY_CONTROLLER_DRM_IOCTL := 1 +endif +else +KERNEL_COMPONENTS += $(DISPLAY_CONTROLLER_COMPONENT) +endif + +SUPPORT_ANDROID_OMAP_NV12 := 1 + +ifeq ($(is_at_least_icecream_sandwich),1) +ifeq ($(SUPPORT_ANDROID_COMPOSER_HAL),1) +PVR_ANDROID_USE_WINDOW_TRANSFORM_HINT := 1 +endif +endif + +PVR_ANDROID_PLATFORM_HAS_LINUX_FBDEV := 1 + +# FIXME: Remove this once vsync issues are resolved +PVR_ANDROID_COMPOSITOR_WAIT_FOR_RENDER := 1 + +ifeq ($(is_at_least_icecream_sandwich),1) +-include products.mk +endif + +ifeq ($(NO_HARDWARE),1) +ifeq ($(SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED),1) +$(info WARNING: SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED=1 is incompatible with NO_HARDWARE=1) +$(info WARNING: Setting SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED=0 and switching to dc_nohw) +override SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED := 0 +override DISPLAY_CONTROLLER := dcnohw +KERNEL_COMPONENTS += dc_nohw +endif +endif + +include ../config/core.mk +include ../common/android/extra_config.mk +include ../common/dridrm.mk +include ../common/opencl.mk +include ../common/omap4.mk + +# Not all OMAP4 kernels have a compatible DVFS framework +# +$(eval $(call TunableKernelConfigC,SYS_OMAP4_HAS_DVFS_FRAMEWORK,)) + +# If set, services allows two flips to enter the processing queue, +# and does not add read dependencies to the set of buffers last +# flipped to. This is necessary for DSS composition on OMAP4. +# +$(eval $(call TunableKernelConfigC,SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED,)) diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap4430_android/products.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap4430_android/products.mk new file mode 100644 index 0000000..53073a9 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/omap4430_android/products.mk @@ -0,0 +1,46 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +PVRSRV_USSE_EDM_STATUS_DEBUG ?= 1 +SGX_DISABLE_VISTEST_SUPPORT ?= 1 +PVRSRV_DUMP_MK_TRACE ?= 1 +PVRSRV_NEED_PVR_DPF ?= 1 +PVRSRV_NEED_PVR_TRACE ?= 1 +PVRSRV_NEED_PVR_ASSERT ?= 1 diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/prepare_tree.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/prepare_tree.mk new file mode 100644 index 0000000..05e4fe3 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/prepare_tree.mk @@ -0,0 +1,60 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +.PHONY: prepare_tree + +-include eurasiacon/build/linux2/kbuild/external_tarball.mk + +# If there's no external tarball, there's nothing to do +# +prepare_tree: + +INTERNAL_INCLUDED_PREPARE_HEADERS := +-include eurasiacon/build/linux2/prepare_headers.mk +ifneq ($(INTERNAL_INCLUDED_PREPARE_HEADERS),true) +missing_headers := $(strip $(shell test ! -e include4/pvrversion.h && echo true)) +ifdef missing_headers +$(info ) +$(info ** include4/pvrversion.h is missing, and cannot be rebuilt.) +$(info ** Cannot continue.) +$(info ) +$(error Missing headers) +endif +endif diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/this_makefile.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/this_makefile.mk new file mode 100644 index 0000000..c312001 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/this_makefile.mk @@ -0,0 +1,68 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +# Find out the path of the Linux.mk makefile currently being processed, and +# set paths used by the build rules + +# This magic is used so we can use this_makefile.mk twice: first when reading +# in each Linux.mk, and then again when generating rules. There we set +# $(THIS_MAKEFILE), and $(REMAINING_MAKEFILES) should be empty +ifneq ($(strip $(REMAINING_MAKEFILES)),) + +# Absolute path to the Linux.mk being processed +THIS_MAKEFILE := $(firstword $(REMAINING_MAKEFILES)) + +# The list of makefiles left to process +REMAINING_MAKEFILES := $(wordlist 2,$(words $(REMAINING_MAKEFILES)),$(REMAINING_MAKEFILES)) + +else + +# When generating rules, we should have read in every Linux.mk +$(if $(INTERNAL_INCLUDED_ALL_MAKEFILES),,$(error No makefiles left in $$(REMAINING_MAKEFILES), but $$(INTERNAL_INCLUDED_ALL_MAKEFILES) is not set)) + +endif + +# Path to the directory containing Linux.mk +THIS_DIR := $(patsubst %/,%,$(dir $(THIS_MAKEFILE))) +ifeq ($(strip $(THIS_DIR)),) +$(error Empty $$(THIS_DIR) for makefile "$(THIS_MAKEFILE)") +endif + +modules := diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/tools/cc-check.sh b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/tools/cc-check.sh new file mode 100755 index 0000000..6cef8fa --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/tools/cc-check.sh @@ -0,0 +1,99 @@ +#!/bin/sh +########################################################################### ### +#@Title Test the nature of the C compiler. +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +LANG=C +export LANG + +usage() { + echo "usage: $0 [--64] --cc CC --out OUT [cflag]" + exit 1 +} + +# NOTE: The program passed to the compiler is deliberately incorrect +# (`return;' should be `return 0;') but we do this to emit a warning. +# +# Emitting a warning is necessary to get GCC to print out additional +# warnings about any unsupported -Wno options, so we can handle these +# as unsupported by the build. +# +do_cc() { + echo "int main(void){return;}" | $CC -W -Wall $3 -xc -c - -o $1 >$2 2>&1 +} + +while [ 1 ]; do + if [ "$1" = "--64" ]; then + BIT_CHECK=1 + elif [ "$1" = "--cc" ]; then + [ "x$2" = "x" ] && usage + CC="$2" && shift + elif [ "$1" = "--out" ]; then + [ "x$2" = "x" ] && usage + OUT="$2" && shift + elif [ "${1#--}" != "$1" ]; then + usage + else + break + fi + shift +done + +[ "x$CC" = "x" ] && usage +[ "x$OUT" = "x" ] && usage +ccof=$OUT/cc-sanity-check +log=${ccof}.log + +if [ "x$BIT_CHECK" = "x1" ]; then + do_cc $ccof $log "" + file $ccof | grep 64-bit >/dev/null 2>&1 + [ "$?" = "0" ] && echo true || echo false +else + [ "x$1" = "x" ] && usage + do_cc $ccof $log $1 + if [ "$?" = "0" ]; then + # compile passed, but was the warning unrecognized? + grep -q "^cc1: warning: unrecognized command line option \"$1\"" $log + [ "$?" = "1" ] && echo $1 + fi +fi + +rm -f $ccof $log +exit 0 diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/toplevel.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/toplevel.mk new file mode 100644 index 0000000..26b1198 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/toplevel.mk @@ -0,0 +1,226 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +# Define the default goal. This masks a previous definition of the default +# goal in Makefile.config, which must match this one +.PHONY: build +build: components kbuild + +ifeq ($(OUT),) +$(error "Must specify output directory with OUT=") +endif + +ifeq ($(TOP),) +$(error "Must specify root of source tree with TOP=") +endif +$(call directory-must-exist,$(TOP)) + +# Output directory for configuration, object code, +# final programs/libraries, and install/rc scripts. +# + +# RELATIVE_OUT is relative only if it's under $(TOP) +RELATIVE_OUT := $(patsubst $(TOP)/%,%,$(OUT)) +HOST_OUT := $(RELATIVE_OUT)/host +TARGET_OUT := $(RELATIVE_OUT)/target +CONFIG_MK := $(RELATIVE_OUT)/config.mk +CONFIG_H := $(RELATIVE_OUT)/config.h +CONFIG_KERNEL_MK := $(RELATIVE_OUT)/config_kernel.mk +CONFIG_KERNEL_H := $(RELATIVE_OUT)/config_kernel.h +MAKE_TOP := eurasiacon/build/linux2 +THIS_MAKEFILE := (top-level makefiles) + +# Convert commas to spaces in $(D). This is so you can say "make +# D=config-changes,freeze-config" and have $(filter config-changes,$(D)) +# still work. +comma := , +empty := +space := $(empty) $(empty) +override D := $(subst $(comma),$(space),$(D)) + +include $(MAKE_TOP)/defs.mk + +ifneq ($(INTERNAL_CLOBBER_ONLY),true) +# Create the out directory +# +$(shell mkdir -p $(OUT)) + +# Provide rules to create $(HOST_OUT) and $(TARGET_OUT) +.SECONDARY: $(HOST_OUT) $(TARGET_OUT) +$(HOST_OUT) $(TARGET_OUT): + $(make-directory) + +# If these generated files differ from any pre-existing ones, +# replace them, causing affected parts of the driver to rebuild. +# +_want_config_diff := $(filter config-changes,$(D)) +_freeze_config := $(strip $(filter freeze-config,$(D))) +_updated_config_files := $(shell \ + $(if $(_want_config_diff),rm -f $(OUT)/config.diff;,) \ + for file in $(CONFIG_MK) $(CONFIG_H) \ + $(CONFIG_KERNEL_MK) $(CONFIG_KERNEL_H); do \ + diff -U 0 $$file $$file.new \ + >>$(if $(_want_config_diff),$(OUT)/config.diff,/dev/null) 2>/dev/null \ + && rm -f $$file.new \ + || echo $$file; \ + done) + +ifneq ($(_want_config_diff),) +# We send the diff to stderr so it isn't captured by $(shell) +$(shell [ -s $(OUT)/config.diff ] && echo >&2 "Configuration changed in $(RELATIVE_OUT):" && cat >&2 $(OUT)/config.diff) +endif + +ifneq ($(_freeze_config),) +$(if $(_updated_config_files),$(error Configuration change in $(RELATIVE_OUT) prevented by D=freeze-config),) +endif + +# Update the config, if changed +$(foreach _f,$(_updated_config_files), \ + $(shell mv -f $(_f).new $(_f) >/dev/null 2>/dev/null)) + +endif # INTERNAL_CLOBBER_ONLY + +MAKEFLAGS := -Rr --no-print-directory + +ifneq ($(INTERNAL_CLOBBER_ONLY),true) + +# This is so you can say "find $(TOP) -name Linux.mk > /tmp/something; export +# ALL_MAKEFILES=/tmp/something; make" and avoid having to run find. This is +# handy if your source tree is mounted over NFS or something +override ALL_MAKEFILES := $(call relative-to-top,$(if $(strip $(ALL_MAKEFILES)),$(shell cat $(ALL_MAKEFILES)),$(shell find $(TOP) -type f -name Linux.mk -print -o -type d -name '.*' -prune))) +ifeq ($(strip $(ALL_MAKEFILES)),) +$(info ** Unable to find any Linux.mk files under $$(TOP). This could mean that) +$(info ** there are no makefiles, or that ALL_MAKEFILES is set in the environment) +$(info ** and points to a nonexistent or empty file.) +$(error No makefiles) +endif + +else # clobber-only +ALL_MAKEFILES := +endif + +unexport ALL_MAKEFILES + +REMAINING_MAKEFILES := $(ALL_MAKEFILES) +ALL_MODULES := +INTERNAL_INCLUDED_ALL_MAKEFILES := + +ifneq ($(INTERNAL_CLOBBER_ONLY),true) +# Please do not change the format of the following lines +-include $(CONFIG_KERNEL_MK) +# These files may not exist in GPL km source packages +-include $(MAKE_TOP)/xorgconf.mk +-include $(MAKE_TOP)/llvm.mk +endif + +include $(MAKE_TOP)/commands.mk +include $(MAKE_TOP)/buildvars.mk + +HOST_INTERMEDIATES := $(HOST_OUT)/intermediates +TARGET_INTERMEDIATES := $(TARGET_OUT)/intermediates + +# Include each Linux.mk, then include modules.mk to save some information +# about each module +include $(foreach _Linux.mk,$(ALL_MAKEFILES),$(MAKE_TOP)/this_makefile.mk $(_Linux.mk) $(MAKE_TOP)/modules.mk) + +ifeq ($(strip $(REMAINING_MAKEFILES)),) +INTERNAL_INCLUDED_ALL_MAKEFILES := true +else +$(error Impossible: $(words $(REMAINING_MAKEFILES)) makefiles were mysteriously ignored when reading $$(ALL_MAKEFILES)) +endif + +# At this point, all Linux.mks have been included. Now generate rules to build +# each module: for each module in $(ALL_MODULES), set per-makefile variables +$(foreach _m,$(ALL_MODULES),$(eval $(call process-module,$(_m)))) + +.PHONY: kbuild install +kbuild install: + +ifneq ($(INTERNAL_CLOBBER_ONLY),true) +-include $(MAKE_TOP)/scripts.mk +-include $(MAKE_TOP)/kbuild/kbuild.mk +else +# We won't depend on 'build' here so that people can build subsets of +# components and still have the install script attempt to install the +# subset. +install: + @if [ ! -d "$(DISCIMAGE)" ]; then \ + echo; \ + echo "** DISCIMAGE was not set or does not point to a valid directory."; \ + echo "** Cannot continue with install."; \ + echo; \ + exit 1; \ + fi + @if [ ! -f $(TARGET_OUT)/install.sh ]; then \ + echo; \ + echo "** install.sh not found in $(TARGET_OUT)."; \ + echo "** Cannot continue with install."; \ + echo; \ + exit 1; \ + fi + @cd $(TARGET_OUT) && ./install.sh +endif + +# You can say 'make all_modules' to attempt to make everything, or 'make +# components' to only make the things which are listed (in the per-build +# makefiles) as components of the build. +.PHONY: all_modules components +all_modules: $(ALL_MODULES) +components: $(COMPONENTS) + +# Cleaning +.PHONY: clean clobber +clean: MODULE_DIRS_TO_REMOVE := $(OUT)/host/intermediates $(OUT)/target/intermediates $(OUT)/target/kbuild +clean: + $(clean-dirs) +clobber: MODULE_DIRS_TO_REMOVE := $(OUT) +clobber: + $(clean-dirs) + +# Saying 'make clean-MODULE' removes the intermediates for MODULE. +# clobber-MODULE deletes the output files as well +clean-%: + $(if $(V),,@echo " RM " $(call relative-to-top,$(OUT)/host/intermediates/$* $(OUT)/target/intermediates/$*)) + $(RM) -rf $(OUT)/host/intermediates/$*/* $(OUT)/target/intermediates/$*/* +clobber-%: + $(if $(V),,@echo " RM " $(call relative-to-top,$(OUT)/host/intermediates/$* $(OUT)/target/intermediates/$* $(INTERNAL_TARGETS_FOR_$*))) + $(RM) -rf $(OUT)/host/intermediates/$* $(OUT)/target/intermediates/$* $(INTERNAL_TARGETS_FOR_$*) + +include $(MAKE_TOP)/bits.mk diff --git a/jacinto6/sgx_src/eurasia_km/include4/dbgdrvif.h b/jacinto6/sgx_src/eurasia_km/include4/dbgdrvif.h new file mode 100644 index 0000000..753f8f2 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/include4/dbgdrvif.h @@ -0,0 +1,381 @@ +/*************************************************************************/ /*! +@Title Debug driver +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Debug Driver Interface +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _DBGDRVIF_ +#define _DBGDRVIF_ + + +#if defined(__linux__) + +#define FILE_DEVICE_UNKNOWN 0 +#define METHOD_BUFFERED 0 +#define FILE_ANY_ACCESS 0 + +#define CTL_CODE( DeviceType, Function, Method, Access ) (Function) +#define MAKEIOCTLINDEX(i) ((i) & 0xFFF) + +#else + +#include "ioctldef.h" + +#endif + +/***************************************************************************** + Stream mode stuff. +*****************************************************************************/ +#define DEBUG_CAPMODE_FRAMED 0x00000001UL +#define DEBUG_CAPMODE_CONTINUOUS 0x00000002UL +#define DEBUG_CAPMODE_HOTKEY 0x00000004UL + +#define DEBUG_OUTMODE_STANDARDDBG 0x00000001UL +#define DEBUG_OUTMODE_MONO 0x00000002UL +#define DEBUG_OUTMODE_STREAMENABLE 0x00000004UL +#define DEBUG_OUTMODE_ASYNC 0x00000008UL +#define DEBUG_OUTMODE_SGXVGA 0x00000010UL + +#define DEBUG_FLAGS_USE_NONPAGED_MEM 0x00000001UL +#define DEBUG_FLAGS_NO_BUF_EXPANDSION 0x00000002UL +#define DEBUG_FLAGS_ENABLESAMPLE 0x00000004UL +#define DEBUG_FLAGS_READONLY 0x00000008UL +#define DEBUG_FLAGS_WRITEONLY 0x00000010UL + +#define DEBUG_FLAGS_TEXTSTREAM 0x80000000UL + +/***************************************************************************** + Debug level control. Only bothered with the first 12 levels, I suspect you + get the idea... +*****************************************************************************/ +#define DEBUG_LEVEL_0 0x00000001UL +#define DEBUG_LEVEL_1 0x00000003UL +#define DEBUG_LEVEL_2 0x00000007UL +#define DEBUG_LEVEL_3 0x0000000FUL +#define DEBUG_LEVEL_4 0x0000001FUL +#define DEBUG_LEVEL_5 0x0000003FUL +#define DEBUG_LEVEL_6 0x0000007FUL +#define DEBUG_LEVEL_7 0x000000FFUL +#define DEBUG_LEVEL_8 0x000001FFUL +#define DEBUG_LEVEL_9 0x000003FFUL +#define DEBUG_LEVEL_10 0x000007FFUL +#define DEBUG_LEVEL_11 0x00000FFFUL + +#define DEBUG_LEVEL_SEL0 0x00000001UL +#define DEBUG_LEVEL_SEL1 0x00000002UL +#define DEBUG_LEVEL_SEL2 0x00000004UL +#define DEBUG_LEVEL_SEL3 0x00000008UL +#define DEBUG_LEVEL_SEL4 0x00000010UL +#define DEBUG_LEVEL_SEL5 0x00000020UL +#define DEBUG_LEVEL_SEL6 0x00000040UL +#define DEBUG_LEVEL_SEL7 0x00000080UL +#define DEBUG_LEVEL_SEL8 0x00000100UL +#define DEBUG_LEVEL_SEL9 0x00000200UL +#define DEBUG_LEVEL_SEL10 0x00000400UL +#define DEBUG_LEVEL_SEL11 0x00000800UL + +/***************************************************************************** + IOCTL values. +*****************************************************************************/ +#define DEBUG_SERVICE_IOCTL_BASE 0x800UL +#define DEBUG_SERVICE_CREATESTREAM CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x01, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_DESTROYSTREAM CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x02, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_GETSTREAM CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x03, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_WRITESTRING CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x04, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_READSTRING CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x05, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_WRITE CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x06, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_READ CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x07, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_SETDEBUGMODE CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x08, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_SETDEBUGOUTMODE CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x09, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_SETDEBUGLEVEL CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x0A, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_SETFRAME CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x0B, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_GETFRAME CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x0C, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_OVERRIDEMODE CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x0D, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_DEFAULTMODE CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x0E, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_GETSERVICETABLE CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x0F, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_WRITE2 CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x10, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_WRITESTRINGCM CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x11, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_WRITECM CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x12, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_SETMARKER CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x13, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_GETMARKER CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x14, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_ISCAPTUREFRAME CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x15, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_WRITELF CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x16, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_READLF CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x17, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_WAITFOREVENT CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x18, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_SETCONNNOTIFY CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x19, METHOD_BUFFERED, FILE_ANY_ACCESS) + + +typedef enum _DBG_EVENT_ +{ + DBG_EVENT_STREAM_DATA = 1 +} DBG_EVENT; + + +/***************************************************************************** + In/Out Structures +*****************************************************************************/ +typedef struct _DBG_IN_CREATESTREAM_ +{ + union + { + IMG_CHAR *pszName; + IMG_UINT64 ui64Name; + } u; + IMG_UINT32 ui32Pages; + IMG_UINT32 ui32CapMode; + IMG_UINT32 ui32OutMode; +}DBG_IN_CREATESTREAM, *PDBG_IN_CREATESTREAM; + +typedef struct _DBG_IN_FINDSTREAM_ +{ + union + { + IMG_CHAR *pszName; + IMG_UINT64 ui64Name; + }u; + IMG_BOOL bResetStream; +}DBG_IN_FINDSTREAM, *PDBG_IN_FINDSTREAM; + +typedef struct _DBG_IN_WRITESTRING_ +{ + union + { + IMG_CHAR *pszString; + IMG_UINT64 ui64String; + } u; + IMG_SID hStream; + IMG_UINT32 ui32Level; +}DBG_IN_WRITESTRING, *PDBG_IN_WRITESTRING; + +typedef struct _DBG_IN_READSTRING_ +{ + union + { + IMG_CHAR *pszString; + IMG_UINT64 ui64String; + } u; + IMG_SID hStream; + IMG_UINT32 ui32StringLen; +} DBG_IN_READSTRING, *PDBG_IN_READSTRING; + +typedef struct _DBG_IN_SETDEBUGMODE_ +{ + IMG_SID hStream; + IMG_UINT32 ui32Mode; + IMG_UINT32 ui32Start; + IMG_UINT32 ui32End; + IMG_UINT32 ui32SampleRate; +} DBG_IN_SETDEBUGMODE, *PDBG_IN_SETDEBUGMODE; + +typedef struct _DBG_IN_SETDEBUGOUTMODE_ +{ + IMG_SID hStream; + IMG_UINT32 ui32Mode; +} DBG_IN_SETDEBUGOUTMODE, *PDBG_IN_SETDEBUGOUTMODE; + +typedef struct _DBG_IN_SETDEBUGLEVEL_ +{ + IMG_SID hStream; + IMG_UINT32 ui32Level; +} DBG_IN_SETDEBUGLEVEL, *PDBG_IN_SETDEBUGLEVEL; + +typedef struct _DBG_IN_SETFRAME_ +{ + IMG_SID hStream; + IMG_UINT32 ui32Frame; +} DBG_IN_SETFRAME, *PDBG_IN_SETFRAME; + +typedef struct _DBG_IN_WRITE_ +{ + union + { + IMG_UINT8 *pui8InBuffer; + IMG_UINT64 ui64InBuffer; + } u; + IMG_SID hStream; + IMG_UINT32 ui32Level; + IMG_UINT32 ui32TransferSize; +} DBG_IN_WRITE, *PDBG_IN_WRITE; + +typedef struct _DBG_IN_READ_ +{ + union + { + IMG_UINT8 *pui8OutBuffer; + IMG_UINT64 ui64OutBuffer; + } u; + IMG_SID hStream; + IMG_BOOL bReadInitBuffer; + IMG_UINT32 ui32OutBufferSize; +} DBG_IN_READ, *PDBG_IN_READ; + +typedef struct _DBG_IN_OVERRIDEMODE_ +{ + IMG_SID hStream; + IMG_UINT32 ui32Mode; +} DBG_IN_OVERRIDEMODE, *PDBG_IN_OVERRIDEMODE; + +typedef struct _DBG_IN_ISCAPTUREFRAME_ +{ + IMG_SID hStream; + IMG_BOOL bCheckPreviousFrame; +} DBG_IN_ISCAPTUREFRAME, *PDBG_IN_ISCAPTUREFRAME; + +typedef struct _DBG_IN_SETMARKER_ +{ + IMG_SID hStream; + IMG_UINT32 ui32Marker; +} DBG_IN_SETMARKER, *PDBG_IN_SETMARKER; + +typedef struct _DBG_IN_WRITE_LF_ +{ + union + { + IMG_UINT8 *pui8InBuffer; + IMG_UINT64 ui64InBuffer; + } u; + IMG_UINT32 ui32Flags; + IMG_SID hStream; + IMG_UINT32 ui32Level; + IMG_UINT32 ui32BufferSize; +} DBG_IN_WRITE_LF, *PDBG_IN_WRITE_LF; + +/* + Flags for above struct +*/ +#define WRITELF_FLAGS_RESETBUF 0x00000001UL + +/* + Common control structure (don't duplicate control in main stream + and init phase stream). +*/ +typedef struct _DBG_STREAM_CONTROL_ +{ + IMG_BOOL bInitPhaseComplete; /*!< init phase has finished */ + IMG_UINT32 ui32Flags; /*!< flags (see DEBUG_FLAGS above) */ + + IMG_UINT32 ui32CapMode; /*!< capturing mode framed/hot key */ + IMG_UINT32 ui32OutMode; /*!< output mode, e.g. files */ + IMG_UINT32 ui32DebugLevel; + IMG_UINT32 ui32DefaultMode; + IMG_UINT32 ui32Start; /*!< first capture frame */ + IMG_UINT32 ui32End; /*!< last frame */ + IMG_UINT32 ui32Current; /*!< current frame */ + IMG_UINT32 ui32SampleRate; /*!< capture frequency */ + IMG_UINT32 ui32Reserved; +} DBG_STREAM_CONTROL, *PDBG_STREAM_CONTROL; +/* + Per-buffer control structure. +*/ +typedef struct _DBG_STREAM_ +{ + struct _DBG_STREAM_ *psNext; + struct _DBG_STREAM_ *psInitStream; + DBG_STREAM_CONTROL *psCtrl; + IMG_BOOL bCircularAllowed; + IMG_PVOID pvBase; + IMG_UINT32 ui32Size; + IMG_UINT32 ui32RPtr; + IMG_UINT32 ui32WPtr; + IMG_UINT32 ui32DataWritten; + IMG_UINT32 ui32Marker; /*!< marker for file splitting */ + IMG_UINT32 ui32InitPhaseWOff; /*!< snapshot offset for init phase end for follow-on pdump */ + IMG_CHAR szName[30]; /* Give this a size, some compilers don't like [] */ +} DBG_STREAM,*PDBG_STREAM; + +/* + * Allows dbgdrv to notify services when events happen, e.g. pdump.exe starts. + * (better than resetting psDevInfo->psKernelCCBInfo->ui32CCBDumpWOff = 0 + * in SGXGetClientInfoKM.) + */ +typedef struct _DBGKM_CONNECT_NOTIFIER_ +{ + IMG_VOID (IMG_CALLCONV *pfnConnectNotifier) (IMG_VOID); +} DBGKM_CONNECT_NOTIFIER, *PDBGKM_CONNECT_NOTIFIER; + +/***************************************************************************** + Kernel mode service table +*****************************************************************************/ +typedef struct _DBGKM_SERVICE_TABLE_ +{ + IMG_UINT32 ui32Size; + IMG_VOID * (IMG_CALLCONV *pfnCreateStream) (IMG_CHAR * pszName,IMG_UINT32 ui32CapMode,IMG_UINT32 ui32OutMode,IMG_UINT32 ui32Flags,IMG_UINT32 ui32Pages); + IMG_VOID (IMG_CALLCONV *pfnDestroyStream) (PDBG_STREAM psStream); + IMG_VOID * (IMG_CALLCONV *pfnFindStream) (IMG_CHAR * pszName, IMG_BOOL bResetInitBuffer); + IMG_UINT32 (IMG_CALLCONV *pfnWriteString) (PDBG_STREAM psStream,IMG_CHAR * pszString,IMG_UINT32 ui32Level); + IMG_UINT32 (IMG_CALLCONV *pfnReadString) (PDBG_STREAM psStream,IMG_CHAR * pszString,IMG_UINT32 ui32Limit); + IMG_UINT32 (IMG_CALLCONV *pfnWriteBIN) (PDBG_STREAM psStream,IMG_UINT8 *pui8InBuf,IMG_UINT32 ui32InBuffSize,IMG_UINT32 ui32Level); + IMG_UINT32 (IMG_CALLCONV *pfnReadBIN) (PDBG_STREAM psStream,IMG_BOOL bReadInitBuffer, IMG_UINT32 ui32OutBufferSize,IMG_UINT8 *pui8OutBuf); + IMG_VOID (IMG_CALLCONV *pfnSetCaptureMode) (PDBG_STREAM psStream,IMG_UINT32 ui32CapMode,IMG_UINT32 ui32Start,IMG_UINT32 ui32Stop,IMG_UINT32 ui32SampleRate); + IMG_VOID (IMG_CALLCONV *pfnSetOutputMode) (PDBG_STREAM psStream,IMG_UINT32 ui32OutMode); + IMG_VOID (IMG_CALLCONV *pfnSetDebugLevel) (PDBG_STREAM psStream,IMG_UINT32 ui32DebugLevel); + IMG_VOID (IMG_CALLCONV *pfnSetFrame) (PDBG_STREAM psStream,IMG_UINT32 ui32Frame); + IMG_UINT32 (IMG_CALLCONV *pfnGetFrame) (PDBG_STREAM psStream); + IMG_VOID (IMG_CALLCONV *pfnOverrideMode) (PDBG_STREAM psStream,IMG_UINT32 ui32Mode); + IMG_VOID (IMG_CALLCONV *pfnDefaultMode) (PDBG_STREAM psStream); + IMG_UINT32 (IMG_CALLCONV *pfnDBGDrivWrite2) (PDBG_STREAM psStream,IMG_UINT8 *pui8InBuf,IMG_UINT32 ui32InBuffSize,IMG_UINT32 ui32Level); + IMG_UINT32 (IMG_CALLCONV *pfnWriteStringCM) (PDBG_STREAM psStream,IMG_CHAR * pszString,IMG_UINT32 ui32Level); + IMG_UINT32 (IMG_CALLCONV *pfnWriteBINCM) (PDBG_STREAM psStream,IMG_UINT8 *pui8InBuf,IMG_UINT32 ui32InBuffSize,IMG_UINT32 ui32Level); + IMG_VOID (IMG_CALLCONV *pfnSetMarker) (PDBG_STREAM psStream,IMG_UINT32 ui32Marker); + IMG_UINT32 (IMG_CALLCONV *pfnGetMarker) (PDBG_STREAM psStream); + IMG_VOID (IMG_CALLCONV *pfnStartInitPhase) (PDBG_STREAM psStream); + IMG_VOID (IMG_CALLCONV *pfnStopInitPhase) (PDBG_STREAM psStream); + IMG_BOOL (IMG_CALLCONV *pfnIsCaptureFrame) (PDBG_STREAM psStream, IMG_BOOL bCheckPreviousFrame); + IMG_UINT32 (IMG_CALLCONV *pfnWriteLF) (PDBG_STREAM psStream, IMG_UINT8 *pui8InBuf, IMG_UINT32 ui32InBuffSize, IMG_UINT32 ui32Level, IMG_UINT32 ui32Flags); + IMG_UINT32 (IMG_CALLCONV *pfnReadLF) (PDBG_STREAM psStream, IMG_UINT32 ui32OutBuffSize, IMG_UINT8 *pui8OutBuf); + IMG_UINT32 (IMG_CALLCONV *pfnGetStreamOffset) (PDBG_STREAM psStream); + IMG_VOID (IMG_CALLCONV *pfnSetStreamOffset) (PDBG_STREAM psStream, IMG_UINT32 ui32StreamOffset); + IMG_BOOL (IMG_CALLCONV *pfnIsLastCaptureFrame) (PDBG_STREAM psStream); + IMG_VOID (IMG_CALLCONV *pfnWaitForEvent) (DBG_EVENT eEvent); + IMG_VOID (IMG_CALLCONV *pfnSetConnectNotifier) (DBGKM_CONNECT_NOTIFIER fn_notifier); + IMG_UINT32 (IMG_CALLCONV *pfnWritePersist) (PDBG_STREAM psStream,IMG_UINT8 *pui8InBuf,IMG_UINT32 ui32InBuffSize,IMG_UINT32 ui32Level); +} DBGKM_SERVICE_TABLE, *PDBGKM_SERVICE_TABLE; + +#if defined(__linux__) +/***************************************************************************** + Function to export service table from debug driver to the PDUMP component. +*****************************************************************************/ +IMG_VOID DBGDrvGetServiceTable(DBGKM_SERVICE_TABLE **fn_table); +#endif + + +#endif +/***************************************************************************** + End of file (DBGDRVIF.H) +*****************************************************************************/ diff --git a/jacinto6/sgx_src/eurasia_km/include4/img_defs.h b/jacinto6/sgx_src/eurasia_km/include4/img_defs.h new file mode 100644 index 0000000..375ed99 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/include4/img_defs.h @@ -0,0 +1,153 @@ +/*************************************************************************/ /*! +@Title Common header containing type definitions for portability +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Contains variable and structure definitions. Any platform + specific types should be defined in this file. +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ +#if !defined (__IMG_DEFS_H__) +#define __IMG_DEFS_H__ + +#include "img_types.h" + +typedef enum img_tag_TriStateSwitch +{ + IMG_ON = 0x00, + IMG_OFF, + IMG_IGNORE + +} img_TriStateSwitch, * img_pTriStateSwitch; + +#define IMG_SUCCESS 0 + +#define IMG_NO_REG 1 + +#if defined (NO_INLINE_FUNCS) + #define INLINE + #define FORCE_INLINE +#else +#if defined (__cplusplus) + #define INLINE inline + #define FORCE_INLINE inline +#else +#if !defined(INLINE) + #define INLINE __inline +#endif + #define FORCE_INLINE static __inline +#endif +#endif + + +/* Use this in any file, or use attributes under GCC - see below */ +#ifndef PVR_UNREFERENCED_PARAMETER +#define PVR_UNREFERENCED_PARAMETER(param) (param) = (param) +#endif + +/* The best way to supress unused parameter warnings using GCC is to use a + * variable attribute. Place the unref__ between the type and name of an + * unused parameter in a function parameter list, eg `int unref__ var'. This + * should only be used in GCC build environments, for example, in files that + * compile only on Linux. Other files should use UNREFERENCED_PARAMETER */ +#ifdef __GNUC__ +#define unref__ __attribute__ ((unused)) +#else +#define unref__ +#endif + +/* + Wide character definitions +*/ +#ifndef _TCHAR_DEFINED +#if defined(UNICODE) +typedef unsigned short TCHAR, *PTCHAR, *PTSTR; +#else /* #if defined(UNICODE) */ +typedef char TCHAR, *PTCHAR, *PTSTR; +#endif /* #if defined(UNICODE) */ +#define _TCHAR_DEFINED +#endif /* #ifndef _TCHAR_DEFINED */ + + + #if defined(__linux__) || defined(__QNXNTO__) || defined(__METAG) + + #define IMG_CALLCONV + #define IMG_INTERNAL __attribute__((visibility("hidden"))) + #define IMG_EXPORT __attribute__((visibility("default"))) + #define IMG_IMPORT + #define IMG_RESTRICT __restrict__ + + #else + #error("define an OS") + #endif + +// Use default definition if not overridden +#ifndef IMG_ABORT + #define IMG_ABORT() abort() +#endif + +#ifndef IMG_MALLOC + #define IMG_MALLOC(A) malloc (A) +#endif + +#ifndef IMG_FREE + #define IMG_FREE(A) free (A) +#endif + +#define IMG_CONST const + +#if defined(__GNUC__) +#define IMG_FORMAT_PRINTF(x,y) __attribute__((format(printf,x,y))) +#else +#define IMG_FORMAT_PRINTF(x,y) +#endif + +/* + * Cleanup request defines + */ +#define CLEANUP_WITH_POLL IMG_FALSE +#define FORCE_CLEANUP IMG_TRUE + +#if defined (_WIN64) +#define IMG_UNDEF (~0ULL) +#else +#define IMG_UNDEF (~0UL) +#endif + +#endif /* #if !defined (__IMG_DEFS_H__) */ +/***************************************************************************** + End of file (IMG_DEFS.H) +*****************************************************************************/ diff --git a/jacinto6/sgx_src/eurasia_km/include4/img_types.h b/jacinto6/sgx_src/eurasia_km/include4/img_types.h new file mode 100644 index 0000000..7f5137e --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/include4/img_types.h @@ -0,0 +1,214 @@ +/*************************************************************************/ /*! +@Title Global types for use by IMG APIs +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Defines type aliases for use by IMG APIs. +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ +#ifndef __IMG_TYPES_H__ +#define __IMG_TYPES_H__ + +/* define all address space bit depths: */ +/* CPU virtual address space defaults to 32bits */ +#if !defined(IMG_ADDRSPACE_CPUVADDR_BITS) +#define IMG_ADDRSPACE_CPUVADDR_BITS 32 +#endif + +/* Physical address space defaults to 32bits */ +#if !defined(IMG_ADDRSPACE_PHYSADDR_BITS) +#define IMG_ADDRSPACE_PHYSADDR_BITS 32 +#endif + +typedef unsigned int IMG_UINT, *IMG_PUINT; +typedef signed int IMG_INT, *IMG_PINT; + +typedef unsigned char IMG_UINT8, *IMG_PUINT8; +typedef unsigned char IMG_BYTE, *IMG_PBYTE; +typedef signed char IMG_INT8, *IMG_PINT8; +typedef char IMG_CHAR, *IMG_PCHAR; + +typedef unsigned short IMG_UINT16, *IMG_PUINT16; +typedef signed short IMG_INT16, *IMG_PINT16; +#if !defined(IMG_UINT32_IS_ULONG) +typedef unsigned int IMG_UINT32, *IMG_PUINT32; +typedef signed int IMG_INT32, *IMG_PINT32; +#else +typedef unsigned long IMG_UINT32, *IMG_PUINT32; +typedef signed long IMG_INT32, *IMG_PINT32; +#endif +#if !defined(IMG_UINT32_MAX) + #define IMG_UINT32_MAX 0xFFFFFFFFUL +#endif + +#if defined(USE_CODE) + +typedef unsigned __int64 IMG_UINT64, *IMG_PUINT64; +typedef __int64 IMG_INT64, *IMG_PINT64; + +#else + #if defined(LINUX) || defined(__METAG) || defined (__QNXNTO__) + typedef unsigned long long IMG_UINT64, *IMG_PUINT64; + typedef long long IMG_INT64, *IMG_PINT64; + #else + #error("define an OS") + #endif +#endif + +#if !(defined(LINUX) && defined (__KERNEL__)) +/* Linux kernel mode does not use floating point */ +typedef float IMG_FLOAT, *IMG_PFLOAT; +typedef double IMG_DOUBLE, *IMG_PDOUBLE; +#endif + +typedef enum tag_img_bool +{ + IMG_FALSE = 0, + IMG_TRUE = 1, + IMG_FORCE_ALIGN = 0x7FFFFFFF +} IMG_BOOL, *IMG_PBOOL; + +typedef void IMG_VOID, *IMG_PVOID; + +typedef IMG_INT32 IMG_RESULT; + +#if defined(_WIN64) + typedef unsigned __int64 IMG_UINTPTR_T; + typedef signed __int64 IMG_PTRDIFF_T; + typedef IMG_UINT64 IMG_SIZE_T; +#else + typedef unsigned int IMG_UINTPTR_T; + typedef IMG_UINT32 IMG_SIZE_T; +#endif + +typedef IMG_PVOID IMG_HANDLE; + +typedef void** IMG_HVOID, * IMG_PHVOID; + +#define IMG_NULL 0 + +/* services/stream ID */ +typedef IMG_UINT32 IMG_SID; + +typedef IMG_UINT32 IMG_EVENTSID; + +/* + * Address types. + * All types used to refer to a block of memory are wrapped in structures + * to enforce some degree of type safety, i.e. a IMG_DEV_VIRTADDR cannot + * be assigned to a variable of type IMG_DEV_PHYADDR because they are not the + * same thing. + * + * There is an assumption that the system contains at most one non-cpu mmu, + * and a memory block is only mapped by the MMU once. + * + * Different devices could have offset views of the physical address space. + * + */ + + +/* + * + * +------------+ +------------+ +------------+ +------------+ + * | CPU | | DEV | | DEV | | DEV | + * +------------+ +------------+ +------------+ +------------+ + * | | | | + * | PVOID |IMG_DEV_VIRTADDR |IMG_DEV_VIRTADDR | + * | \-------------------/ | + * | | | + * +------------+ +------------+ | + * | MMU | | MMU | | + * +------------+ +------------+ | + * | | | + * | | | + * | | | + * +--------+ +---------+ +--------+ + * | Offset | | (Offset)| | Offset | + * +--------+ +---------+ +--------+ + * | | IMG_DEV_PHYADDR | + * | | | + * | | IMG_DEV_PHYADDR | + * +---------------------------------------------------------------------+ + * | System Address bus | + * +---------------------------------------------------------------------+ + * + */ + +typedef IMG_PVOID IMG_CPU_VIRTADDR; + +/* device virtual address */ +typedef struct _IMG_DEV_VIRTADDR +{ + /* device virtual addresses are 32bit for now */ + IMG_UINT32 uiAddr; +#define IMG_CAST_TO_DEVVADDR_UINT(var) (IMG_UINT32)(var) + +} IMG_DEV_VIRTADDR; + +typedef IMG_UINT32 IMG_DEVMEM_SIZE_T; + +/* cpu physical address */ +typedef struct _IMG_CPU_PHYADDR +{ + /* variable sized type (32,64) */ + IMG_UINTPTR_T uiAddr; +} IMG_CPU_PHYADDR; + +/* device physical address */ +typedef struct _IMG_DEV_PHYADDR +{ +#if IMG_ADDRSPACE_PHYSADDR_BITS == 32 + /* variable sized type (32,64) */ + IMG_UINTPTR_T uiAddr; +#else + IMG_UINT32 uiAddr; + IMG_UINT32 uiHighAddr; +#endif +} IMG_DEV_PHYADDR; + +/* system physical address */ +typedef struct _IMG_SYS_PHYADDR +{ + /* variable sized type (32,64) */ + IMG_UINTPTR_T uiAddr; +} IMG_SYS_PHYADDR; + +#include "img_defs.h" + +#endif /* __IMG_TYPES_H__ */ +/****************************************************************************** + End of file (img_types.h) +******************************************************************************/ diff --git a/jacinto6/sgx_src/eurasia_km/include4/pdumpdefs.h b/jacinto6/sgx_src/eurasia_km/include4/pdumpdefs.h new file mode 100644 index 0000000..112e9ee --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/include4/pdumpdefs.h @@ -0,0 +1,126 @@ +/*************************************************************************/ /*! +@Title PDUMP definitions header +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description PDUMP definitions header +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ +#if !defined (__PDUMPDEFS_H__) +#define __PDUMPDEFS_H__ + +typedef enum _PDUMP_PIXEL_FORMAT_ +{ + PVRSRV_PDUMP_PIXEL_FORMAT_UNSUPPORTED = 0, + PVRSRV_PDUMP_PIXEL_FORMAT_RGB8 = 1, + PVRSRV_PDUMP_PIXEL_FORMAT_RGB332 = 2, + PVRSRV_PDUMP_PIXEL_FORMAT_KRGB555 = 3, + PVRSRV_PDUMP_PIXEL_FORMAT_RGB565 = 4, + PVRSRV_PDUMP_PIXEL_FORMAT_ARGB4444 = 5, + PVRSRV_PDUMP_PIXEL_FORMAT_ARGB1555 = 6, + PVRSRV_PDUMP_PIXEL_FORMAT_RGB888 = 7, + PVRSRV_PDUMP_PIXEL_FORMAT_ARGB8888 = 8, + PVRSRV_PDUMP_PIXEL_FORMAT_YUV8 = 9, + PVRSRV_PDUMP_PIXEL_FORMAT_AYUV4444 = 10, + PVRSRV_PDUMP_PIXEL_FORMAT_VY0UY1_8888 = 11, + PVRSRV_PDUMP_PIXEL_FORMAT_UY0VY1_8888 = 12, + PVRSRV_PDUMP_PIXEL_FORMAT_Y0UY1V_8888 = 13, + PVRSRV_PDUMP_PIXEL_FORMAT_Y0VY1U_8888 = 14, + PVRSRV_PDUMP_PIXEL_FORMAT_YUV888 = 15, + PVRSRV_PDUMP_PIXEL_FORMAT_UYVY10101010 = 16, + PVRSRV_PDUMP_PIXEL_FORMAT_VYAUYA8888 = 17, + PVRSRV_PDUMP_PIXEL_FORMAT_AYUV8888 = 18, + PVRSRV_PDUMP_PIXEL_FORMAT_AYUV2101010 = 19, + PVRSRV_PDUMP_PIXEL_FORMAT_YUV101010 = 20, + PVRSRV_PDUMP_PIXEL_FORMAT_PL12Y8 = 21, + PVRSRV_PDUMP_PIXEL_FORMAT_YUV_IMC2 = 22, + PVRSRV_PDUMP_PIXEL_FORMAT_YUV_YV12 = 23, + PVRSRV_PDUMP_PIXEL_FORMAT_YUV_PL8 = 24, + PVRSRV_PDUMP_PIXEL_FORMAT_YUV_PL12 = 25, + PVRSRV_PDUMP_PIXEL_FORMAT_422PL12YUV8 = 26, + PVRSRV_PDUMP_PIXEL_FORMAT_420PL12YUV8 = 27, + PVRSRV_PDUMP_PIXEL_FORMAT_PL12Y10 = 28, + PVRSRV_PDUMP_PIXEL_FORMAT_422PL12YUV10 = 29, + PVRSRV_PDUMP_PIXEL_FORMAT_420PL12YUV10 = 30, + PVRSRV_PDUMP_PIXEL_FORMAT_ABGR8888 = 31, + PVRSRV_PDUMP_PIXEL_FORMAT_BGRA8888 = 32, + PVRSRV_PDUMP_PIXEL_FORMAT_ARGB8332 = 33, + PVRSRV_PDUMP_PIXEL_FORMAT_RGB555 = 34, + PVRSRV_PDUMP_PIXEL_FORMAT_F16 = 35, + PVRSRV_PDUMP_PIXEL_FORMAT_F32 = 36, + PVRSRV_PDUMP_PIXEL_FORMAT_L16 = 37, + PVRSRV_PDUMP_PIXEL_FORMAT_L32 = 38, + PVRSRV_PDUMP_PIXEL_FORMAT_RGBA8888 = 39, + PVRSRV_PDUMP_PIXEL_FORMAT_ABGR4444 = 40, + PVRSRV_PDUMP_PIXEL_FORMAT_RGBA4444 = 41, + PVRSRV_PDUMP_PIXEL_FORMAT_BGRA4444 = 42, + PVRSRV_PDUMP_PIXEL_FORMAT_ABGR1555 = 43, + PVRSRV_PDUMP_PIXEL_FORMAT_RGBA5551 = 44, + PVRSRV_PDUMP_PIXEL_FORMAT_BGRA5551 = 45, + PVRSRV_PDUMP_PIXEL_FORMAT_BGR565 = 46, + PVRSRV_PDUMP_PIXEL_FORMAT_A8 = 47, + + PVRSRV_PDUMP_PIXEL_FORMAT_FORCE_I32 = 0x7fffffff + +} PDUMP_PIXEL_FORMAT; + +typedef enum _PDUMP_MEM_FORMAT_ +{ + PVRSRV_PDUMP_MEM_FORMAT_STRIDE = 0, + PVRSRV_PDUMP_MEM_FORMAT_RESERVED = 1, + PVRSRV_PDUMP_MEM_FORMAT_TILED = 8, + PVRSRV_PDUMP_MEM_FORMAT_TWIDDLED = 9, + PVRSRV_PDUMP_MEM_FORMAT_HYBRID = 10, + + PVRSRV_PDUMP_MEM_FORMAT_FORCE_I32 = 0x7fffffff +} PDUMP_MEM_FORMAT; + +typedef enum _PDUMP_POLL_OPERATOR +{ + PDUMP_POLL_OPERATOR_EQUAL = 0, + PDUMP_POLL_OPERATOR_LESS = 1, + PDUMP_POLL_OPERATOR_LESSEQUAL = 2, + PDUMP_POLL_OPERATOR_GREATER = 3, + PDUMP_POLL_OPERATOR_GREATEREQUAL = 4, + PDUMP_POLL_OPERATOR_NOTEQUAL = 5, +} PDUMP_POLL_OPERATOR; + + +#endif /* __PDUMPDEFS_H__ */ + +/***************************************************************************** + End of file (pdumpdefs.h) +*****************************************************************************/ diff --git a/jacinto6/sgx_src/eurasia_km/include4/pvr_debug.h b/jacinto6/sgx_src/eurasia_km/include4/pvr_debug.h new file mode 100644 index 0000000..7e05666 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/include4/pvr_debug.h @@ -0,0 +1,235 @@ +/*************************************************************************/ /*! +@Title PVR Debug Declarations +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Provides debug functionality +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ +#ifndef __PVR_DEBUG_H__ +#define __PVR_DEBUG_H__ + + +#include "img_types.h" + + +#if defined (__cplusplus) +extern "C" { +#endif + +#define PVR_MAX_DEBUG_MESSAGE_LEN (512) + +/* These are privately used by pvr_debug, use the PVR_DBG_ defines instead */ +#define DBGPRIV_FATAL 0x01UL +#define DBGPRIV_ERROR 0x02UL +#define DBGPRIV_WARNING 0x04UL +#define DBGPRIV_MESSAGE 0x08UL +#define DBGPRIV_VERBOSE 0x10UL +#define DBGPRIV_CALLTRACE 0x20UL +#define DBGPRIV_ALLOC 0x40UL +#define DBGPRIV_DBGDRV_MESSAGE 0x80UL + +#define DBGPRIV_DBGLEVEL_COUNT 8 + +#if !defined(PVRSRV_NEED_PVR_ASSERT) && defined(DEBUG) +#define PVRSRV_NEED_PVR_ASSERT +#endif + +#if defined(PVRSRV_NEED_PVR_ASSERT) && !defined(PVRSRV_NEED_PVR_DPF) +#define PVRSRV_NEED_PVR_DPF +#endif + +#if !defined(PVRSRV_NEED_PVR_TRACE) && (defined(DEBUG) || defined(TIMING)) +#define PVRSRV_NEED_PVR_TRACE +#endif + +/* PVR_ASSERT() and PVR_DBG_BREAK handling */ + +#if defined(PVRSRV_NEED_PVR_ASSERT) + +#if defined(LINUX) && defined(__KERNEL__) +/* In Linux kernel mode, use BUG() directly. This produces the correct + filename and line number in the panic message. */ +#define PVR_ASSERT(EXPR) do \ + { \ + if (!(EXPR)) \ + { \ + PVRSRVDebugPrintf(DBGPRIV_FATAL, __FILE__, __LINE__, \ + "Debug assertion failed!"); \ + BUG(); \ + } \ + } while (0) + +#else /* defined(LINUX) && defined(__KERNEL__) */ + +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVDebugAssertFail(const IMG_CHAR *pszFile, + IMG_UINT32 ui32Line); + +#if defined(LINUX) + #define PVR_ASSERT(EXPR) do \ + { \ + if (!(EXPR)) \ + PVRSRVDebugAssertFail(__FILE__, __LINE__); \ + } while (0) +#else + #if defined (__QNXNTO__) + #define PVR_ASSERT(EXPR) if (!(EXPR)) PVRSRVDebugAssertFail(__FILE__, __LINE__); + #else + #define PVR_ASSERT(EXPR) if (!(EXPR)) PVRSRVDebugAssertFail(__FILE__, __LINE__) + #endif +#endif + +#endif /* defined(LINUX) && defined(__KERNEL__) */ + + + #if defined(LINUX) && defined(__KERNEL__) + #define PVR_DBG_BREAK BUG() + #else + #define PVR_DBG_BREAK PVRSRVDebugAssertFail(__FILE__, __LINE__) + #endif + +#else /* defined(PVRSRV_NEED_PVR_ASSERT) */ + + #define PVR_ASSERT(EXPR) + #define PVR_DBG_BREAK + +#endif /* defined(PVRSRV_NEED_PVR_ASSERT) */ + + +/* PVR_DPF() handling */ + +#if defined(PVRSRV_NEED_PVR_DPF) + +#if defined(PVRSRV_NEW_PVR_DPF) + + /* New logging mechanism */ + #define PVR_DBG_FATAL DBGPRIV_FATAL + #define PVR_DBG_ERROR DBGPRIV_ERROR + #define PVR_DBG_WARNING DBGPRIV_WARNING + #define PVR_DBG_MESSAGE DBGPRIV_MESSAGE + #define PVR_DBG_VERBOSE DBGPRIV_VERBOSE + #define PVR_DBG_CALLTRACE DBGPRIV_CALLTRACE + #define PVR_DBG_ALLOC DBGPRIV_ALLOC + #define PVR_DBGDRIV_MESSAGE DBGPRIV_DBGDRV_MESSAGE + + /* These levels are always on with PVRSRV_NEED_PVR_DPF */ + #define __PVR_DPF_0x01UL(x...) PVRSRVDebugPrintf(DBGPRIV_FATAL, x) + #define __PVR_DPF_0x02UL(x...) PVRSRVDebugPrintf(DBGPRIV_ERROR, x) + + /* Some are compiled out completely in release builds */ +#if defined(DEBUG) + #define __PVR_DPF_0x04UL(x...) PVRSRVDebugPrintf(DBGPRIV_WARNING, x) + #define __PVR_DPF_0x08UL(x...) PVRSRVDebugPrintf(DBGPRIV_MESSAGE, x) + #define __PVR_DPF_0x10UL(x...) PVRSRVDebugPrintf(DBGPRIV_VERBOSE, x) + #define __PVR_DPF_0x20UL(x...) PVRSRVDebugPrintf(DBGPRIV_CALLTRACE, x) + #define __PVR_DPF_0x40UL(x...) PVRSRVDebugPrintf(DBGPRIV_ALLOC, x) + #define __PVR_DPF_0x80UL(x...) PVRSRVDebugPrintf(DBGPRIV_DBGDRV_MESSAGE, x) +#else + #define __PVR_DPF_0x04UL(x...) + #define __PVR_DPF_0x08UL(x...) + #define __PVR_DPF_0x10UL(x...) + #define __PVR_DPF_0x20UL(x...) + #define __PVR_DPF_0x40UL(x...) + #define __PVR_DPF_0x80UL(x...) +#endif + + /* Translate the different log levels to separate macros + * so they can each be compiled out. + */ +#if defined(DEBUG) + #define __PVR_DPF(lvl, x...) __PVR_DPF_ ## lvl (__FILE__, __LINE__, x) +#else + #define __PVR_DPF(lvl, x...) __PVR_DPF_ ## lvl ("", 0, x) +#endif + + /* Get rid of the double bracketing */ + #define PVR_DPF(x) __PVR_DPF x + +#else /* defined(PVRSRV_NEW_PVR_DPF) */ + + /* Old logging mechanism */ + #define PVR_DBG_FATAL DBGPRIV_FATAL,__FILE__, __LINE__ + #define PVR_DBG_ERROR DBGPRIV_ERROR,__FILE__, __LINE__ + #define PVR_DBG_WARNING DBGPRIV_WARNING,__FILE__, __LINE__ + #define PVR_DBG_MESSAGE DBGPRIV_MESSAGE,__FILE__, __LINE__ + #define PVR_DBG_VERBOSE DBGPRIV_VERBOSE,__FILE__, __LINE__ + #define PVR_DBG_CALLTRACE DBGPRIV_CALLTRACE,__FILE__, __LINE__ + #define PVR_DBG_ALLOC DBGPRIV_ALLOC,__FILE__, __LINE__ + #define PVR_DBGDRIV_MESSAGE DBGPRIV_DBGDRV_MESSAGE, "", 0 + + #define PVR_DPF(X) PVRSRVDebugPrintf X + +#endif /* defined(PVRSRV_NEW_PVR_DPF) */ + +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVDebugPrintf(IMG_UINT32 ui32DebugLevel, + const IMG_CHAR *pszFileName, + IMG_UINT32 ui32Line, + const IMG_CHAR *pszFormat, + ...) IMG_FORMAT_PRINTF(4, 5); + +#else /* defined(PVRSRV_NEED_PVR_DPF) */ + + #define PVR_DPF(X) + +#endif /* defined(PVRSRV_NEED_PVR_DPF) */ + + +/* PVR_TRACE() handling */ + +#if defined(PVRSRV_NEED_PVR_TRACE) + + #define PVR_TRACE(X) PVRSRVTrace X + +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVTrace(const IMG_CHAR* pszFormat, ... ) + IMG_FORMAT_PRINTF(1, 2); + +#else /* defined(PVRSRV_NEED_PVR_TRACE) */ + + #define PVR_TRACE(X) + +#endif /* defined(PVRSRV_NEED_PVR_TRACE) */ + + +#if defined (__cplusplus) +} +#endif + +#endif /* __PVR_DEBUG_H__ */ + +/****************************************************************************** + End of file (pvr_debug.h) +******************************************************************************/ + diff --git a/jacinto6/sgx_src/eurasia_km/include4/pvrmodule.h b/jacinto6/sgx_src/eurasia_km/include4/pvrmodule.h new file mode 100644 index 0000000..267c7b6 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/include4/pvrmodule.h @@ -0,0 +1,48 @@ +/*************************************************************************/ /*! +@Title Module Author and License. +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _PVRMODULE_H_ +#define _PVRMODULE_H_ + +MODULE_AUTHOR("Imagination Technologies Ltd. "); +MODULE_LICENSE("Dual MIT/GPL"); + +#endif /* _PVRMODULE_H_ */ diff --git a/jacinto6/sgx_src/eurasia_km/include4/pvrversion.h b/jacinto6/sgx_src/eurasia_km/include4/pvrversion.h new file mode 100644 index 0000000..933ed79 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/include4/pvrversion.h @@ -0,0 +1,69 @@ +/*************************************************************************/ /*! +@File +@Title Version numbers and strings. +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Version numbers and strings for PVR Consumer services + components. +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _PVRVERSION_H_ +#define _PVRVERSION_H_ + +#define PVR_STR(X) #X +#define PVR_STR2(X) PVR_STR(X) + +#define PVRVERSION_MAJ 1 +#define PVRVERSION_MIN 9 +#define PVRVERSION_BRANCH 19 + +#define PVRVERSION_FAMILY "sgxddk" +#define PVRVERSION_BRANCHNAME "1.9" +#define PVRVERSION_BUILD 2291151 +#define PVRVERSION_BSCONTROL "SGX_DDK_Android" + +#define PVRVERSION_STRING "SGX_DDK_Android sgxddk 19 1.9@" PVR_STR2(PVRVERSION_BUILD) +#define PVRVERSION_STRING_SHORT "1.9@" PVR_STR2(PVRVERSION_BUILD) + +#define COPYRIGHT_TXT "Copyright (c) Imagination Technologies Ltd. All Rights Reserved." + +#define PVRVERSION_BUILD_HI 229 +#define PVRVERSION_BUILD_LO 1151 +#define PVRVERSION_STRING_NUMERIC PVR_STR2(PVRVERSION_MAJ) "." PVR_STR2(PVRVERSION_MIN) "." PVR_STR2(PVRVERSION_BUILD_HI) "." PVR_STR2(PVRVERSION_BUILD_LO) + +#endif /* _PVRVERSION_H_ */ diff --git a/jacinto6/sgx_src/eurasia_km/include4/services.h b/jacinto6/sgx_src/eurasia_km/include4/services.h new file mode 100644 index 0000000..bfa7fb0 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/include4/services.h @@ -0,0 +1,1870 @@ +/*************************************************************************/ /*! +@Title Services API Header +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Exported services API details +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef __SERVICES_H__ +#define __SERVICES_H__ + +#if defined (__cplusplus) +extern "C" { +#endif + +#include "img_defs.h" +#include "servicesext.h" +#include "pdumpdefs.h" + + +/* The comment below is the front page for code-generated doxygen documentation */ +/*! + ****************************************************************************** + @mainpage + This document details the APIs and implementation of the Consumer Services. + It is intended to be used in conjunction with the Consumer Services + Software Architectural Specification and the Consumer Services Software + Functional Specification. + *****************************************************************************/ + +/****************************************************************************** + * #defines + *****************************************************************************/ + +/* 4k page size definition */ +#define PVRSRV_4K_PAGE_SIZE 4096UL + +#define PVRSRV_MAX_CMD_SIZE 1024/*!< max size in bytes of a command */ + +#define PVRSRV_MAX_DEVICES 16 /*!< Largest supported number of devices on the system */ + +#define EVENTOBJNAME_MAXLENGTH (50) + +/* + Flags associated with memory allocation + (bits 0-11) +*/ +#define PVRSRV_MEM_READ (1U<<0) +#define PVRSRV_MEM_WRITE (1U<<1) +#define PVRSRV_MEM_CACHE_CONSISTENT (1U<<2) +#define PVRSRV_MEM_NO_SYNCOBJ (1U<<3) +#define PVRSRV_MEM_INTERLEAVED (1U<<4) +#define PVRSRV_MEM_DUMMY (1U<<5) +#define PVRSRV_MEM_EDM_PROTECT (1U<<6) +#define PVRSRV_MEM_ZERO (1U<<7) +#define PVRSRV_MEM_USER_SUPPLIED_DEVVADDR (1U<<8) +#define PVRSRV_MEM_RAM_BACKED_ALLOCATION (1U<<9) +#define PVRSRV_MEM_NO_RESMAN (1U<<10) +#define PVRSRV_MEM_EXPORTED (1U<<11) + + +/* + Heap Attribute flags + (bits 12-23) +*/ +#define PVRSRV_HAP_CACHED (1U<<12) +#define PVRSRV_HAP_UNCACHED (1U<<13) +#define PVRSRV_HAP_WRITECOMBINE (1U<<14) +#define PVRSRV_HAP_CACHETYPE_MASK (PVRSRV_HAP_CACHED|PVRSRV_HAP_UNCACHED|PVRSRV_HAP_WRITECOMBINE) +#define PVRSRV_HAP_KERNEL_ONLY (1U<<15) +#define PVRSRV_HAP_SINGLE_PROCESS (1U<<16) +#define PVRSRV_HAP_MULTI_PROCESS (1U<<17) +#define PVRSRV_HAP_FROM_EXISTING_PROCESS (1U<<18) +#define PVRSRV_HAP_NO_CPU_VIRTUAL (1U<<19) +#define PVRSRV_MAP_GC_MMU (1UL<<20) +#define PVRSRV_HAP_GPU_PAGEABLE (1U<<21) +#define PVRSRV_HAP_NO_GPU_VIRTUAL_ON_ALLOC (1U<<22) +#define PVRSRV_HAP_MAPTYPE_MASK (PVRSRV_HAP_KERNEL_ONLY \ + |PVRSRV_HAP_SINGLE_PROCESS \ + |PVRSRV_HAP_MULTI_PROCESS \ + |PVRSRV_HAP_FROM_EXISTING_PROCESS) +#define PVRSRV_HAP_MAPPING_CTRL_MASK (PVRSRV_HAP_NO_CPU_VIRTUAL\ + |PVRSRV_HAP_GPU_PAGEABLE \ + |PVRSRV_HAP_NO_GPU_VIRTUAL_ON_ALLOC) + +/* + Allows user allocations to override heap attributes + (Bits shared with heap flags) +*/ +#define PVRSRV_MEM_CACHED PVRSRV_HAP_CACHED +#define PVRSRV_MEM_UNCACHED PVRSRV_HAP_UNCACHED +#define PVRSRV_MEM_WRITECOMBINE PVRSRV_HAP_WRITECOMBINE + +/* + Backing store flags (defined internally) + (bits 24-26) +*/ +#define PVRSRV_MEM_BACKINGSTORE_FIELD_SHIFT (24) + +/* + Per allocation/mapping flags + (bits 27-30) + */ +#define PVRSRV_MAP_NOUSERVIRTUAL (1UL<<27) +#define PVRSRV_MEM_XPROC (1U<<28) +#define PVRSRV_MEM_ION (1U<<29) +#define PVRSRV_MEM_ALLOCATENONCACHEDMEM (1UL<<30) + +/* + Internal allocation/mapping flags + (bit 31) +*/ +#define PVRSRV_MEM_SPARSE (1U<<31) + + +/* + * How much context we lose on a (power) mode change + */ +#define PVRSRV_NO_CONTEXT_LOSS 0 /*!< Do not lose state on power down */ +#define PVRSRV_SEVERE_LOSS_OF_CONTEXT 1 /*!< lose state on power down */ +#define PVRSRV_PRE_STATE_CHANGE_MASK 0x80 /*!< power state change mask */ + + +/* + * Device cookie defines + */ +#define PVRSRV_DEFAULT_DEV_COOKIE (1) /*!< default device cookie */ + + +/* + * Misc Info. present flags + */ +#define PVRSRV_MISC_INFO_TIMER_PRESENT (1U<<0) +#define PVRSRV_MISC_INFO_CLOCKGATE_PRESENT (1U<<1) +#define PVRSRV_MISC_INFO_MEMSTATS_PRESENT (1U<<2) +#define PVRSRV_MISC_INFO_GLOBALEVENTOBJECT_PRESENT (1U<<3) +#define PVRSRV_MISC_INFO_DDKVERSION_PRESENT (1U<<4) +#define PVRSRV_MISC_INFO_CPUCACHEOP_PRESENT (1U<<5) +#define PVRSRV_MISC_INFO_FREEMEM_PRESENT (1U<<6) +#define PVRSRV_MISC_INFO_GET_REF_COUNT_PRESENT (1U<<7) +#define PVRSRV_MISC_INFO_GET_PAGE_SIZE_PRESENT (1U<<8) +#define PVRSRV_MISC_INFO_FORCE_SWAP_TO_SYSTEM_PRESENT (1U<<9) + +#define PVRSRV_MISC_INFO_RESET_PRESENT (1U<<31) + +/* PDUMP defines */ +#define PVRSRV_PDUMP_MAX_FILENAME_SIZE 20 +#define PVRSRV_PDUMP_MAX_COMMENT_SIZE 200 + + +/* + Flags for PVRSRVChangeDeviceMemoryAttributes call. +*/ +#define PVRSRV_CHANGEDEVMEM_ATTRIBS_CACHECOHERENT 0x00000001 + +/* + Flags for PVRSRVMapExtMemory and PVRSRVUnmapExtMemory + ALTERNATEVA - Used when mapping multiple virtual addresses to the same physical address. Set this flag on extra maps. + PHYSCONTIG - Physical pages are contiguous (unused) +*/ +#define PVRSRV_MAPEXTMEMORY_FLAGS_ALTERNATEVA 0x00000001 +#define PVRSRV_MAPEXTMEMORY_FLAGS_PHYSCONTIG 0x00000002 + +/* + Flags for PVRSRVModifySyncOps + WO_INC - Used to increment "WriteOpsPending/complete of sync info" + RO_INC - Used to increment "ReadOpsPending/complete of sync info" +*/ +#define PVRSRV_MODIFYSYNCOPS_FLAGS_WO_INC 0x00000001 +#define PVRSRV_MODIFYSYNCOPS_FLAGS_RO_INC 0x00000002 + +/* + Flags for Services connection. + Allows to define per-client policy for Services +*/ +#define SRV_FLAGS_PERSIST 0x1 +#define SRV_FLAGS_PDUMP_ACTIVE 0x2 + +/* + Pdump flags which are accessible to Services clients +*/ +#define PVRSRV_PDUMP_FLAGS_CONTINUOUS 0x1 + +/* Number of MM planes supported for the meminfo */ +#define PVRSRV_MAX_NUMBER_OF_MM_BUFFER_PLANES 3 + +/* Invalid Device Virtual Address Value */ +#define PVRSRV_BAD_DEVICE_ADDRESS 0 + +/* Maximum array size of the meminfo's when invoking + * PVRSRVMultiManageDevMem() in shared mode */ +#define PVRSRV_MULTI_MANAGE_DEV_MEM_MAX_SIZE 128 + +/* Maximum array size of the meminfo's when invoking + * PVRSRVMultiManageDevMem() in direct (copy) mode */ +#define PVRSRV_MULTI_MANAGE_DEV_MEM_MAX_DIRECT_SIZE 8 + +/****************************************************************************** + * Enums + *****************************************************************************/ + +/*! + ****************************************************************************** + * List of known device types. + *****************************************************************************/ +typedef enum _PVRSRV_DEVICE_TYPE_ +{ + PVRSRV_DEVICE_TYPE_UNKNOWN = 0 , + PVRSRV_DEVICE_TYPE_MBX1 = 1 , + PVRSRV_DEVICE_TYPE_MBX1_LITE = 2 , + + PVRSRV_DEVICE_TYPE_M24VA = 3, + PVRSRV_DEVICE_TYPE_MVDA2 = 4, + PVRSRV_DEVICE_TYPE_MVED1 = 5, + PVRSRV_DEVICE_TYPE_MSVDX = 6, + + PVRSRV_DEVICE_TYPE_SGX = 7, + + PVRSRV_DEVICE_TYPE_VGX = 8, + + /* 3rd party devices take ext type */ + PVRSRV_DEVICE_TYPE_EXT = 9, + + PVRSRV_DEVICE_TYPE_LAST = 9, + + PVRSRV_DEVICE_TYPE_FORCE_I32 = 0x7fffffff + +} PVRSRV_DEVICE_TYPE; + +#define HEAP_ID( _dev_ , _dev_heap_idx_ ) ( ((_dev_)<<24) | ((_dev_heap_idx_)&((1<<24)-1)) ) +#define HEAP_IDX( _heap_id_ ) ( (_heap_id_)&((1<<24) - 1 ) ) +#define HEAP_DEV( _heap_id_ ) ( (_heap_id_)>>24 ) + +/* common undefined heap ID define */ +#define PVRSRV_UNDEFINED_HEAP_ID (~0LU) + +/*! + ****************************************************************************** + * User Module type + *****************************************************************************/ +typedef enum +{ + IMG_EGL = 0x00000001, + IMG_OPENGLES1 = 0x00000002, + IMG_OPENGLES2 = 0x00000003, + IMG_D3DM = 0x00000004, + IMG_SRV_UM = 0x00000005, + IMG_OPENVG = 0x00000006, + IMG_SRVCLIENT = 0x00000007, + IMG_VISTAKMD = 0x00000008, + IMG_VISTA3DNODE = 0x00000009, + IMG_VISTAMVIDEONODE = 0x0000000A, + IMG_VISTAVPBNODE = 0x0000000B, + IMG_OPENGL = 0x0000000C, + IMG_D3D = 0x0000000D, +#if defined(SUPPORT_GRAPHICS_HAL) || defined(SUPPORT_COMPOSER_HAL) + IMG_ANDROID_HAL = 0x0000000E, +#endif +#if defined(SUPPORT_OPENCL) + IMG_OPENCL = 0x0000000F, +#endif + +} IMG_MODULE_ID; + + +#define APPHINT_MAX_STRING_SIZE 256 + +/*! + ****************************************************************************** + * IMG data types + *****************************************************************************/ +typedef enum +{ + IMG_STRING_TYPE = 1, + IMG_FLOAT_TYPE , + IMG_UINT_TYPE , + IMG_INT_TYPE , + IMG_FLAG_TYPE +}IMG_DATA_TYPE; + + +/****************************************************************************** + * Structure definitions. + *****************************************************************************/ + +/*! + * Forward declaration + */ +typedef struct _PVRSRV_DEV_DATA_ *PPVRSRV_DEV_DATA; + +/*! + ****************************************************************************** + * Device identifier structure + *****************************************************************************/ +typedef struct _PVRSRV_DEVICE_IDENTIFIER_ +{ + PVRSRV_DEVICE_TYPE eDeviceType; /*!< Identifies the type of the device */ + PVRSRV_DEVICE_CLASS eDeviceClass; /*!< Identifies more general class of device - display/3d/mpeg etc */ + IMG_UINT32 ui32DeviceIndex; /*!< Index of the device within the system */ + IMG_CHAR *pszPDumpDevName; /*!< Pdump memory bank name */ + IMG_CHAR *pszPDumpRegName; /*!< Pdump register bank name */ + +} PVRSRV_DEVICE_IDENTIFIER; + + +/****************************************************************************** + * Client dev info + ****************************************************************************** + */ +typedef struct _PVRSRV_CLIENT_DEV_DATA_ +{ + IMG_UINT32 ui32NumDevices; /*!< Number of services-managed devices connected */ + PVRSRV_DEVICE_IDENTIFIER asDevID[PVRSRV_MAX_DEVICES]; /*!< Device identifiers */ + PVRSRV_ERROR (*apfnDevConnect[PVRSRV_MAX_DEVICES])(PPVRSRV_DEV_DATA); /*< device-specific connection callback */ + PVRSRV_ERROR (*apfnDumpTrace[PVRSRV_MAX_DEVICES])(PPVRSRV_DEV_DATA); /*!< device-specific debug trace callback */ + +} PVRSRV_CLIENT_DEV_DATA; + + +/*! + ****************************************************************************** + * Kernel Services connection structure + *****************************************************************************/ +typedef struct _PVRSRV_CONNECTION_ +{ + IMG_HANDLE hServices; /*!< UM IOCTL handle */ + IMG_UINT32 ui32ProcessID; /*!< Process ID for resource locking */ + PVRSRV_CLIENT_DEV_DATA sClientDevData; /*!< Client device data */ + IMG_UINT32 ui32SrvFlags; /*!< Per-client Services flags */ +}PVRSRV_CONNECTION; + + +/*! + ****************************************************************************** + * This structure allows the user mode glue code to have an OS independent + * set of prototypes. + *****************************************************************************/ +typedef struct _PVRSRV_DEV_DATA_ +{ + IMG_CONST PVRSRV_CONNECTION *psConnection; /*!< Services connection info */ +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hDevCookie; /*!< Dev cookie */ +#else + IMG_HANDLE hDevCookie; /*!< Dev cookie */ +#endif + +} PVRSRV_DEV_DATA; + +/*! + ****************************************************************************** + * address:value update structure + *****************************************************************************/ +typedef struct _PVRSRV_MEMUPDATE_ +{ + IMG_UINT32 ui32UpdateAddr; /*!< Address */ + IMG_UINT32 ui32UpdateVal; /*!< value */ +} PVRSRV_MEMUPDATE; + +/*! + ****************************************************************************** + * address:value register structure + *****************************************************************************/ +typedef struct _PVRSRV_HWREG_ +{ + IMG_UINT32 ui32RegAddr; /*!< Address */ + IMG_UINT32 ui32RegVal; /*!< value */ +} PVRSRV_HWREG; + +/*! + ****************************************************************************** + * Implementation details for memory handling + *****************************************************************************/ +typedef struct _PVRSRV_MEMBLK_ +{ + IMG_DEV_VIRTADDR sDevVirtAddr; /*!< Address of the memory in the IMG MMUs address space */ + IMG_HANDLE hOSMemHandle; /*!< Stores the underlying memory allocation handle */ + IMG_HANDLE hOSWrapMem; /*!< FIXME: better way to solve this problem */ + IMG_HANDLE hBuffer; /*!< Stores the BM_HANDLE for the underlying memory management */ + IMG_HANDLE hResItem; /*!< handle to resource item for allocate */ + IMG_SYS_PHYADDR *psIntSysPAddr; + +} PVRSRV_MEMBLK; + +/*! + ****************************************************************************** + * Memory Management (externel interface) + *****************************************************************************/ +typedef struct _PVRSRV_KERNEL_MEM_INFO_ *PPVRSRV_KERNEL_MEM_INFO; + +typedef struct _PVRSRV_CLIENT_MEM_INFO_ +{ + /* CPU Virtual Address */ + IMG_PVOID pvLinAddr; + + /* CPU Virtual Address (for kernel mode) */ + IMG_PVOID pvLinAddrKM; + + /* Device Virtual Address */ + IMG_DEV_VIRTADDR sDevVAddr; + + /* allocation flags */ + IMG_UINT32 ui32Flags; + + /* client allocation flags */ + IMG_UINT32 ui32ClientFlags; + + /* allocation size in bytes */ + IMG_SIZE_T uAllocSize; + + + /* ptr to associated client sync info - NULL if no sync */ + struct _PVRSRV_CLIENT_SYNC_INFO_ *psClientSyncInfo; + +#if defined (SUPPORT_SID_INTERFACE) + /* handle to client mapping data (OS specific) */ + IMG_SID hMappingInfo; + + /* handle to kernel mem info */ + IMG_SID hKernelMemInfo; + + /* resman handle for UM mapping clean-up */ + IMG_SID hResItem; +#else + /* handle to client mapping data (OS specific) */ + IMG_HANDLE hMappingInfo; + + /* handle to kernel mem info */ + IMG_HANDLE hKernelMemInfo; + + /* resman handle for UM mapping clean-up */ + IMG_HANDLE hResItem; +#endif + +#if defined(SUPPORT_MEMINFO_IDS) + #if !defined(USE_CODE) + /* Globally unique "stamp" for allocation (not re-used until wrap) */ + IMG_UINT64 ui64Stamp; + #else /* !defined(USE_CODE) */ + IMG_UINT32 dummy1; + IMG_UINT32 dummy2; + #endif /* !defined(USE_CODE) */ +#endif /* defined(SUPPORT_MEMINFO_IDS) */ + + /* Sub-system ID that allocated the buffer */ + IMG_UINT64 uiSubSystem; + + /* + ptr to next mem info + D3D uses psNext for mid-scene texture reload. + */ + struct _PVRSRV_CLIENT_MEM_INFO_ *psNext; + + /* Device Virtual Addresses for the YUV MM planes */ + IMG_UINT32 planeOffsets[PVRSRV_MAX_NUMBER_OF_MM_BUFFER_PLANES]; +} PVRSRV_CLIENT_MEM_INFO, *PPVRSRV_CLIENT_MEM_INFO; + +/* + Multiple buffer device virtual mapping management +*/ +typedef enum +{ + PVRSRV_MULTI_MANAGE_DEV_MEM_RQST_INVALID = 0, + /* We may not have GPU virtual address */ + PVRSRV_MULTI_MANAGE_DEV_MEM_RQST_MAP = 1, + PVRSRV_MULTI_MANAGE_DEV_MEM_RQST_LOCK_MAP, + PVRSRV_MULTI_MANAGE_DEV_MEM_RQST_SWAP_MAP_FROM_PREV, + /* We have GPU virtual address */ + PVRSRV_MULTI_MANAGE_DEV_MEM_RQST_UNMAP, + PVRSRV_MULTI_MANAGE_DEV_MEM_RQST_UNLOCK_MAP, + PVRSRV_MULTI_MANAGE_DEV_MEM_RQST_SWAP_MAP_TO_NEXT, + PVRSRV_MULTI_MANAGE_DEV_MEM_RQST_LAST = (IMG_UINT32)-1 +} PVRSRV_MULTI_MANAGE_DEV_MEM_RQST_TYPE; + +typedef struct _PVRSRV_MANAGE_DEV_MEM_REQUEST +{ + PVRSRV_MULTI_MANAGE_DEV_MEM_RQST_TYPE eReqType; + IMG_UINT32 ui32FieldSize; /* valid if equal to the size of the structure */ + IMG_HANDLE hKernelMemInfo; + IMG_HANDLE hKernelSyncInfo; + PVRSRV_CLIENT_MEM_INFO *psClientMemInfo; /* Client side reference */ + IMG_UINT32 ui32Hints; + IMG_UINT32 ui32Attribs; + IMG_SIZE_T uSize; + IMG_SIZE_T uAlignment; + IMG_PVOID pvLinAddr; /* CPU Virtual Address */ + IMG_UINT32 ui32CpuMapRefCount; + IMG_DEV_VIRTADDR sDevVAddr; /* Device Virtual Address */ + IMG_UINT32 ui32GpuMapRefCount; + IMG_UINT32 ui32TransferFromToReqSlotIndx; /* Transfer GPU virtual mapping from index */ + IMG_UINT64 uiSubSystem; + PVRSRV_ERROR eError; +}PVRSRV_MANAGE_DEV_MEM_REQUEST; + +typedef PVRSRV_MANAGE_DEV_MEM_REQUEST PVRSRV_MANAGE_DEV_MEM_RESPONSE; + +typedef struct _PVRSRV_MULTI_MANAGE_DEV_MEM_REQUESTS +{ + IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */ + #if defined (SUPPORT_SID_INTERFACE) + IMG_SID hDevCookie; + /* handle to kernel shared memory */ + IMG_SID hKernelMemInfo; + #else + IMG_HANDLE hDevCookie; + /* handle to kernel shared memory*/ + IMG_HANDLE hKernelMemInfo; + #endif + PVRSRV_CLIENT_MEM_INFO *psSharedMemClientMemInfo; /* NULL if direct (not through shared) */ + IMG_UINT32 ui32MaxNumberOfRequests; /* Must be <= PVRSRV_MULTI_MANAGE_DEV_MEM_MAX_DIRECT_SIZE for direct */ + IMG_UINT32 ui32NumberOfValidRequests; /* Must be <= ui32MaxNumberOfRequests */ + IMG_UINT32 ui32CtrlFlags; + IMG_UINT32 ui32StatusFlags; + PVRSRV_MANAGE_DEV_MEM_REQUEST sMemRequests[PVRSRV_MULTI_MANAGE_DEV_MEM_MAX_DIRECT_SIZE]; /* Memory Requests Array */ +}PVRSRV_MULTI_MANAGE_DEV_MEM_REQUESTS; + +/*! + ****************************************************************************** + * Memory Heap Information + *****************************************************************************/ +#define PVRSRV_MAX_CLIENT_HEAPS (32) +typedef struct _PVRSRV_HEAP_INFO_ +{ + IMG_UINT32 ui32HeapID; +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hDevMemHeap; +#else + IMG_HANDLE hDevMemHeap; +#endif + IMG_DEV_VIRTADDR sDevVAddrBase; + IMG_UINT32 ui32HeapByteSize; + IMG_UINT32 ui32Attribs; + IMG_UINT32 ui32XTileStride; +}PVRSRV_HEAP_INFO; + + + + +/* + Event Object information structure +*/ +typedef struct _PVRSRV_EVENTOBJECT_ +{ + /* globally unique name of the event object */ + IMG_CHAR szName[EVENTOBJNAME_MAXLENGTH]; + /* kernel specific handle for the event object */ +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hOSEventKM; +#else + IMG_HANDLE hOSEventKM; +#endif + +} PVRSRV_EVENTOBJECT; + +/* + Cache operation type +*/ +typedef enum +{ + PVRSRV_MISC_INFO_CPUCACHEOP_NONE = 0, + PVRSRV_MISC_INFO_CPUCACHEOP_CLEAN, + PVRSRV_MISC_INFO_CPUCACHEOP_FLUSH +} PVRSRV_MISC_INFO_CPUCACHEOP_TYPE; + +/*! + ****************************************************************************** + * Structure to retrieve misc. information from services + *****************************************************************************/ +typedef struct _PVRSRV_MISC_INFO_ +{ + IMG_UINT32 ui32StateRequest; /*!< requested State Flags */ + IMG_UINT32 ui32StatePresent; /*!< Present/Valid State Flags */ + + /*!< SOC Timer register */ + IMG_VOID *pvSOCTimerRegisterKM; + IMG_VOID *pvSOCTimerRegisterUM; +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hSOCTimerRegisterOSMemHandle; + IMG_SID hSOCTimerRegisterMappingInfo; +#else + IMG_HANDLE hSOCTimerRegisterOSMemHandle; + IMG_HANDLE hSOCTimerRegisterMappingInfo; +#endif + + /*!< SOC Clock Gating registers */ + IMG_VOID *pvSOCClockGateRegs; + IMG_UINT32 ui32SOCClockGateRegsSize; + + /* Memory Stats/DDK version string depending on ui32StateRequest flags */ + IMG_CHAR *pszMemoryStr; + IMG_UINT32 ui32MemoryStrLen; + + /* global event object */ + PVRSRV_EVENTOBJECT sGlobalEventObject;//FIXME: should be private to services +#if defined (SUPPORT_SID_INTERFACE) + IMG_EVENTSID hOSGlobalEvent; +#else + IMG_HANDLE hOSGlobalEvent; +#endif + + /* Note: add misc. items as required */ + IMG_UINT32 aui32DDKVersion[4]; + + /*!< CPU cache flush controls: */ + struct + { + /*!< Defer the CPU cache op to the next HW op to be submitted (else flush now) */ + IMG_BOOL bDeferOp; + + /*!< Type of cache operation to perform */ + PVRSRV_MISC_INFO_CPUCACHEOP_TYPE eCacheOpType; + + /* This union is a bit unsightly. We need it because we'll use the psMemInfo + * directly in the srvclient PVRSRVGetMiscInfo code, and then convert it + * to a kernel meminfo if required. Try to not waste space. + */ +#if !defined (SUPPORT_SID_INTERFACE) + union + { + /*!< Input client meminfo (UM side) */ + PVRSRV_CLIENT_MEM_INFO *psClientMemInfo; + + /*!< Output kernel meminfo (Bridge+KM side) */ + struct _PVRSRV_KERNEL_MEM_INFO_ *psKernelMemInfo; + } u; +#endif + + /*!< Offset in MemInfo to start cache op */ + IMG_VOID *pvBaseVAddr; + + /*!< Length of range to perform cache op */ + IMG_UINT32 ui32Length; + } sCacheOpCtl; + + /*!< Meminfo refcount controls: */ + struct + { + /* This union is a bit unsightly. We need it because we'll use the psMemInfo + * directly in the srvclient PVRSRVGetMiscInfo code, and then convert it + * to a kernel meminfo if required. Try to not waste space. + */ +#if !defined(SUPPORT_SID_INTERFACE) + union + { + /*!< Input client meminfo (UM side) */ + PVRSRV_CLIENT_MEM_INFO *psClientMemInfo; + + /*!< Output kernel meminfo (Bridge+KM side) */ + struct _PVRSRV_KERNEL_MEM_INFO_ *psKernelMemInfo; + } u; +#endif + + /*!< Resulting refcount */ + IMG_UINT32 ui32RefCount; + } sGetRefCountCtl; + + IMG_UINT32 ui32PageSize; +} PVRSRV_MISC_INFO; + +/*! + ****************************************************************************** + * Synchronisation token + *****************************************************************************/ +typedef struct _PVRSRV_SYNC_TOKEN_ +{ + /* This token is supposed to be passed around as an opaque object + - caller should not rely on the internal fields staying the same. + The fields are hidden in sPrivate in order to reinforce this. */ + struct + { +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hKernelSyncInfo; +#else + IMG_HANDLE hKernelSyncInfo; +#endif + IMG_UINT32 ui32ReadOpsPendingSnapshot; + IMG_UINT32 ui32WriteOpsPendingSnapshot; + IMG_UINT32 ui32ReadOps2PendingSnapshot; + } sPrivate; +} PVRSRV_SYNC_TOKEN; + + +/****************************************************************************** + * PVR Client Event handling in Services + *****************************************************************************/ +typedef enum _PVRSRV_CLIENT_EVENT_ +{ + PVRSRV_CLIENT_EVENT_HWTIMEOUT = 0, +} PVRSRV_CLIENT_EVENT; + +typedef IMG_VOID (*PFN_QUEUE_COMMAND_COMPLETE)(IMG_HANDLE hCallbackData); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVClientEvent(IMG_CONST PVRSRV_CLIENT_EVENT eEvent, + PVRSRV_DEV_DATA *psDevData, + IMG_PVOID pvData); + +/****************************************************************************** + * PVR Services API prototypes. + *****************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVConnect(PVRSRV_CONNECTION **ppsConnection, IMG_UINT32 ui32SrvFlags); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVDisconnect(IMG_CONST PVRSRV_CONNECTION *psConnection); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVEnumerateDevices(IMG_CONST PVRSRV_CONNECTION *psConnection, + IMG_UINT32 *puiNumDevices, + PVRSRV_DEVICE_IDENTIFIER *puiDevIDs); +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVAcquireDeviceData(IMG_CONST PVRSRV_CONNECTION *psConnection, + IMG_UINT32 uiDevIndex, + PVRSRV_DEV_DATA *psDevData, + PVRSRV_DEVICE_TYPE eDeviceType); +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVGetMiscInfo (IMG_CONST PVRSRV_CONNECTION *psConnection, PVRSRV_MISC_INFO *psMiscInfo); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVReleaseMiscInfo (IMG_CONST PVRSRV_CONNECTION *psConnection, PVRSRV_MISC_INFO *psMiscInfo); + +IMG_IMPORT +PVRSRV_ERROR PVRSRVPollForValue ( const PVRSRV_CONNECTION *psConnection, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hOSEvent, +#else + IMG_HANDLE hOSEvent, +#endif + volatile IMG_UINT32 *pui32LinMemAddr, + IMG_UINT32 ui32Value, + IMG_UINT32 ui32Mask, + IMG_UINT32 ui32Waitus, + IMG_UINT32 ui32Tries); + +/* memory APIs */ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateDeviceMemContext(IMG_CONST PVRSRV_DEV_DATA *psDevData, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID *phDevMemContext, +#else + IMG_HANDLE *phDevMemContext, +#endif + IMG_UINT32 *pui32SharedHeapCount, + PVRSRV_HEAP_INFO *psHeapInfo); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyDeviceMemContext(IMG_CONST PVRSRV_DEV_DATA *psDevData, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hDevMemContext +#else + IMG_HANDLE hDevMemContext +#endif + ); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDeviceMemHeapInfo(IMG_CONST PVRSRV_DEV_DATA *psDevData, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hDevMemContext, +#else + IMG_HANDLE hDevMemContext, +#endif + IMG_UINT32 *pui32SharedHeapCount, + PVRSRV_HEAP_INFO *psHeapInfo); + +#if defined(PVRSRV_LOG_MEMORY_ALLOCS) + #define PVRSRVAllocDeviceMem_log(psDevData, hDevMemHeap, ui32Attribs, ui32Size, ui32Alignment, ppsMemInfo, logStr) \ + (PVR_TRACE(("PVRSRVAllocDeviceMem(" #psDevData "," #hDevMemHeap "," #ui32Attribs "," #ui32Size "," #ui32Alignment "," #ppsMemInfo ")" \ + ": " logStr " (size = 0x%lx)", ui32Size)), \ + PVRSRVAllocDeviceMem(psDevData, hDevMemHeap, ui32Attribs, ui32Size, ui32Alignment, ppsMemInfo)) +#else + #define PVRSRVAllocDeviceMem_log(psDevData, hDevMemHeap, ui32Attribs, ui32Size, ui32Alignment, ppsMemInfo, logStr) \ + PVRSRVAllocDeviceMem(psDevData, hDevMemHeap, ui32Attribs, ui32Size, ui32Alignment, ppsMemInfo) +#endif + + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVAllocDeviceMem2(IMG_CONST PVRSRV_DEV_DATA *psDevData, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hDevMemHeap, +#else + IMG_HANDLE hDevMemHeap, +#endif + IMG_UINT32 ui32Attribs, + IMG_SIZE_T ui32Size, + IMG_SIZE_T ui32Alignment, + IMG_PVOID pvPrivData, + IMG_UINT32 ui32PrivDataLength, + PVRSRV_CLIENT_MEM_INFO **ppsMemInfo); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVAllocDeviceMem(IMG_CONST PVRSRV_DEV_DATA *psDevData, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hDevMemHeap, +#else + IMG_HANDLE hDevMemHeap, +#endif + IMG_UINT32 ui32Attribs, + IMG_SIZE_T ui32Size, + IMG_SIZE_T ui32Alignment, + PVRSRV_CLIENT_MEM_INFO **ppsMemInfo); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVFreeDeviceMem(IMG_CONST PVRSRV_DEV_DATA *psDevData, + PVRSRV_CLIENT_MEM_INFO *psMemInfo); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVMultiManageDevMem(IMG_CONST PVRSRV_DEV_DATA *psDevData, + IMG_UINT32 ui32ControlFlags, PVRSRV_MULTI_MANAGE_DEV_MEM_REQUESTS * psMultiMemDevRequest, + IMG_UINT32 *ui32StatusFlags, IMG_UINT32 *ui32IndexError); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVManageDevMem(IMG_CONST PVRSRV_DEV_DATA *psDevData, + PVRSRV_MULTI_MANAGE_DEV_MEM_RQST_TYPE eReq, PVRSRV_CLIENT_MEM_INFO *psMemInfo, + IMG_UINT32 *ui32StatusFlags); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVManageDevMemSwapGpuVirtAddr(IMG_CONST PVRSRV_DEV_DATA *psDevData, + PVRSRV_CLIENT_MEM_INFO *psMemInfoSourceArray, PVRSRV_CLIENT_MEM_INFO *psMemInfoTargetArray, + IMG_UINT32 ui32NumBuff, IMG_UINT32 *ui32StatusFlags); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVExportDeviceMem(IMG_CONST PVRSRV_DEV_DATA *psDevData, + PVRSRV_CLIENT_MEM_INFO *psMemInfo, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID *phMemInfo +#else + IMG_HANDLE *phMemInfo +#endif + ); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVReserveDeviceVirtualMem(IMG_CONST PVRSRV_DEV_DATA *psDevData, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hDevMemHeap, +#else + IMG_HANDLE hDevMemHeap, +#endif + IMG_DEV_VIRTADDR *psDevVAddr, + IMG_SIZE_T ui32Size, + IMG_SIZE_T ui32Alignment, + PVRSRV_CLIENT_MEM_INFO **ppsMemInfo); +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVFreeDeviceVirtualMem(IMG_CONST PVRSRV_DEV_DATA *psDevData, + PVRSRV_CLIENT_MEM_INFO *psMemInfo); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceMemory (IMG_CONST PVRSRV_DEV_DATA *psDevData, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hKernelMemInfo, + IMG_SID hDstDevMemHeap, +#else + IMG_HANDLE hKernelMemInfo, + IMG_HANDLE hDstDevMemHeap, +#endif + PVRSRV_CLIENT_MEM_INFO **ppsDstMemInfo); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVUnmapDeviceMemory (IMG_CONST PVRSRV_DEV_DATA *psDevData, + PVRSRV_CLIENT_MEM_INFO *psMemInfo); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVMapExtMemory (IMG_CONST PVRSRV_DEV_DATA *psDevData, + PVRSRV_CLIENT_MEM_INFO *psMemInfo, + IMG_SYS_PHYADDR *psSysPAddr, + IMG_UINT32 ui32Flags); +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVUnmapExtMemory (IMG_CONST PVRSRV_DEV_DATA *psDevData, + PVRSRV_CLIENT_MEM_INFO *psMemInfo, + IMG_UINT32 ui32Flags); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVWrapExtMemory(IMG_CONST PVRSRV_DEV_DATA *psDevData, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hDevMemContext, +#else + IMG_HANDLE hDevMemContext, +#endif + IMG_SIZE_T ui32ByteSize, + IMG_SIZE_T ui32PageOffset, + IMG_BOOL bPhysContig, + IMG_SYS_PHYADDR *psSysPAddr, + IMG_VOID *pvLinAddr, + IMG_UINT32 ui32Flags, + PVRSRV_CLIENT_MEM_INFO **ppsMemInfo); +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVUnwrapExtMemory (IMG_CONST PVRSRV_DEV_DATA *psDevData, + PVRSRV_CLIENT_MEM_INFO *psMemInfo); + +PVRSRV_ERROR PVRSRVChangeDeviceMemoryAttributes(IMG_CONST PVRSRV_DEV_DATA *psDevData, + PVRSRV_CLIENT_MEM_INFO *psClientMemInfo, + IMG_UINT32 ui32Attribs); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceClassMemory (IMG_CONST PVRSRV_DEV_DATA *psDevData, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hDevMemContext, + IMG_SID hDeviceClassBuffer, +#else + IMG_HANDLE hDevMemContext, + IMG_HANDLE hDeviceClassBuffer, +#endif + PVRSRV_CLIENT_MEM_INFO **ppsMemInfo); +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVUnmapDeviceClassMemory (IMG_CONST PVRSRV_DEV_DATA *psDevData, + PVRSRV_CLIENT_MEM_INFO *psMemInfo); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVMapPhysToUserSpace(IMG_CONST PVRSRV_DEV_DATA *psDevData, + IMG_SYS_PHYADDR sSysPhysAddr, + IMG_UINT32 uiSizeInBytes, + IMG_PVOID *ppvUserAddr, + IMG_UINT32 *puiActualSize, + IMG_PVOID *ppvProcess); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVUnmapPhysToUserSpace(IMG_CONST PVRSRV_DEV_DATA *psDevData, + IMG_PVOID pvUserAddr, + IMG_PVOID pvProcess); + +#if defined(LINUX) +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVCloseExportedDeviceMemHanle(const PVRSRV_DEV_DATA *psDevData, + IMG_INT i32Fd); +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVExportDeviceMem2(IMG_CONST PVRSRV_DEV_DATA *psDevData, + PVRSRV_CLIENT_MEM_INFO *psMemInfo, + IMG_INT *iFd); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceMemory2(IMG_CONST PVRSRV_DEV_DATA *psDevData, + IMG_INT iFd, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hDstDevMemHeap, +#else + IMG_HANDLE hDstDevMemHeap, +#endif + PVRSRV_CLIENT_MEM_INFO **ppsDstMemInfo); +#endif /* defined(LINUX) */ + +#if defined(SUPPORT_ION) +PVRSRV_ERROR PVRSRVMapIonHandle(const PVRSRV_DEV_DATA *psDevData, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hDevMemContext, +#else + IMG_HANDLE hDevMemContext, +#endif + IMG_INT32 uiFD, + IMG_UINT32 uiSize, + IMG_UINT32 ui32Attribs, + PVRSRV_CLIENT_MEM_INFO **ppsMemInfo); + +PVRSRV_ERROR PVRSRVUnmapIonHandle(const PVRSRV_DEV_DATA *psDevData, + PVRSRV_CLIENT_MEM_INFO *psMemInfo); +#endif /* defined (SUPPORT_ION) */ + + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVAllocDeviceMemSparse(const PVRSRV_DEV_DATA *psDevData, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hDevMemHeap, +#else + IMG_HANDLE hDevMemHeap, +#endif + IMG_UINT32 ui32Attribs, + IMG_SIZE_T uAlignment, + IMG_UINT32 ui32ChunkSize, + IMG_UINT32 ui32NumVirtChunks, + IMG_UINT32 ui32NumPhysChunks, + IMG_BOOL *pabMapChunk, + PVRSRV_CLIENT_MEM_INFO **ppsMemInfo); + +/****************************************************************************** + * PVR Allocation Synchronisation Functionality... + *****************************************************************************/ + +typedef enum _PVRSRV_SYNCVAL_MODE_ +{ + PVRSRV_SYNCVAL_READ = IMG_TRUE, + PVRSRV_SYNCVAL_WRITE = IMG_FALSE, + +} PVRSRV_SYNCVAL_MODE, *PPVRSRV_SYNCVAL_MODE; + +typedef IMG_UINT32 PVRSRV_SYNCVAL; + +IMG_IMPORT PVRSRV_ERROR PVRSRVWaitForOpsComplete(PPVRSRV_CLIENT_MEM_INFO psMemInfo, + PVRSRV_SYNCVAL_MODE eMode, PVRSRV_SYNCVAL OpRequired); + +IMG_IMPORT PVRSRV_ERROR PVRSRVWaitForAllOpsComplete(PPVRSRV_CLIENT_MEM_INFO psMemInfo, + PVRSRV_SYNCVAL_MODE eMode); + +IMG_IMPORT IMG_BOOL PVRSRVTestOpsComplete(PPVRSRV_CLIENT_MEM_INFO psMemInfo, + PVRSRV_SYNCVAL_MODE eMode, PVRSRV_SYNCVAL OpRequired); + +IMG_IMPORT IMG_BOOL PVRSRVTestAllOpsComplete(PPVRSRV_CLIENT_MEM_INFO psMemInfo, + PVRSRV_SYNCVAL_MODE eMode); + +IMG_IMPORT IMG_BOOL PVRSRVTestOpsNotComplete(PPVRSRV_CLIENT_MEM_INFO psMemInfo, + PVRSRV_SYNCVAL_MODE eMode, PVRSRV_SYNCVAL OpRequired); + +IMG_IMPORT IMG_BOOL PVRSRVTestAllOpsNotComplete(PPVRSRV_CLIENT_MEM_INFO psMemInfo, + PVRSRV_SYNCVAL_MODE eMode); + +IMG_IMPORT PVRSRV_SYNCVAL PVRSRVGetPendingOpSyncVal(PPVRSRV_CLIENT_MEM_INFO psMemInfo, + PVRSRV_SYNCVAL_MODE eMode); + + +/****************************************************************************** + * Common Device Class Enumeration + *****************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVEnumerateDeviceClass(IMG_CONST PVRSRV_CONNECTION *psConnection, + PVRSRV_DEVICE_CLASS DeviceClass, + IMG_UINT32 *pui32DevCount, + IMG_UINT32 *pui32DevID); + +/****************************************************************************** + * Display Device Class API definition + *****************************************************************************/ +IMG_IMPORT +IMG_HANDLE IMG_CALLCONV PVRSRVOpenDCDevice(IMG_CONST PVRSRV_DEV_DATA *psDevData, + IMG_UINT32 ui32DeviceID); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVCloseDCDevice(IMG_CONST PVRSRV_CONNECTION *psConnection, IMG_HANDLE hDevice); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVEnumDCFormats (IMG_HANDLE hDevice, + IMG_UINT32 *pui32Count, + DISPLAY_FORMAT *psFormat); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVEnumDCDims (IMG_HANDLE hDevice, + IMG_UINT32 *pui32Count, + DISPLAY_FORMAT *psFormat, + DISPLAY_DIMS *psDims); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDCSystemBuffer(IMG_HANDLE hDevice, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID *phBuffer +#else + IMG_HANDLE *phBuffer +#endif + ); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDCInfo(IMG_HANDLE hDevice, + DISPLAY_INFO* psDisplayInfo); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateDCSwapChain (IMG_HANDLE hDevice, + IMG_UINT32 ui32Flags, + DISPLAY_SURF_ATTRIBUTES *psDstSurfAttrib, + DISPLAY_SURF_ATTRIBUTES *psSrcSurfAttrib, + IMG_UINT32 ui32BufferCount, + IMG_UINT32 ui32OEMFlags, + IMG_UINT32 *pui32SwapChainID, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID *phSwapChain +#else + IMG_HANDLE *phSwapChain +#endif + ); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyDCSwapChain (IMG_HANDLE hDevice, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hSwapChain +#else + IMG_HANDLE hSwapChain +#endif + ); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVSetDCDstRect (IMG_HANDLE hDevice, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hSwapChain, +#else + IMG_HANDLE hSwapChain, +#endif + IMG_RECT *psDstRect); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVSetDCSrcRect (IMG_HANDLE hDevice, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hSwapChain, +#else + IMG_HANDLE hSwapChain, +#endif + IMG_RECT *psSrcRect); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVSetDCDstColourKey (IMG_HANDLE hDevice, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hSwapChain, +#else + IMG_HANDLE hSwapChain, +#endif + IMG_UINT32 ui32CKColour); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVSetDCSrcColourKey (IMG_HANDLE hDevice, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hSwapChain, +#else + IMG_HANDLE hSwapChain, +#endif + IMG_UINT32 ui32CKColour); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDCBuffers(IMG_HANDLE hDevice, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hSwapChain, + IMG_SID *phBuffer +#else + IMG_HANDLE hSwapChain, + IMG_HANDLE *phBuffer +#endif + ); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDCBuffers2(IMG_HANDLE hDevice, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hSwapChain, + IMG_SID *phBuffer, +#else + IMG_HANDLE hSwapChain, + IMG_HANDLE *phBuffer, +#endif + IMG_SYS_PHYADDR *psPhyAddr); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVSwapToDCBuffer (IMG_HANDLE hDevice, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hBuffer, +#else + IMG_HANDLE hBuffer, +#endif + IMG_UINT32 ui32ClipRectCount, + IMG_RECT *psClipRect, + IMG_UINT32 ui32SwapInterval, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hPrivateTag +#else + IMG_HANDLE hPrivateTag +#endif + ); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVSwapToDCBuffer2 (IMG_HANDLE hDevice, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hBuffer, +#else + IMG_HANDLE hBuffer, +#endif + IMG_UINT32 ui32SwapInterval, + PVRSRV_CLIENT_MEM_INFO **ppsMemInfos, + IMG_UINT32 ui32NumMemInfos, + IMG_PVOID pvPrivData, + IMG_UINT32 ui32PrivDataLength); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVSwapToDCSystem (IMG_HANDLE hDevice, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hSwapChain +#else + IMG_HANDLE hSwapChain +#endif + ); + +/****************************************************************************** + * Buffer Device Class API definition + *****************************************************************************/ +IMG_IMPORT +IMG_HANDLE IMG_CALLCONV PVRSRVOpenBCDevice(IMG_CONST PVRSRV_DEV_DATA *psDevData, + IMG_UINT32 ui32DeviceID); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVCloseBCDevice(IMG_CONST PVRSRV_CONNECTION *psConnection, + IMG_HANDLE hDevice); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVGetBCBufferInfo(IMG_HANDLE hDevice, + BUFFER_INFO *psBuffer); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVGetBCBuffer(IMG_HANDLE hDevice, + IMG_UINT32 ui32BufferIndex, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID *phBuffer +#else + IMG_HANDLE *phBuffer +#endif + ); + + +/****************************************************************************** + * PDUMP Function prototypes... + *****************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpInit(IMG_CONST PVRSRV_CONNECTION *psConnection); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpStartInitPhase(IMG_CONST PVRSRV_CONNECTION *psConnection); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpStopInitPhase(IMG_CONST PVRSRV_CONNECTION *psConnection); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpMemPol(IMG_CONST PVRSRV_CONNECTION *psConnection, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hKernelMemInfo, +#else + PVRSRV_CLIENT_MEM_INFO *psMemInfo, +#endif + IMG_UINT32 ui32Offset, + IMG_UINT32 ui32Value, + IMG_UINT32 ui32Mask, + PDUMP_POLL_OPERATOR eOperator, + IMG_UINT32 ui32Flags); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpSyncPol(IMG_CONST PVRSRV_CONNECTION *psConnection, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hKernelSyncInfo, +#else + PVRSRV_CLIENT_SYNC_INFO *psClientSyncInfo, +#endif + IMG_BOOL bIsRead, + IMG_UINT32 ui32Value, + IMG_UINT32 ui32Mask); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpSyncPol2(IMG_CONST PVRSRV_CONNECTION *psConnection, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hKernelSyncInfo, +#else + PVRSRV_CLIENT_SYNC_INFO *psClientSyncInfo, +#endif + IMG_BOOL bIsRead); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpMem(IMG_CONST PVRSRV_CONNECTION *psConnection, + IMG_PVOID pvAltLinAddr, + PVRSRV_CLIENT_MEM_INFO *psMemInfo, + IMG_UINT32 ui32Offset, + IMG_UINT32 ui32Bytes, + IMG_UINT32 ui32Flags); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpSync(IMG_CONST PVRSRV_CONNECTION *psConnection, + IMG_PVOID pvAltLinAddr, + PVRSRV_CLIENT_SYNC_INFO *psClientSyncInfo, + IMG_UINT32 ui32Offset, + IMG_UINT32 ui32Bytes); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpReg(IMG_CONST PVRSRV_DEV_DATA *psDevData, + IMG_CHAR *pszRegRegion, + IMG_UINT32 ui32RegAddr, + IMG_UINT32 ui32RegValue, + IMG_UINT32 ui32Flags); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpRegPolWithFlags(const PVRSRV_DEV_DATA *psDevData, + IMG_CHAR *pszRegRegion, + IMG_UINT32 ui32RegAddr, + IMG_UINT32 ui32RegValue, + IMG_UINT32 ui32Mask, + IMG_UINT32 ui32Flags); +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpRegPol(const PVRSRV_DEV_DATA *psDevData, + IMG_CHAR *pszRegRegion, + IMG_UINT32 ui32RegAddr, + IMG_UINT32 ui32RegValue, + IMG_UINT32 ui32Mask); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpPDReg(IMG_CONST PVRSRV_CONNECTION *psConnection, + IMG_UINT32 ui32RegAddr, + IMG_UINT32 ui32RegValue); +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpPDDevPAddr(IMG_CONST PVRSRV_CONNECTION *psConnection, + PVRSRV_CLIENT_MEM_INFO *psMemInfo, + IMG_UINT32 ui32Offset, + IMG_DEV_PHYADDR sPDDevPAddr); + +#if !defined(USE_CODE) +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpMemPages(IMG_CONST PVRSRV_DEV_DATA *psDevData, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hKernelMemInfo, +#else + IMG_HANDLE hKernelMemInfo, +#endif + IMG_DEV_PHYADDR *pPages, + IMG_UINT32 ui32NumPages, + IMG_DEV_VIRTADDR sDevVAddr, + IMG_UINT32 ui32Start, + IMG_UINT32 ui32Length, + IMG_UINT32 ui32Flags); +#endif + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpSetFrame(IMG_CONST PVRSRV_CONNECTION *psConnection, + IMG_UINT32 ui32Frame); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpComment(IMG_CONST PVRSRV_CONNECTION *psConnection, + IMG_CONST IMG_CHAR *pszComment, + IMG_BOOL bContinuous); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpCommentf(IMG_CONST PVRSRV_CONNECTION *psConnection, + IMG_BOOL bContinuous, + IMG_CONST IMG_CHAR *pszFormat, ...) +#if !defined(USE_CODE) + IMG_FORMAT_PRINTF(3, 4) +#endif +; + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpCommentWithFlagsf(IMG_CONST PVRSRV_CONNECTION *psConnection, + IMG_UINT32 ui32Flags, + IMG_CONST IMG_CHAR *pszFormat, ...) +#if !defined(USE_CODE) + IMG_FORMAT_PRINTF(3, 4) +#endif +; + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpDriverInfo(IMG_CONST PVRSRV_CONNECTION *psConnection, + IMG_CHAR *pszString, + IMG_BOOL bContinuous); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpIsCapturing(IMG_CONST PVRSRV_CONNECTION *psConnection, + IMG_BOOL *pbIsCapturing); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpBitmap(IMG_CONST PVRSRV_DEV_DATA *psDevData, + IMG_CHAR *pszFileName, + IMG_UINT32 ui32FileOffset, + IMG_UINT32 ui32Width, + IMG_UINT32 ui32Height, + IMG_UINT32 ui32StrideInBytes, + IMG_DEV_VIRTADDR sDevBaseAddr, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hDevMemContext, +#else + IMG_HANDLE hDevMemContext, +#endif + IMG_UINT32 ui32Size, + PDUMP_PIXEL_FORMAT ePixelFormat, + PDUMP_MEM_FORMAT eMemFormat, + IMG_UINT32 ui32PDumpFlags); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpRegRead(IMG_CONST PVRSRV_DEV_DATA *psDevData, + IMG_CONST IMG_CHAR *pszRegRegion, + IMG_CONST IMG_CHAR *pszFileName, + IMG_UINT32 ui32FileOffset, + IMG_UINT32 ui32Address, + IMG_UINT32 ui32Size, + IMG_UINT32 ui32PDumpFlags); + + +IMG_IMPORT +IMG_BOOL IMG_CALLCONV PVRSRVPDumpIsCapturingTest(IMG_CONST PVRSRV_CONNECTION *psConnection); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpCycleCountRegRead(IMG_CONST PVRSRV_DEV_DATA *psDevData, + IMG_UINT32 ui32RegOffset, + IMG_BOOL bLastFrame); + +IMG_IMPORT IMG_HANDLE PVRSRVLoadLibrary(const IMG_CHAR *pszLibraryName); +IMG_IMPORT PVRSRV_ERROR PVRSRVUnloadLibrary(IMG_HANDLE hExtDrv); +IMG_IMPORT PVRSRV_ERROR PVRSRVGetLibFuncAddr(IMG_HANDLE hExtDrv, const IMG_CHAR *pszFunctionName, IMG_VOID **ppvFuncAddr); + +IMG_IMPORT IMG_UINT32 PVRSRVClockus (void); +IMG_IMPORT IMG_VOID PVRSRVWaitus (IMG_UINT32 ui32Timeus); +IMG_IMPORT IMG_VOID PVRSRVReleaseThreadQuanta (void); +IMG_IMPORT IMG_UINT32 IMG_CALLCONV PVRSRVGetCurrentProcessID(void); +IMG_IMPORT IMG_CHAR * IMG_CALLCONV PVRSRVSetLocale(const IMG_CHAR *pszLocale); + + + + + +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVCreateAppHintState(IMG_MODULE_ID eModuleID, + const IMG_CHAR *pszAppName, + IMG_VOID **ppvState); +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVFreeAppHintState(IMG_MODULE_ID eModuleID, + IMG_VOID *pvHintState); + +IMG_IMPORT IMG_BOOL IMG_CALLCONV PVRSRVGetAppHint(IMG_VOID *pvHintState, + const IMG_CHAR *pszHintName, + IMG_DATA_TYPE eDataType, + const IMG_VOID *pvDefault, + IMG_VOID *pvReturn); + +/****************************************************************************** + * Memory API(s) + *****************************************************************************/ + +/* Exported APIs */ +IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVAllocUserModeMem (IMG_SIZE_T ui32Size); +IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVCallocUserModeMem (IMG_SIZE_T ui32Size); +IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVReallocUserModeMem (IMG_PVOID pvBase, IMG_SIZE_T uNewSize); +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVFreeUserModeMem (IMG_PVOID pvMem); +IMG_IMPORT IMG_VOID PVRSRVMemCopy(IMG_VOID *pvDst, const IMG_VOID *pvSrc, IMG_SIZE_T ui32Size); +IMG_IMPORT IMG_VOID PVRSRVMemSet(IMG_VOID *pvDest, IMG_UINT8 ui8Value, IMG_SIZE_T ui32Size); + +struct _PVRSRV_MUTEX_OPAQUE_STRUCT_; +typedef struct _PVRSRV_MUTEX_OPAQUE_STRUCT_ *PVRSRV_MUTEX_HANDLE; + + +#if defined(PVR_DEBUG_MUTEXES) + +IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateMutex(PVRSRV_MUTEX_HANDLE *phMutex, + IMG_CHAR pszMutexName[], + IMG_CHAR pszFilename[], + IMG_INT iLine); +IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyMutex(PVRSRV_MUTEX_HANDLE hMutex, + IMG_CHAR pszMutexName[], + IMG_CHAR pszFilename[], + IMG_INT iLine); +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVLockMutex(PVRSRV_MUTEX_HANDLE hMutex, + IMG_CHAR pszMutexName[], + IMG_CHAR pszFilename[], + IMG_INT iLine); +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVUnlockMutex(PVRSRV_MUTEX_HANDLE hMutex, + IMG_CHAR pszMutexName[], + IMG_CHAR pszFilename[], + IMG_INT iLine); + +#define PVRSRVCreateMutex(phMutex) PVRSRVCreateMutex(phMutex, #phMutex, __FILE__, __LINE__) +#define PVRSRVDestroyMutex(hMutex) PVRSRVDestroyMutex(hMutex, #hMutex, __FILE__, __LINE__) +#define PVRSRVLockMutex(hMutex) PVRSRVLockMutex(hMutex, #hMutex, __FILE__, __LINE__) +#define PVRSRVUnlockMutex(hMutex) PVRSRVUnlockMutex(hMutex, #hMutex, __FILE__, __LINE__) + +#else /* defined(PVR_DEBUG_MUTEXES) */ + +IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateMutex(PVRSRV_MUTEX_HANDLE *phMutex); +IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyMutex(PVRSRV_MUTEX_HANDLE hMutex); +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVLockMutex(PVRSRV_MUTEX_HANDLE hMutex); +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVUnlockMutex(PVRSRV_MUTEX_HANDLE hMutex); + +#endif /* defined(PVR_DEBUG_MUTEXES) */ + + +struct _PVRSRV_RECMUTEX_OPAQUE_STRUCT_; +typedef struct _PVRSRV_RECMUTEX_OPAQUE_STRUCT_ *PVRSRV_RECMUTEX_HANDLE; + + +#if defined(PVR_DEBUG_MUTEXES) + +IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateRecursiveMutex(PVRSRV_RECMUTEX_HANDLE *phMutex, + IMG_CHAR pszMutexName[], + IMG_CHAR pszFilename[], + IMG_INT iLine); +IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyRecursiveMutex(PVRSRV_RECMUTEX_HANDLE hMutex, + IMG_CHAR pszMutexName[], + IMG_CHAR pszFilename[], + IMG_INT iLine); +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVLockRecursiveMutex(PVRSRV_RECMUTEX_HANDLE hMutex, + IMG_CHAR pszMutexName[], + IMG_CHAR pszFilename[], + IMG_INT iLine); +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVUnlockRecursiveMutex(PVRSRV_RECMUTEX_HANDLE hMutex, + IMG_CHAR pszMutexName[], + IMG_CHAR pszFilename[], + IMG_INT iLine); + +#define PVRSRVCreateRecursiveMutex(phMutex) PVRSRVCreateRecursiveMutex(phMutex, #phMutex, __FILE__, __LINE__) +#define PVRSRVDestroyRecursiveMutex(hMutex) PVRSRVDestroyRecursiveMutex(hMutex, #hMutex, __FILE__, __LINE__) +#define PVRSRVLockRecursiveMutex(hMutex) PVRSRVLockRecursiveMutex(hMutex, #hMutex, __FILE__, __LINE__) +#define PVRSRVUnlockRecursiveMutex(hMutex) PVRSRVUnlockRecursiveMutex(hMutex, #hMutex, __FILE__, __LINE__) + +#else /* defined(PVR_DEBUG_MUTEXES) */ + +IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateRecursiveMutex(PVRSRV_RECMUTEX_HANDLE *phMutex); +IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyRecursiveMutex(PVRSRV_RECMUTEX_HANDLE hMutex); +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVLockRecursiveMutex(PVRSRV_RECMUTEX_HANDLE hMutex); +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVUnlockRecursiveMutex(PVRSRV_RECMUTEX_HANDLE hMutex); + +#endif /* defined(PVR_DEBUG_MUTEXES) */ + +/* Non-recursive coarse-grained mutex shared between all threads in a proccess */ +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVLockProcessGlobalMutex(void); +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVUnlockProcessGlobalMutex(void); + + +struct _PVRSRV_SEMAPHORE_OPAQUE_STRUCT_; +typedef struct _PVRSRV_SEMAPHORE_OPAQUE_STRUCT_ *PVRSRV_SEMAPHORE_HANDLE; + + + #define IMG_SEMAPHORE_WAIT_INFINITE ((IMG_UINT64)0xFFFFFFFFFFFFFFFFull) + + +#if !defined(USE_CODE) + +#ifdef INLINE_IS_PRAGMA +#pragma inline(PVRSRVCreateSemaphore) +#endif +static INLINE PVRSRV_ERROR PVRSRVCreateSemaphore(PVRSRV_SEMAPHORE_HANDLE *phSemaphore, IMG_INT iInitialCount) +{ + PVR_UNREFERENCED_PARAMETER(iInitialCount); + *phSemaphore = 0; + return PVRSRV_OK; +} + +#ifdef INLINE_IS_PRAGMA +#pragma inline(PVRSRVDestroySemaphore) +#endif +static INLINE PVRSRV_ERROR PVRSRVDestroySemaphore(PVRSRV_SEMAPHORE_HANDLE hSemaphore) +{ + PVR_UNREFERENCED_PARAMETER(hSemaphore); + return PVRSRV_OK; +} + +#ifdef INLINE_IS_PRAGMA +#pragma inline(PVRSRVWaitSemaphore) +#endif +static INLINE PVRSRV_ERROR PVRSRVWaitSemaphore(PVRSRV_SEMAPHORE_HANDLE hSemaphore, IMG_UINT64 ui64TimeoutMicroSeconds) +{ + PVR_UNREFERENCED_PARAMETER(hSemaphore); + PVR_UNREFERENCED_PARAMETER(ui64TimeoutMicroSeconds); + return PVRSRV_ERROR_INVALID_PARAMS; +} + +#ifdef INLINE_IS_PRAGMA +#pragma inline(PVRSRVPostSemaphore) +#endif +static INLINE IMG_VOID PVRSRVPostSemaphore(PVRSRV_SEMAPHORE_HANDLE hSemaphore, IMG_INT iPostCount) +{ + PVR_UNREFERENCED_PARAMETER(hSemaphore); + PVR_UNREFERENCED_PARAMETER(iPostCount); +} + +#endif /* !defined(USE_CODE) */ + + +/* Non-exported APIs */ +#if defined(DEBUG) && (defined(__linux__) || defined(__QNXNTO__) ) +IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVAllocUserModeMemTracking(IMG_SIZE_T ui32Size, IMG_CHAR *pszFileName, IMG_UINT32 ui32LineNumber); + +IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVCallocUserModeMemTracking(IMG_SIZE_T ui32Size, IMG_CHAR *pszFileName, IMG_UINT32 ui32LineNumber); + +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVFreeUserModeMemTracking(IMG_VOID *pvMem); + +IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVReallocUserModeMemTracking(IMG_VOID *pvMem, IMG_SIZE_T ui32NewSize, + IMG_CHAR *pszFileName, IMG_UINT32 ui32LineNumber); +#endif + +/****************************************************************************** + * PVR Event Object API(s) + *****************************************************************************/ + +IMG_IMPORT PVRSRV_ERROR PVRSRVEventObjectWait(const PVRSRV_CONNECTION *psConnection, +#if defined (SUPPORT_SID_INTERFACE) + IMG_EVENTSID hOSEvent +#else + IMG_HANDLE hOSEvent +#endif + ); + +/*! + ****************************************************************************** + + @Function PVRSRVCreateSyncInfoModObj + + @Description Creates an empty Modification object to be later used by PVRSRVModifyPendingSyncOps + + ******************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateSyncInfoModObj(const PVRSRV_CONNECTION *psConnection, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID *phKernelSyncInfoModObj +#else + IMG_HANDLE *phKernelSyncInfoModObj +#endif + ); + +/*! + ****************************************************************************** + + @Function PVRSRVDestroySyncInfoModObj + + @Description Destroys a Modification object. Must be empty. + + ******************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroySyncInfoModObj(const PVRSRV_CONNECTION *psConnection, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hKernelSyncInfoModObj +#else + IMG_HANDLE hKernelSyncInfoModObj +#endif + ); + + + +/*! + ****************************************************************************** + + @Function PVRSRVModifyPendingSyncOps + + @Description Returns PRE-INCREMENTED sync op values. Performs thread safe increment + of sync ops values as specified by ui32ModifyFlags. + + PVRSRV_ERROR_RETRY is returned if the supplied modification object + is not empty. This is on the assumption that a different thread + will imminently call PVRSRVModifyCompleteSyncOps. This thread should + sleep before retrying. It should be regarded as an error if no such + other thread exists. + + Note that this API has implied locking semantics, as follows: + + PVRSRVModifyPendingSyncOps() + - announces an operation on the buffer is "pending", and + conceptually takes a ticket to represent your place in the queue. + - NB: ** exclusive access to the resource is _NOT_ granted at this time ** + PVRSRVSyncOpsFlushToModObj() + - ensures you have exclusive access to the resource (conceptually, a LOCK) + - the previously "pending" operation can now be regarded as "in progress" + PVRSRVModifyCompleteSyncOps() + - declares that the previously "in progress" operation is now complete. (UNLOCK) + + + ******************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVModifyPendingSyncOps(const PVRSRV_CONNECTION *psConnection, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hKernelSyncInfoModObj, +#else + IMG_HANDLE hKernelSyncInfoModObj, +#endif + PVRSRV_CLIENT_SYNC_INFO *psSyncInfo, + IMG_UINT32 ui32ModifyFlags, + IMG_UINT32 *pui32ReadOpsPending, + IMG_UINT32 *pui32WriteOpsPending); + +/*! + ****************************************************************************** + + @Function PVRSRVModifyCompleteSyncOps + + @Description Performs thread safe increment of sync ops values as specified + by the ui32ModifyFlags that were given to PVRSRVModifyPendingSyncOps. + The supplied Modification Object will become empty. + + Note that this API has implied locking semantics, as + described above in PVRSRVModifyPendingSyncOps + + ******************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVModifyCompleteSyncOps(const PVRSRV_CONNECTION *psConnection, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hKernelSyncInfoModObj +#else + IMG_HANDLE hKernelSyncInfoModObj +#endif + ); + +/*! + ****************************************************************************** + + @Function PVRSRVSyncOpsTakeToken + + @Description Takes a "deli-counter" style token for future use with + PVRSRVSyncOpsFlushToToken(). In practice this means + recording a snapshot of the current "pending" values. A + future PVRSRVSyncOpsFlushToToken() will ensure that all + operations that were pending at the time of this + PVRSRVSyncOpsTakeToken() call will be flushed. + Operations may be subsequently queued after this call + and would not be flushed. The caller is required to + provide storage for the token. The token is disposable + - i.e. the caller can simply let the token go out of + scope without telling us... in particular, there is no + obligation to call PVRSRVSyncOpsFlushToToken(). + Multiple tokens may be taken. There is no implied + locking with this API. + + ******************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVSyncOpsTakeToken(const PVRSRV_CONNECTION *psConnection, +#if defined (SUPPORT_SID_INTERFACE) + const IMG_SID hKernelSyncInfo, +#else + const PVRSRV_CLIENT_SYNC_INFO *psSyncInfo, +#endif + PVRSRV_SYNC_TOKEN *psSyncToken); +/*! + ****************************************************************************** + + @Function PVRSRVSyncOpsFlushToToken + + @Description Tests whether the dependencies for a pending sync op modification + have been satisfied. If this function returns PVRSRV_OK, then the + "complete" counts have caught up with the snapshot of the "pending" + values taken when PVRSRVSyncOpsTakeToken() was called. + In the event that the dependencies are not (yet) met, + this call will auto-retry if bWait is specified, otherwise, it will + return PVRSRV_ERROR_RETRY. (Not really an "error") + + (auto-retry behaviour not implemented) + + ******************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVSyncOpsFlushToToken(const PVRSRV_CONNECTION *psConnection, +#if defined (SUPPORT_SID_INTERFACE) + const IMG_SID hKernelSyncInfo, +#else + const PVRSRV_CLIENT_SYNC_INFO *psSyncInfo, +#endif + const PVRSRV_SYNC_TOKEN *psSyncToken, + IMG_BOOL bWait); +/*! + ****************************************************************************** + + @Function PVRSRVSyncOpsFlushToModObj + + @Description Tests whether the dependencies for a pending sync op modification + have been satisfied. If this function returns PVRSRV_OK, then the + "complete" counts have caught up with the snapshot of the "pending" + values taken when PVRSRVModifyPendingSyncOps() was called. + PVRSRVModifyCompleteSyncOps() can then be called without risk of + stalling. In the event that the dependencies are not (yet) met, + this call will auto-retry if bWait is specified, otherwise, it will + return PVRSRV_ERROR_RETRY. (Not really an "error") + + Note that this API has implied locking semantics, as + described above in PVRSRVModifyPendingSyncOps + + ******************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVSyncOpsFlushToModObj(const PVRSRV_CONNECTION *psConnection, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hKernelSyncInfoModObj, +#else + IMG_HANDLE hKernelSyncInfoModObj, +#endif + IMG_BOOL bWait); + +/*! + ****************************************************************************** + + @Function PVRSRVSyncOpsFlushToDelta + + @Description Compares the number of outstanding operations (pending count minus + complete count) with the limit specified. If no more than ui32Delta + operations are outstanding, this function returns PVRSRV_OK. + In the event that there are too many outstanding operations, + this call will auto-retry if bWait is specified, otherwise, it will + return PVRSRV_ERROR_RETRY. (Not really an "error") + + ******************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVSyncOpsFlushToDelta(const PVRSRV_CONNECTION *psConnection, + PVRSRV_CLIENT_SYNC_INFO *psClientSyncInfo, + IMG_UINT32 ui32Delta, + IMG_BOOL bWait); + +/*! + ****************************************************************************** + + @Function PVRSRVAllocSyncInfo + + @Description Creates a Sync Object. Unlike the sync objects created + automatically with "PVRSRVAllocDeviceMem", the sync objects + returned by this function do _not_ have a UM mapping to the + sync data and they do _not_ have the device virtual address + of the "opscomplete" fields. These data are to be deprecated. + + ******************************************************************************/ + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVAllocSyncInfo(IMG_CONST PVRSRV_DEV_DATA *psDevData, + PVRSRV_CLIENT_SYNC_INFO **ppsSyncInfo); + +/*! + ****************************************************************************** + + @Function PVRSRVFreeSyncInfo + + @Description Destroys a Sync Object created via + PVRSRVAllocSyncInfo. + + ******************************************************************************/ + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVFreeSyncInfo(IMG_CONST PVRSRV_DEV_DATA *psDevData, + PVRSRV_CLIENT_SYNC_INFO *psSyncInfo); + +/*! + ****************************************************************************** + + @Function PVRSRVGetErrorString + + @Description Returns a text string relating to the PVRSRV_ERROR enum. + + ******************************************************************************/ +IMG_IMPORT +const IMG_CHAR *PVRSRVGetErrorString(PVRSRV_ERROR eError); + + +/*! + ****************************************************************************** + + @Function PVRSRVCacheInvalidate + + @Description Invalidate the CPU cache for a specified memory + area. Note that PVRSRVGetMiscInfo provides similar cpu + cache flush/invalidate functionality for some platforms. + + ******************************************************************************/ + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVCacheInvalidate(const PVRSRV_CONNECTION *psConnection, + IMG_PVOID pvLinearAddress, + IMG_UINT32 ui32Size); + +/****************************************************************************** + Time wrapping macro +******************************************************************************/ +#define TIME_NOT_PASSED_UINT32(a,b,c) (((a) - (b)) < (c)) + +#if defined (__cplusplus) +} +#endif +#endif /* __SERVICES_H__ */ + +/****************************************************************************** + End of file (services.h) +******************************************************************************/ diff --git a/jacinto6/sgx_src/eurasia_km/include4/servicesext.h b/jacinto6/sgx_src/eurasia_km/include4/servicesext.h new file mode 100644 index 0000000..80df117 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/include4/servicesext.h @@ -0,0 +1,965 @@ +/*************************************************************************/ /*! +@Title Services definitions required by external drivers +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Provides services data structures, defines and prototypes + required by external drivers. +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#if !defined (__SERVICESEXT_H__) +#define __SERVICESEXT_H__ + +/* + * Lock buffer read/write flags + */ +#define PVRSRV_LOCKFLG_READONLY (1) /*!< The locking process will only read the locked surface */ + +/*! + ***************************************************************************** + * Error values + * + * NOTE: If you change this, make sure you update the error texts in + * services4/include/pvrsrv_errors.h to match. + * + *****************************************************************************/ +typedef enum _PVRSRV_ERROR_ +{ + PVRSRV_OK = 0, + PVRSRV_ERROR_OUT_OF_MEMORY, + PVRSRV_ERROR_TOO_FEW_BUFFERS, + PVRSRV_ERROR_INVALID_PARAMS, + PVRSRV_ERROR_INIT_FAILURE, + PVRSRV_ERROR_CANT_REGISTER_CALLBACK, + PVRSRV_ERROR_INVALID_DEVICE, + PVRSRV_ERROR_NOT_OWNER, + PVRSRV_ERROR_BAD_MAPPING, + PVRSRV_ERROR_TIMEOUT, + PVRSRV_ERROR_FLIP_CHAIN_EXISTS, + PVRSRV_ERROR_INVALID_SWAPINTERVAL, + PVRSRV_ERROR_SCENE_INVALID, + PVRSRV_ERROR_STREAM_ERROR, + PVRSRV_ERROR_FAILED_DEPENDENCIES, + PVRSRV_ERROR_CMD_NOT_PROCESSED, + PVRSRV_ERROR_CMD_TOO_BIG, + PVRSRV_ERROR_DEVICE_REGISTER_FAILED, + PVRSRV_ERROR_TOOMANYBUFFERS, + PVRSRV_ERROR_NOT_SUPPORTED, + PVRSRV_ERROR_PROCESSING_BLOCKED, + + PVRSRV_ERROR_CANNOT_FLUSH_QUEUE, + PVRSRV_ERROR_CANNOT_GET_QUEUE_SPACE, + PVRSRV_ERROR_CANNOT_GET_RENDERDETAILS, + PVRSRV_ERROR_RETRY, + + PVRSRV_ERROR_DDK_VERSION_MISMATCH, + PVRSRV_ERROR_BUILD_MISMATCH, + PVRSRV_ERROR_CORE_REVISION_MISMATCH, + + PVRSRV_ERROR_UPLOAD_TOO_BIG, + + PVRSRV_ERROR_INVALID_FLAGS, + PVRSRV_ERROR_FAILED_TO_REGISTER_PROCESS, + + PVRSRV_ERROR_UNABLE_TO_LOAD_LIBRARY, + PVRSRV_ERROR_UNABLE_GET_FUNC_ADDR, + PVRSRV_ERROR_UNLOAD_LIBRARY_FAILED, + + PVRSRV_ERROR_BRIDGE_CALL_FAILED, + PVRSRV_ERROR_IOCTL_CALL_FAILED, + + PVRSRV_ERROR_MMU_CONTEXT_NOT_FOUND, + PVRSRV_ERROR_BUFFER_DEVICE_NOT_FOUND, + PVRSRV_ERROR_BUFFER_DEVICE_ALREADY_PRESENT, + + PVRSRV_ERROR_PCI_DEVICE_NOT_FOUND, + PVRSRV_ERROR_PCI_CALL_FAILED, + PVRSRV_ERROR_PCI_REGION_TOO_SMALL, + PVRSRV_ERROR_PCI_REGION_UNAVAILABLE, + PVRSRV_ERROR_BAD_REGION_SIZE_MISMATCH, + + PVRSRV_ERROR_REGISTER_BASE_NOT_SET, + + PVRSRV_ERROR_BM_BAD_SHAREMEM_HANDLE, + + PVRSRV_ERROR_FAILED_TO_ALLOC_USER_MEM, + PVRSRV_ERROR_FAILED_TO_ALLOC_VP_MEMORY, + PVRSRV_ERROR_FAILED_TO_MAP_SHARED_PBDESC, + PVRSRV_ERROR_FAILED_TO_GET_PHYS_ADDR, + + PVRSRV_ERROR_FAILED_TO_ALLOC_VIRT_MEMORY, + PVRSRV_ERROR_FAILED_TO_COPY_VIRT_MEMORY, + + PVRSRV_ERROR_FAILED_TO_ALLOC_PAGES, + PVRSRV_ERROR_FAILED_TO_FREE_PAGES, + PVRSRV_ERROR_FAILED_TO_COPY_PAGES, + PVRSRV_ERROR_UNABLE_TO_LOCK_PAGES, + PVRSRV_ERROR_UNABLE_TO_UNLOCK_PAGES, + PVRSRV_ERROR_STILL_MAPPED, + PVRSRV_ERROR_MAPPING_NOT_FOUND, + PVRSRV_ERROR_PHYS_ADDRESS_EXCEEDS_32BIT, + PVRSRV_ERROR_FAILED_TO_MAP_PAGE_TABLE, + + PVRSRV_ERROR_INVALID_SEGMENT_BLOCK, + PVRSRV_ERROR_INVALID_SGXDEVDATA, + PVRSRV_ERROR_INVALID_DEVINFO, + PVRSRV_ERROR_INVALID_MEMINFO, + PVRSRV_ERROR_INVALID_MISCINFO, + PVRSRV_ERROR_UNKNOWN_IOCTL, + PVRSRV_ERROR_INVALID_CONTEXT, + PVRSRV_ERROR_UNABLE_TO_DESTROY_CONTEXT, + PVRSRV_ERROR_INVALID_HEAP, + PVRSRV_ERROR_INVALID_KERNELINFO, + PVRSRV_ERROR_UNKNOWN_POWER_STATE, + PVRSRV_ERROR_INVALID_HANDLE_TYPE, + PVRSRV_ERROR_INVALID_WRAP_TYPE, + PVRSRV_ERROR_INVALID_PHYS_ADDR, + PVRSRV_ERROR_INVALID_CPU_ADDR, + PVRSRV_ERROR_INVALID_HEAPINFO, + PVRSRV_ERROR_INVALID_PERPROC, + PVRSRV_ERROR_FAILED_TO_RETRIEVE_HEAPINFO, + PVRSRV_ERROR_INVALID_MAP_REQUEST, + PVRSRV_ERROR_INVALID_UNMAP_REQUEST, + PVRSRV_ERROR_UNABLE_TO_FIND_MAPPING_HEAP, + PVRSRV_ERROR_MAPPING_STILL_IN_USE, + + PVRSRV_ERROR_EXCEEDED_HW_LIMITS, + PVRSRV_ERROR_NO_STAGING_BUFFER_ALLOCATED, + + PVRSRV_ERROR_UNABLE_TO_CREATE_PERPROC_AREA, + PVRSRV_ERROR_UNABLE_TO_CREATE_EVENT, + PVRSRV_ERROR_UNABLE_TO_ENABLE_EVENT, + PVRSRV_ERROR_UNABLE_TO_REGISTER_EVENT, + PVRSRV_ERROR_UNABLE_TO_DESTROY_EVENT, + PVRSRV_ERROR_UNABLE_TO_CREATE_THREAD, + PVRSRV_ERROR_UNABLE_TO_CLOSE_THREAD, + PVRSRV_ERROR_THREAD_READ_ERROR, + PVRSRV_ERROR_UNABLE_TO_REGISTER_ISR_HANDLER, + PVRSRV_ERROR_UNABLE_TO_INSTALL_ISR, + PVRSRV_ERROR_UNABLE_TO_UNINSTALL_ISR, + PVRSRV_ERROR_ISR_ALREADY_INSTALLED, + PVRSRV_ERROR_ISR_NOT_INSTALLED, + PVRSRV_ERROR_UNABLE_TO_INITIALISE_INTERRUPT, + PVRSRV_ERROR_UNABLE_TO_RETRIEVE_INFO, + PVRSRV_ERROR_UNABLE_TO_DO_BACKWARDS_BLIT, + PVRSRV_ERROR_UNABLE_TO_CLOSE_SERVICES, + PVRSRV_ERROR_UNABLE_TO_REGISTER_CONTEXT, + PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE, + PVRSRV_ERROR_UNABLE_TO_CLOSE_HANDLE, + + PVRSRV_ERROR_INVALID_CCB_COMMAND, + + PVRSRV_ERROR_UNABLE_TO_LOCK_RESOURCE, + PVRSRV_ERROR_INVALID_LOCK_ID, + PVRSRV_ERROR_RESOURCE_NOT_LOCKED, + + PVRSRV_ERROR_FLIP_FAILED, + PVRSRV_ERROR_UNBLANK_DISPLAY_FAILED, + + PVRSRV_ERROR_TIMEOUT_POLLING_FOR_VALUE, + + PVRSRV_ERROR_CREATE_RENDER_CONTEXT_FAILED, + PVRSRV_ERROR_UNKNOWN_PRIMARY_FRAG, + PVRSRV_ERROR_UNEXPECTED_SECONDARY_FRAG, + PVRSRV_ERROR_UNEXPECTED_PRIMARY_FRAG, + + PVRSRV_ERROR_UNABLE_TO_INSERT_FENCE_ID, + + PVRSRV_ERROR_BLIT_SETUP_FAILED, + + PVRSRV_ERROR_PDUMP_NOT_AVAILABLE, + PVRSRV_ERROR_PDUMP_BUFFER_FULL, + PVRSRV_ERROR_PDUMP_BUF_OVERFLOW, + PVRSRV_ERROR_PDUMP_NOT_ACTIVE, + PVRSRV_ERROR_INCOMPLETE_LINE_OVERLAPS_PAGES, + + PVRSRV_ERROR_MUTEX_DESTROY_FAILED, + PVRSRV_ERROR_MUTEX_INTERRUPTIBLE_ERROR, + + PVRSRV_ERROR_INSUFFICIENT_SCRIPT_SPACE, + PVRSRV_ERROR_INSUFFICIENT_SPACE_FOR_COMMAND, + + PVRSRV_ERROR_PROCESS_NOT_INITIALISED, + PVRSRV_ERROR_PROCESS_NOT_FOUND, + PVRSRV_ERROR_SRV_CONNECT_FAILED, + PVRSRV_ERROR_SRV_DISCONNECT_FAILED, + PVRSRV_ERROR_DEINT_PHASE_FAILED, + PVRSRV_ERROR_INIT2_PHASE_FAILED, + + PVRSRV_ERROR_UNABLE_TO_FIND_RESOURCE, + + PVRSRV_ERROR_NO_DC_DEVICES_FOUND, + PVRSRV_ERROR_UNABLE_TO_OPEN_DC_DEVICE, + PVRSRV_ERROR_UNABLE_TO_REMOVE_DEVICE, + PVRSRV_ERROR_NO_DEVICEDATA_FOUND, + PVRSRV_ERROR_NO_DEVICENODE_FOUND, + PVRSRV_ERROR_NO_CLIENTNODE_FOUND, + PVRSRV_ERROR_FAILED_TO_PROCESS_QUEUE, + + PVRSRV_ERROR_UNABLE_TO_INIT_TASK, + PVRSRV_ERROR_UNABLE_TO_SCHEDULE_TASK, + PVRSRV_ERROR_UNABLE_TO_KILL_TASK, + + PVRSRV_ERROR_UNABLE_TO_ENABLE_TIMER, + PVRSRV_ERROR_UNABLE_TO_DISABLE_TIMER, + PVRSRV_ERROR_UNABLE_TO_REMOVE_TIMER, + + PVRSRV_ERROR_UNKNOWN_PIXEL_FORMAT, + PVRSRV_ERROR_UNKNOWN_SCRIPT_OPERATION, + + PVRSRV_ERROR_HANDLE_INDEX_OUT_OF_RANGE, + PVRSRV_ERROR_HANDLE_NOT_ALLOCATED, + PVRSRV_ERROR_HANDLE_TYPE_MISMATCH, + PVRSRV_ERROR_UNABLE_TO_ADD_HANDLE, + PVRSRV_ERROR_HANDLE_NOT_SHAREABLE, + PVRSRV_ERROR_HANDLE_NOT_FOUND, + PVRSRV_ERROR_INVALID_SUBHANDLE, + PVRSRV_ERROR_HANDLE_BATCH_IN_USE, + PVRSRV_ERROR_HANDLE_BATCH_COMMIT_FAILURE, + + PVRSRV_ERROR_UNABLE_TO_CREATE_HASH_TABLE, + PVRSRV_ERROR_INSERT_HASH_TABLE_DATA_FAILED, + + PVRSRV_ERROR_UNSUPPORTED_BACKING_STORE, + PVRSRV_ERROR_UNABLE_TO_DESTROY_BM_HEAP, + + PVRSRV_ERROR_UNKNOWN_INIT_SERVER_STATE, + + PVRSRV_ERROR_NO_FREE_DEVICEIDS_AVALIABLE, + PVRSRV_ERROR_INVALID_DEVICEID, + PVRSRV_ERROR_DEVICEID_NOT_FOUND, + + PVRSRV_ERROR_MEMORY_TEST_FAILED, + PVRSRV_ERROR_CPUPADDR_TEST_FAILED, + PVRSRV_ERROR_COPY_TEST_FAILED, + + PVRSRV_ERROR_SEMAPHORE_NOT_INITIALISED, + + PVRSRV_ERROR_UNABLE_TO_RELEASE_CLOCK, + PVRSRV_ERROR_CLOCK_REQUEST_FAILED, + PVRSRV_ERROR_DISABLE_CLOCK_FAILURE, + PVRSRV_ERROR_UNABLE_TO_SET_CLOCK_RATE, + PVRSRV_ERROR_UNABLE_TO_ROUND_CLOCK_RATE, + PVRSRV_ERROR_UNABLE_TO_ENABLE_CLOCK, + PVRSRV_ERROR_UNABLE_TO_GET_CLOCK, + PVRSRV_ERROR_UNABLE_TO_GET_PARENT_CLOCK, + PVRSRV_ERROR_UNABLE_TO_GET_SYSTEM_CLOCK, + + PVRSRV_ERROR_UNKNOWN_SGL_ERROR, + + PVRSRV_ERROR_SYSTEM_POWER_CHANGE_FAILURE, + PVRSRV_ERROR_DEVICE_POWER_CHANGE_FAILURE, + + PVRSRV_ERROR_BAD_SYNC_STATE, + + PVRSRV_ERROR_CACHEOP_FAILED, + + PVRSRV_ERROR_CACHE_INVALIDATE_FAILED, + + PVRSRV_ERROR_FORCE_I32 = 0x7fffffff + +} PVRSRV_ERROR; + + +/*! + ***************************************************************************** + * List of known device classes. + *****************************************************************************/ +typedef enum _PVRSRV_DEVICE_CLASS_ +{ + PVRSRV_DEVICE_CLASS_3D = 0 , + PVRSRV_DEVICE_CLASS_DISPLAY = 1 , + PVRSRV_DEVICE_CLASS_BUFFER = 2 , + PVRSRV_DEVICE_CLASS_VIDEO = 3 , + + PVRSRV_DEVICE_CLASS_FORCE_I32 = 0x7fffffff + +} PVRSRV_DEVICE_CLASS; + + +/*! + ***************************************************************************** + * States for power management + *****************************************************************************/ +typedef enum _PVRSRV_SYS_POWER_STATE_ +{ + PVRSRV_SYS_POWER_STATE_Unspecified = -1, /*!< Unspecified : Uninitialised */ + PVRSRV_SYS_POWER_STATE_D0 = 0, /*!< On */ + PVRSRV_SYS_POWER_STATE_D1 = 1, /*!< User Idle */ + PVRSRV_SYS_POWER_STATE_D2 = 2, /*!< System Idle / sleep */ + PVRSRV_SYS_POWER_STATE_D3 = 3, /*!< Suspend / Hibernate */ + PVRSRV_SYS_POWER_STATE_D4 = 4, /*!< shutdown */ + + PVRSRV_SYS_POWER_STATE_FORCE_I32 = 0x7fffffff + +} PVRSRV_SYS_POWER_STATE, *PPVRSRV_SYS_POWER_STATE; + + +typedef enum _PVRSRV_DEV_POWER_STATE_ +{ + PVRSRV_DEV_POWER_STATE_DEFAULT = -1, /*!< Default state for the device */ + PVRSRV_DEV_POWER_STATE_ON = 0, /*!< Running */ + PVRSRV_DEV_POWER_STATE_IDLE = 1, /*!< Powered but operation paused */ + PVRSRV_DEV_POWER_STATE_OFF = 2, /*!< Unpowered */ + + PVRSRV_DEV_POWER_STATE_FORCE_I32 = 0x7fffffff + +} PVRSRV_DEV_POWER_STATE, *PPVRSRV_DEV_POWER_STATE; /* PRQA S 3205 */ + + +/* Power transition handler prototypes */ +typedef PVRSRV_ERROR (*PFN_PRE_POWER) (IMG_HANDLE hDevHandle, + PVRSRV_DEV_POWER_STATE eNewPowerState, + PVRSRV_DEV_POWER_STATE eCurrentPowerState); +typedef PVRSRV_ERROR (*PFN_POST_POWER) (IMG_HANDLE hDevHandle, + PVRSRV_DEV_POWER_STATE eNewPowerState, + PVRSRV_DEV_POWER_STATE eCurrentPowerState); + +/* Clock speed handler prototypes */ +typedef PVRSRV_ERROR (*PFN_PRE_CLOCKSPEED_CHANGE) (IMG_HANDLE hDevHandle, + IMG_BOOL bIdleDevice, + PVRSRV_DEV_POWER_STATE eCurrentPowerState); +typedef PVRSRV_ERROR (*PFN_POST_CLOCKSPEED_CHANGE) (IMG_HANDLE hDevHandle, + IMG_BOOL bIdleDevice, + PVRSRV_DEV_POWER_STATE eCurrentPowerState); + + +/***************************************************************************** + * Enumeration of all possible pixel types. Where applicable, Ordering of name + * is in reverse order of memory bytes (i.e. as a word in little endian). + * e.g. A8R8G8B8 is in memory as 4 bytes in order: BB GG RR AA + * + * NOTE: When modifying this structure please update the client driver format + * tables located in %WORKROOT%/eurasia/codegen/pixfmts using the tool + * located in %WORKROOT%/eurasia/tools/intern/TextureFormatParser. + * + *****************************************************************************/ +typedef enum _PVRSRV_PIXEL_FORMAT_ { + /* Basic types */ + PVRSRV_PIXEL_FORMAT_UNKNOWN = 0, + PVRSRV_PIXEL_FORMAT_RGB565 = 1, + PVRSRV_PIXEL_FORMAT_RGB555 = 2, + PVRSRV_PIXEL_FORMAT_RGB888 = 3, /*!< 24bit */ + PVRSRV_PIXEL_FORMAT_BGR888 = 4, /*!< 24bit */ + PVRSRV_PIXEL_FORMAT_GREY_SCALE = 8, + PVRSRV_PIXEL_FORMAT_PAL12 = 13, + PVRSRV_PIXEL_FORMAT_PAL8 = 14, + PVRSRV_PIXEL_FORMAT_PAL4 = 15, + PVRSRV_PIXEL_FORMAT_PAL2 = 16, + PVRSRV_PIXEL_FORMAT_PAL1 = 17, + PVRSRV_PIXEL_FORMAT_ARGB1555 = 18, + PVRSRV_PIXEL_FORMAT_ARGB4444 = 19, + PVRSRV_PIXEL_FORMAT_ARGB8888 = 20, + PVRSRV_PIXEL_FORMAT_ABGR8888 = 21, + PVRSRV_PIXEL_FORMAT_YV12 = 22, + PVRSRV_PIXEL_FORMAT_I420 = 23, + PVRSRV_PIXEL_FORMAT_IMC2 = 25, + PVRSRV_PIXEL_FORMAT_XRGB8888 = 26, + PVRSRV_PIXEL_FORMAT_XBGR8888 = 27, + PVRSRV_PIXEL_FORMAT_BGRA8888 = 28, + PVRSRV_PIXEL_FORMAT_XRGB4444 = 29, + PVRSRV_PIXEL_FORMAT_ARGB8332 = 30, + PVRSRV_PIXEL_FORMAT_A2RGB10 = 31, /*!< 32bpp, 10 bits for R, G, B, 2 bits for A */ + PVRSRV_PIXEL_FORMAT_A2BGR10 = 32, /*!< 32bpp, 10 bits for B, G, R, 2 bits for A */ + PVRSRV_PIXEL_FORMAT_P8 = 33, + PVRSRV_PIXEL_FORMAT_L8 = 34, + PVRSRV_PIXEL_FORMAT_A8L8 = 35, + PVRSRV_PIXEL_FORMAT_A4L4 = 36, + PVRSRV_PIXEL_FORMAT_L16 = 37, + PVRSRV_PIXEL_FORMAT_L6V5U5 = 38, + PVRSRV_PIXEL_FORMAT_V8U8 = 39, + PVRSRV_PIXEL_FORMAT_V16U16 = 40, + PVRSRV_PIXEL_FORMAT_QWVU8888 = 41, + PVRSRV_PIXEL_FORMAT_XLVU8888 = 42, + PVRSRV_PIXEL_FORMAT_QWVU16 = 43, + PVRSRV_PIXEL_FORMAT_D16 = 44, + PVRSRV_PIXEL_FORMAT_D24S8 = 45, + PVRSRV_PIXEL_FORMAT_D24X8 = 46, + + /* Added to ensure TQ build */ + PVRSRV_PIXEL_FORMAT_ABGR16 = 47, + PVRSRV_PIXEL_FORMAT_ABGR16F = 48, + PVRSRV_PIXEL_FORMAT_ABGR32 = 49, + PVRSRV_PIXEL_FORMAT_ABGR32F = 50, + PVRSRV_PIXEL_FORMAT_B10GR11 = 51, + PVRSRV_PIXEL_FORMAT_GR88 = 52, + PVRSRV_PIXEL_FORMAT_BGR32 = 53, + PVRSRV_PIXEL_FORMAT_GR32 = 54, + PVRSRV_PIXEL_FORMAT_E5BGR9 = 55, + + /* reserved types */ + PVRSRV_PIXEL_FORMAT_RESERVED1 = 56, + PVRSRV_PIXEL_FORMAT_RESERVED2 = 57, + PVRSRV_PIXEL_FORMAT_RESERVED3 = 58, + PVRSRV_PIXEL_FORMAT_RESERVED4 = 59, + PVRSRV_PIXEL_FORMAT_RESERVED5 = 60, + + /* RGB space packed formats */ + PVRSRV_PIXEL_FORMAT_R8G8_B8G8 = 61, + PVRSRV_PIXEL_FORMAT_G8R8_G8B8 = 62, + + /* YUV space planar formats */ + PVRSRV_PIXEL_FORMAT_NV11 = 63, + PVRSRV_PIXEL_FORMAT_NV12 = 64, + + /* YUV space packed formats */ + PVRSRV_PIXEL_FORMAT_YUY2 = 65, + PVRSRV_PIXEL_FORMAT_YUV420 = 66, + PVRSRV_PIXEL_FORMAT_YUV444 = 67, + PVRSRV_PIXEL_FORMAT_VUY444 = 68, + PVRSRV_PIXEL_FORMAT_YUYV = 69, + PVRSRV_PIXEL_FORMAT_YVYU = 70, + PVRSRV_PIXEL_FORMAT_UYVY = 71, + PVRSRV_PIXEL_FORMAT_VYUY = 72, + + PVRSRV_PIXEL_FORMAT_FOURCC_ORG_UYVY = 73, /*!< See http://www.fourcc.org/yuv.php#UYVY */ + PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YUYV = 74, /*!< See http://www.fourcc.org/yuv.php#YUYV */ + PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YVYU = 75, /*!< See http://www.fourcc.org/yuv.php#YVYU */ + PVRSRV_PIXEL_FORMAT_FOURCC_ORG_VYUY = 76, /*!< No fourcc.org link */ + PVRSRV_PIXEL_FORMAT_FOURCC_ORG_AYUV = 77, /*!< See http://www.fourcc.org/yuv.php#AYUV */ + + /* 4 component, 32 bits per component types */ + PVRSRV_PIXEL_FORMAT_A32B32G32R32 = 78, /*!< type unspecified */ + PVRSRV_PIXEL_FORMAT_A32B32G32R32F = 79, /*!< float type */ + PVRSRV_PIXEL_FORMAT_A32B32G32R32_UINT = 80, /*!< uint type */ + PVRSRV_PIXEL_FORMAT_A32B32G32R32_SINT = 81, /*!< sint type */ + + /* 3 component, 32 bits per component types */ + PVRSRV_PIXEL_FORMAT_B32G32R32 = 82, /*!< type unspecified */ + PVRSRV_PIXEL_FORMAT_B32G32R32F = 83, /*!< float data */ + PVRSRV_PIXEL_FORMAT_B32G32R32_UINT = 84, /*!< uint data */ + PVRSRV_PIXEL_FORMAT_B32G32R32_SINT = 85, /*!< signed int data */ + + /* 2 component, 32 bits per component types */ + PVRSRV_PIXEL_FORMAT_G32R32 = 86, /*!< type unspecified */ + PVRSRV_PIXEL_FORMAT_G32R32F = 87, /*!< float */ + PVRSRV_PIXEL_FORMAT_G32R32_UINT = 88, /*!< uint */ + PVRSRV_PIXEL_FORMAT_G32R32_SINT = 89, /*!< signed int */ + + /* 1 component, 32 bits per component types */ + PVRSRV_PIXEL_FORMAT_D32F = 90, /*!< float depth */ + PVRSRV_PIXEL_FORMAT_R32 = 91, /*!< type unspecified */ + PVRSRV_PIXEL_FORMAT_R32F = 92, /*!< float type */ + PVRSRV_PIXEL_FORMAT_R32_UINT = 93, /*!< unsigned int type */ + PVRSRV_PIXEL_FORMAT_R32_SINT = 94, /*!< signed int type */ + + /* 4 component, 16 bits per component types */ + PVRSRV_PIXEL_FORMAT_A16B16G16R16 = 95, /*!< type unspecified */ + PVRSRV_PIXEL_FORMAT_A16B16G16R16F = 96, /*!< type float */ + PVRSRV_PIXEL_FORMAT_A16B16G16R16_SINT = 97, /*!< signed ints */ + PVRSRV_PIXEL_FORMAT_A16B16G16R16_SNORM = 98, /*!< signed normalised int */ + PVRSRV_PIXEL_FORMAT_A16B16G16R16_UINT = 99, /*!< unsigned ints */ + PVRSRV_PIXEL_FORMAT_A16B16G16R16_UNORM = 100, /*!< normalised unsigned int */ + + /* 2 component, 16 bits per component types */ + PVRSRV_PIXEL_FORMAT_G16R16 = 101, /*!< unspecified type */ + PVRSRV_PIXEL_FORMAT_G16R16F = 102, /*!< float type */ + PVRSRV_PIXEL_FORMAT_G16R16_UINT = 103, /*!< unsigned int type */ + PVRSRV_PIXEL_FORMAT_G16R16_UNORM = 104, /*!< unsigned normalised */ + PVRSRV_PIXEL_FORMAT_G16R16_SINT = 105, /*!< signed int */ + PVRSRV_PIXEL_FORMAT_G16R16_SNORM = 106, /*!< signed normalised */ + + /* 1 component, 16 bits per component types */ + PVRSRV_PIXEL_FORMAT_R16 = 107, /*!< type unspecified */ + PVRSRV_PIXEL_FORMAT_R16F = 108, /*!< float type */ + PVRSRV_PIXEL_FORMAT_R16_UINT = 109, /*!< unsigned int type */ + PVRSRV_PIXEL_FORMAT_R16_UNORM = 110, /*!< unsigned normalised int type */ + PVRSRV_PIXEL_FORMAT_R16_SINT = 111, /*!< signed int type */ + PVRSRV_PIXEL_FORMAT_R16_SNORM = 112, /*!< signed normalised int type */ + + /* 4 component, 8 bits per component types */ + PVRSRV_PIXEL_FORMAT_X8R8G8B8 = 113, /*!< type unspecified */ + PVRSRV_PIXEL_FORMAT_X8R8G8B8_UNORM = 114, /*!< normalised unsigned int */ + PVRSRV_PIXEL_FORMAT_X8R8G8B8_UNORM_SRGB = 115, /*!< normalised uint with sRGB */ + + PVRSRV_PIXEL_FORMAT_A8R8G8B8 = 116, /*!< type unspecified */ + PVRSRV_PIXEL_FORMAT_A8R8G8B8_UNORM = 117, /*!< normalised unsigned int */ + PVRSRV_PIXEL_FORMAT_A8R8G8B8_UNORM_SRGB = 118, /*!< normalised uint with sRGB */ + + PVRSRV_PIXEL_FORMAT_A8B8G8R8 = 119, /*!< type unspecified */ + PVRSRV_PIXEL_FORMAT_A8B8G8R8_UINT = 120, /*!< unsigned int */ + PVRSRV_PIXEL_FORMAT_A8B8G8R8_UNORM = 121, /*!< normalised unsigned int */ + PVRSRV_PIXEL_FORMAT_A8B8G8R8_UNORM_SRGB = 122, /*!< normalised unsigned int */ + PVRSRV_PIXEL_FORMAT_A8B8G8R8_SINT = 123, /*!< signed int */ + PVRSRV_PIXEL_FORMAT_A8B8G8R8_SNORM = 124, /*!< normalised signed int */ + + /* 2 component, 8 bits per component types */ + PVRSRV_PIXEL_FORMAT_G8R8 = 125, /*!< type unspecified */ + PVRSRV_PIXEL_FORMAT_G8R8_UINT = 126, /*!< unsigned int type */ + PVRSRV_PIXEL_FORMAT_G8R8_UNORM = 127, /*!< unsigned int normalised */ + PVRSRV_PIXEL_FORMAT_G8R8_SINT = 128, /*!< signed int type */ + PVRSRV_PIXEL_FORMAT_G8R8_SNORM = 129, /*!< signed int normalised */ + + /* 1 component, 8 bits per component types */ + PVRSRV_PIXEL_FORMAT_A8 = 130, /*!< type unspecified, alpha channel */ + PVRSRV_PIXEL_FORMAT_R8 = 131, /*!< type unspecified */ + PVRSRV_PIXEL_FORMAT_R8_UINT = 132, /*!< unsigned int */ + PVRSRV_PIXEL_FORMAT_R8_UNORM = 133, /*!< unsigned normalised int */ + PVRSRV_PIXEL_FORMAT_R8_SINT = 134, /*!< signed int */ + PVRSRV_PIXEL_FORMAT_R8_SNORM = 135, /*!< signed normalised int */ + + /* A2RGB10 types */ + PVRSRV_PIXEL_FORMAT_A2B10G10R10 = 136, /*!< Type unspecified */ + PVRSRV_PIXEL_FORMAT_A2B10G10R10_UNORM = 137, /*!< normalised unsigned int */ + PVRSRV_PIXEL_FORMAT_A2B10G10R10_UINT = 138, /*!< unsigned int */ + + /* F11F11F10 types */ + PVRSRV_PIXEL_FORMAT_B10G11R11 = 139, /*!< type unspecified */ + PVRSRV_PIXEL_FORMAT_B10G11R11F = 140, /*!< float type */ + + /* esoteric types */ + PVRSRV_PIXEL_FORMAT_X24G8R32 = 141, /*!< 64 bit, type unspecified (Usually typed to D32S8 style) */ + PVRSRV_PIXEL_FORMAT_G8R24 = 142, /*!< 32 bit, type unspecified (Usually typed to D24S8 style) */ + PVRSRV_PIXEL_FORMAT_X8R24 = 143, + PVRSRV_PIXEL_FORMAT_E5B9G9R9 = 144, /*!< 32 bit, shared exponent (RGBE). */ + PVRSRV_PIXEL_FORMAT_R1 = 145, /*!< 1 bit monochrome */ + + PVRSRV_PIXEL_FORMAT_RESERVED6 = 146, + PVRSRV_PIXEL_FORMAT_RESERVED7 = 147, + PVRSRV_PIXEL_FORMAT_RESERVED8 = 148, + PVRSRV_PIXEL_FORMAT_RESERVED9 = 149, + PVRSRV_PIXEL_FORMAT_RESERVED10 = 150, + PVRSRV_PIXEL_FORMAT_RESERVED11 = 151, + PVRSRV_PIXEL_FORMAT_RESERVED12 = 152, + PVRSRV_PIXEL_FORMAT_RESERVED13 = 153, + PVRSRV_PIXEL_FORMAT_RESERVED14 = 154, + PVRSRV_PIXEL_FORMAT_RESERVED15 = 155, + PVRSRV_PIXEL_FORMAT_RESERVED16 = 156, + PVRSRV_PIXEL_FORMAT_RESERVED17 = 157, + PVRSRV_PIXEL_FORMAT_RESERVED18 = 158, + PVRSRV_PIXEL_FORMAT_RESERVED19 = 159, + PVRSRV_PIXEL_FORMAT_RESERVED20 = 160, + + /* DXLegacy vertex types */ + PVRSRV_PIXEL_FORMAT_UBYTE4 = 161, /*!< 4 channels, 1 byte per channel, normalised */ + PVRSRV_PIXEL_FORMAT_SHORT4 = 162, /*!< 4 signed channels, 16 bits each, unnormalised */ + PVRSRV_PIXEL_FORMAT_SHORT4N = 163, /*!< 4 signed channels, 16 bits each, normalised */ + PVRSRV_PIXEL_FORMAT_USHORT4N = 164, /*!< 4 unsigned channels, 16 bits each, normalised */ + PVRSRV_PIXEL_FORMAT_SHORT2N = 165, /*!< 2 signed channels, 16 bits each, normalised */ + PVRSRV_PIXEL_FORMAT_SHORT2 = 166, /*!< 2 signed channels, 16 bits each, unnormalised */ + PVRSRV_PIXEL_FORMAT_USHORT2N = 167, /*!< 2 unsigned channels, 16 bits each, normalised */ + PVRSRV_PIXEL_FORMAT_UDEC3 = 168, /*!< 3 10-bit channels, unnormalised, unsigned*/ + PVRSRV_PIXEL_FORMAT_DEC3N = 169, /*!< 3 10-bit channels, signed normalised */ + PVRSRV_PIXEL_FORMAT_F16_2 = 170, /*!< 2 F16 channels */ + PVRSRV_PIXEL_FORMAT_F16_4 = 171, /*!< 4 F16 channels */ + + /* misc float types */ + PVRSRV_PIXEL_FORMAT_L_F16 = 172, + PVRSRV_PIXEL_FORMAT_L_F16_REP = 173, + PVRSRV_PIXEL_FORMAT_L_F16_A_F16 = 174, + PVRSRV_PIXEL_FORMAT_A_F16 = 175, + PVRSRV_PIXEL_FORMAT_B16G16R16F = 176, + + PVRSRV_PIXEL_FORMAT_L_F32 = 177, + PVRSRV_PIXEL_FORMAT_A_F32 = 178, + PVRSRV_PIXEL_FORMAT_L_F32_A_F32 = 179, + + /* powervr types */ + PVRSRV_PIXEL_FORMAT_PVRTC2 = 180, + PVRSRV_PIXEL_FORMAT_PVRTC4 = 181, + PVRSRV_PIXEL_FORMAT_PVRTCII2 = 182, + PVRSRV_PIXEL_FORMAT_PVRTCII4 = 183, + PVRSRV_PIXEL_FORMAT_PVRTCIII = 184, + PVRSRV_PIXEL_FORMAT_PVRO8 = 185, + PVRSRV_PIXEL_FORMAT_PVRO88 = 186, + PVRSRV_PIXEL_FORMAT_PT1 = 187, + PVRSRV_PIXEL_FORMAT_PT2 = 188, + PVRSRV_PIXEL_FORMAT_PT4 = 189, + PVRSRV_PIXEL_FORMAT_PT8 = 190, + PVRSRV_PIXEL_FORMAT_PTW = 191, + PVRSRV_PIXEL_FORMAT_PTB = 192, + PVRSRV_PIXEL_FORMAT_MONO8 = 193, + PVRSRV_PIXEL_FORMAT_MONO16 = 194, + + /* additional YUV types */ + PVRSRV_PIXEL_FORMAT_C0_YUYV = 195, + PVRSRV_PIXEL_FORMAT_C0_UYVY = 196, + PVRSRV_PIXEL_FORMAT_C0_YVYU = 197, + PVRSRV_PIXEL_FORMAT_C0_VYUY = 198, + PVRSRV_PIXEL_FORMAT_C1_YUYV = 199, + PVRSRV_PIXEL_FORMAT_C1_UYVY = 200, + PVRSRV_PIXEL_FORMAT_C1_YVYU = 201, + PVRSRV_PIXEL_FORMAT_C1_VYUY = 202, + + /* planar YUV types */ + PVRSRV_PIXEL_FORMAT_C0_YUV420_2P_UV = 203, + PVRSRV_PIXEL_FORMAT_C0_YUV420_2P_VU = 204, + PVRSRV_PIXEL_FORMAT_C0_YUV420_3P = 205, + PVRSRV_PIXEL_FORMAT_C1_YUV420_2P_UV = 206, + PVRSRV_PIXEL_FORMAT_C1_YUV420_2P_VU = 207, + PVRSRV_PIXEL_FORMAT_C1_YUV420_3P = 208, + + PVRSRV_PIXEL_FORMAT_A2B10G10R10F = 209, + PVRSRV_PIXEL_FORMAT_B8G8R8_SINT = 210, + PVRSRV_PIXEL_FORMAT_PVRF32SIGNMASK = 211, + + PVRSRV_PIXEL_FORMAT_ABGR4444 = 212, + PVRSRV_PIXEL_FORMAT_ABGR1555 = 213, + PVRSRV_PIXEL_FORMAT_BGR565 = 214, + + /* 4k aligned planar YUV */ + PVRSRV_PIXEL_FORMAT_C0_4KYUV420_2P_UV = 215, + PVRSRV_PIXEL_FORMAT_C0_4KYUV420_2P_VU = 216, + PVRSRV_PIXEL_FORMAT_C1_4KYUV420_2P_UV = 217, + PVRSRV_PIXEL_FORMAT_C1_4KYUV420_2P_VU = 218, + PVRSRV_PIXEL_FORMAT_P208 = 219, + PVRSRV_PIXEL_FORMAT_A8P8 = 220, + + PVRSRV_PIXEL_FORMAT_A4 = 221, + PVRSRV_PIXEL_FORMAT_AYUV8888 = 222, + PVRSRV_PIXEL_FORMAT_RAW256 = 223, + PVRSRV_PIXEL_FORMAT_RAW512 = 224, + PVRSRV_PIXEL_FORMAT_RAW1024 = 225, + + PVRSRV_PIXEL_FORMAT_FORCE_I32 = 0x7fffffff + +} PVRSRV_PIXEL_FORMAT; + +/*! + ***************************************************************************** + * Enumeration of possible alpha types. + *****************************************************************************/ +typedef enum _PVRSRV_ALPHA_FORMAT_ { + PVRSRV_ALPHA_FORMAT_UNKNOWN = 0x00000000, + PVRSRV_ALPHA_FORMAT_PRE = 0x00000001, + PVRSRV_ALPHA_FORMAT_NONPRE = 0x00000002, + PVRSRV_ALPHA_FORMAT_MASK = 0x0000000F, +} PVRSRV_ALPHA_FORMAT; + +/*! + ***************************************************************************** + * Enumeration of possible alpha types. + *****************************************************************************/ +typedef enum _PVRSRV_COLOURSPACE_FORMAT_ { + PVRSRV_COLOURSPACE_FORMAT_UNKNOWN = 0x00000000, + PVRSRV_COLOURSPACE_FORMAT_LINEAR = 0x00010000, + PVRSRV_COLOURSPACE_FORMAT_NONLINEAR = 0x00020000, + PVRSRV_COLOURSPACE_FORMAT_MASK = 0x000F0000, +} PVRSRV_COLOURSPACE_FORMAT; + + +/* + * Drawable orientation (in degrees clockwise). + * Opposite sense from WSEGL. + */ +typedef enum _PVRSRV_ROTATION_ { + PVRSRV_ROTATE_0 = 0, + PVRSRV_ROTATE_90 = 1, + PVRSRV_ROTATE_180 = 2, + PVRSRV_ROTATE_270 = 3, + PVRSRV_FLIP_Y + +} PVRSRV_ROTATION; + +/*! + * Flags for DisplayClassCreateSwapChain. + */ +#define PVRSRV_CREATE_SWAPCHAIN_SHARED (1<<0) +#define PVRSRV_CREATE_SWAPCHAIN_QUERY (1<<1) +#define PVRSRV_CREATE_SWAPCHAIN_OEMOVERLAY (1<<2) + +/*! + ***************************************************************************** + * Structure providing implementation details for serialisation and + * synchronisation of operations. This is the fundamental unit on which operations + * are synced, and would typically be included in any data structures that require + * serialised accesses etc. e.g. MEM_INFO structures + * + *****************************************************************************/ +/* + Sync Data to be shared/mapped between user/kernel +*/ +typedef struct _PVRSRV_SYNC_DATA_ +{ + /* CPU accessible WriteOp Info */ + IMG_UINT32 ui32WriteOpsPending; + volatile IMG_UINT32 ui32WriteOpsComplete; + + /* CPU accessible ReadOp Info */ + IMG_UINT32 ui32ReadOpsPending; + volatile IMG_UINT32 ui32ReadOpsComplete; + + /* CPU accessible ReadOp2 Info */ + IMG_UINT32 ui32ReadOps2Pending; + volatile IMG_UINT32 ui32ReadOps2Complete; + + /* pdump specific value */ + IMG_UINT32 ui32LastOpDumpVal; + IMG_UINT32 ui32LastReadOpDumpVal; + + /* Last write oprtation on this sync */ + IMG_UINT64 ui64LastWrite; + +} PVRSRV_SYNC_DATA; + +/* + Client Sync Info structure +*/ +typedef struct _PVRSRV_CLIENT_SYNC_INFO_ +{ + /* mapping of the kernel sync data */ + PVRSRV_SYNC_DATA *psSyncData; + + /* Device accessible WriteOp Info */ + IMG_DEV_VIRTADDR sWriteOpsCompleteDevVAddr; + + /* Device accessible ReadOp Info */ + IMG_DEV_VIRTADDR sReadOpsCompleteDevVAddr; + + /* Device accessible ReadOp2 Info */ + IMG_DEV_VIRTADDR sReadOps2CompleteDevVAddr; + + /* handle to client mapping data (OS specific) */ +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hMappingInfo; + + /* handle to kernel sync info */ + IMG_SID hKernelSyncInfo; +#else + IMG_HANDLE hMappingInfo; + + /* handle to kernel sync info */ + IMG_HANDLE hKernelSyncInfo; +#endif + +} PVRSRV_CLIENT_SYNC_INFO, *PPVRSRV_CLIENT_SYNC_INFO; + +/*! + ***************************************************************************** + * Resource locking structure + *****************************************************************************/ +typedef struct PVRSRV_RESOURCE_TAG +{ + volatile IMG_UINT32 ui32Lock; + IMG_UINT32 ui32ID; +}PVRSRV_RESOURCE; +typedef PVRSRV_RESOURCE PVRSRV_RES_HANDLE; + + +/* command complete callback pfn prototype */ +typedef IMG_VOID (*PFN_CMD_COMPLETE) (IMG_HANDLE); +typedef IMG_VOID (**PPFN_CMD_COMPLETE) (IMG_HANDLE); + +/* private command handler prototype */ +typedef IMG_BOOL (*PFN_CMD_PROC) (IMG_HANDLE, IMG_UINT32, IMG_VOID*); +typedef IMG_BOOL (**PPFN_CMD_PROC) (IMG_HANDLE, IMG_UINT32, IMG_VOID*); + + +/* + rectangle structure required by Lock API +*/ +typedef struct _IMG_RECT_ +{ + IMG_INT32 x0; + IMG_INT32 y0; + IMG_INT32 x1; + IMG_INT32 y1; +}IMG_RECT; + +typedef struct _IMG_RECT_16_ +{ + IMG_INT16 x0; + IMG_INT16 y0; + IMG_INT16 x1; + IMG_INT16 y1; +}IMG_RECT_16; + + +/* common pfn between BC/DC */ +typedef PVRSRV_ERROR (*PFN_GET_BUFFER_ADDR)(IMG_HANDLE, + IMG_HANDLE, + IMG_SYS_PHYADDR**, + IMG_SIZE_T*, + IMG_VOID**, + IMG_HANDLE*, + IMG_BOOL*, + IMG_UINT32*); + + +/* + Display dimension structure definition +*/ +typedef struct DISPLAY_DIMS_TAG +{ + IMG_UINT32 ui32ByteStride; + IMG_UINT32 ui32Width; + IMG_UINT32 ui32Height; +} DISPLAY_DIMS; + + +/* + Display format structure definition +*/ +typedef struct DISPLAY_FORMAT_TAG +{ + /* pixel format type */ + PVRSRV_PIXEL_FORMAT pixelformat; +} DISPLAY_FORMAT; + +/* + Display Surface Attributes structure definition +*/ +typedef struct DISPLAY_SURF_ATTRIBUTES_TAG +{ + /* pixel format type */ + PVRSRV_PIXEL_FORMAT pixelformat; + /* dimensions information structure array */ + DISPLAY_DIMS sDims; +} DISPLAY_SURF_ATTRIBUTES; + + +/* + Display Mode information structure definition +*/ +typedef struct DISPLAY_MODE_INFO_TAG +{ + /* pixel format type */ + PVRSRV_PIXEL_FORMAT pixelformat; + /* dimensions information structure array */ + DISPLAY_DIMS sDims; + /* refresh rate of the display */ + IMG_UINT32 ui32RefreshHZ; + /* OEM specific flags */ + IMG_UINT32 ui32OEMFlags; +} DISPLAY_MODE_INFO; + + + +#define MAX_DISPLAY_NAME_SIZE (50) /* arbitrary choice! */ + +/* + Display info structure definition +*/ +typedef struct DISPLAY_INFO_TAG +{ + /* max swapchains supported */ + IMG_UINT32 ui32MaxSwapChains; + /* max buffers in a swapchain */ + IMG_UINT32 ui32MaxSwapChainBuffers; + /* min swap interval supported */ + IMG_UINT32 ui32MinSwapInterval; + /* max swap interval supported */ + IMG_UINT32 ui32MaxSwapInterval; + /* physical dimensions of the display required for DPI calc. */ + IMG_UINT32 ui32PhysicalWidthmm; + IMG_UINT32 ui32PhysicalHeightmm; + /* display name */ + IMG_CHAR szDisplayName[MAX_DISPLAY_NAME_SIZE]; +#if defined(SUPPORT_HW_CURSOR) + /* cursor dimensions */ + IMG_UINT16 ui32CursorWidth; + IMG_UINT16 ui32CursorHeight; +#endif +} DISPLAY_INFO; + +typedef struct ACCESS_INFO_TAG +{ + IMG_UINT32 ui32Size; + IMG_UINT32 ui32FBPhysBaseAddress; + IMG_UINT32 ui32FBMemAvailable; /* size of usable FB memory */ + IMG_UINT32 ui32SysPhysBaseAddress; + IMG_UINT32 ui32SysSize; + IMG_UINT32 ui32DevIRQ; +}ACCESS_INFO; + + + +#if defined(PDUMP_SUSPEND_IS_PER_THREAD) +/** Present only on WinMobile 6.5 */ + +typedef struct { + IMG_UINT32 threadId; + IMG_INT suspendCount; +} PVRSRV_THREAD_SUSPEND_COUNT; + +#define PVRSRV_PDUMP_SUSPEND_Q_NAME "PVRSRVPDumpSuspendMsgQ" +#define PVRSRV_PDUMP_SUSPEND_Q_LENGTH 8 + +#endif /* defined(PDUMP_SUSPEND_IS_PER_THREAD) */ + + +/*! + ***************************************************************************** + * This structure is used for OS independent registry (profile) access + *****************************************************************************/ +typedef struct _PVRSRV_REGISTRY_INFO_ +{ + IMG_UINT32 ui32DevCookie; + IMG_PCHAR pszKey; + IMG_PCHAR pszValue; + IMG_PCHAR pszBuf; + IMG_UINT32 ui32BufSize; +} PVRSRV_REGISTRY_INFO, *PPVRSRV_REGISTRY_INFO; + + +PVRSRV_ERROR IMG_CALLCONV PVRSRVReadRegistryString (PPVRSRV_REGISTRY_INFO psRegInfo); +PVRSRV_ERROR IMG_CALLCONV PVRSRVWriteRegistryString (PPVRSRV_REGISTRY_INFO psRegInfo); + + +#define PVRSRV_BC_FLAGS_YUVCSC_CONFORMANT_RANGE (0 << 0) +#define PVRSRV_BC_FLAGS_YUVCSC_FULL_RANGE (1 << 0) + +#define PVRSRV_BC_FLAGS_YUVCSC_BT601 (0 << 1) +#define PVRSRV_BC_FLAGS_YUVCSC_BT709 (1 << 1) + +#define MAX_BUFFER_DEVICE_NAME_SIZE (50) /* arbitrary choice! */ + +/* buffer information structure */ +typedef struct BUFFER_INFO_TAG +{ + IMG_UINT32 ui32BufferCount; + IMG_UINT32 ui32BufferDeviceID; + PVRSRV_PIXEL_FORMAT pixelformat; + IMG_UINT32 ui32ByteStride; + IMG_UINT32 ui32Width; + IMG_UINT32 ui32Height; + IMG_UINT32 ui32Flags; + IMG_CHAR szDeviceName[MAX_BUFFER_DEVICE_NAME_SIZE]; +} BUFFER_INFO; + +typedef enum _OVERLAY_DEINTERLACE_MODE_ +{ + WEAVE=0x0, + BOB_ODD, + BOB_EVEN, + BOB_EVEN_NONINTERLEAVED +} OVERLAY_DEINTERLACE_MODE; + +#endif /* __SERVICESEXT_H__ */ +/***************************************************************************** + End of file (servicesext.h) +*****************************************************************************/ diff --git a/jacinto6/sgx_src/eurasia_km/include4/sgx_options.h b/jacinto6/sgx_src/eurasia_km/include4/sgx_options.h new file mode 100644 index 0000000..b64cd39 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/include4/sgx_options.h @@ -0,0 +1,258 @@ +/*************************************************************************/ /*! +@Title +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +/* Each build option listed here is packed into a dword which + * provides up to 32 flags (or up to 28 flags plus a numeric + * value in the range 0-15 which corresponds to the number of + * cores minus one if SGX_FEATURE_MP is defined). The corresponding + * bit is set if the build option was enabled at compile time. + * + * In order to extract the enabled build flags the INTERNAL_TEST + * switch should be enabled in a client program which includes this + * header. Then the client can test specific build flags by reading + * the bit value at ##OPTIONNAME##_SET_OFFSET in SGX_BUILD_OPTIONS. + * + * IMPORTANT: add new options to unused bits or define a new dword + * (e.g. SGX_BUILD_OPTIONS2) so that the bitfield remains backwards + * compatible. + */ + + +#if defined(DEBUG) || defined (INTERNAL_TEST) +#define DEBUG_SET_OFFSET OPTIONS_BIT0 +#define OPTIONS_BIT0 0x1U +#else +#define OPTIONS_BIT0 0x0 +#endif /* DEBUG */ + +#if defined(PDUMP) || defined (INTERNAL_TEST) +#define PDUMP_SET_OFFSET OPTIONS_BIT1 +#define OPTIONS_BIT1 (0x1U << 1) +#else +#define OPTIONS_BIT1 0x0 +#endif /* PDUMP */ + +#if defined(PVRSRV_USSE_EDM_STATUS_DEBUG) || defined (INTERNAL_TEST) +#define PVRSRV_USSE_EDM_STATUS_DEBUG_SET_OFFSET OPTIONS_BIT2 +#define OPTIONS_BIT2 (0x1U << 2) +#else +#define OPTIONS_BIT2 0x0 +#endif /* PVRSRV_USSE_EDM_STATUS_DEBUG */ + +#if defined(SUPPORT_HW_RECOVERY) || defined (INTERNAL_TEST) +#define SUPPORT_HW_RECOVERY_SET_OFFSET OPTIONS_BIT3 +#define OPTIONS_BIT3 (0x1U << 3) +#else +#define OPTIONS_BIT3 0x0 +#endif /* SUPPORT_HW_RECOVERY */ + + + +#if defined (SUPPORT_SID_INTERFACE) +#define PVR_SECURE_HANDLES_SET_OFFSET OPTIONS_BIT4 +#define OPTIONS_BIT4 (0x1U << 4) +#else +#if defined(PVR_SECURE_HANDLES) || defined (INTERNAL_TEST) +#define PVR_SECURE_HANDLES_SET_OFFSET OPTIONS_BIT4 +#define OPTIONS_BIT4 (0x1U << 4) +#else +#define OPTIONS_BIT4 0x0 +#endif /* PVR_SECURE_HANDLES */ +#endif + +#if defined(SGX_BYPASS_SYSTEM_CACHE) || defined (INTERNAL_TEST) +#define SGX_BYPASS_SYSTEM_CACHE_SET_OFFSET OPTIONS_BIT5 +#define OPTIONS_BIT5 (0x1U << 5) +#else +#define OPTIONS_BIT5 0x0 +#endif /* SGX_BYPASS_SYSTEM_CACHE */ + +#if defined(SGX_DMS_AGE_ENABLE) || defined (INTERNAL_TEST) +#define SGX_DMS_AGE_ENABLE_SET_OFFSET OPTIONS_BIT6 +#define OPTIONS_BIT6 (0x1U << 6) +#else +#define OPTIONS_BIT6 0x0 +#endif /* SGX_DMS_AGE_ENABLE */ + +#if defined(SGX_FAST_DPM_INIT) || defined (INTERNAL_TEST) +#define SGX_FAST_DPM_INIT_SET_OFFSET OPTIONS_BIT8 +#define OPTIONS_BIT8 (0x1U << 8) +#else +#define OPTIONS_BIT8 0x0 +#endif /* SGX_FAST_DPM_INIT */ + +#if defined(SGX_FEATURE_WRITEBACK_DCU) || defined (INTERNAL_TEST) +#define SGX_FEATURE_DCU_SET_OFFSET OPTIONS_BIT9 +#define OPTIONS_BIT9 (0x1U << 9) +#else +#define OPTIONS_BIT9 0x0 +#endif /* SGX_FEATURE_WRITEBACK_DCU */ + +#if defined(SGX_FEATURE_MP) || defined (INTERNAL_TEST) +#define SGX_FEATURE_MP_SET_OFFSET OPTIONS_BIT10 +#define OPTIONS_BIT10 (0x1U << 10) +#else +#define OPTIONS_BIT10 0x0 +#endif /* SGX_FEATURE_MP */ + +#define OPTIONS_BIT11 0x0 + +#define OPTIONS_BIT12 0x0 + + +#if defined(SGX_FEATURE_SYSTEM_CACHE) || defined (INTERNAL_TEST) +#define SGX_FEATURE_SYSTEM_CACHE_SET_OFFSET OPTIONS_BIT13 +#define OPTIONS_BIT13 (0x1U << 13) +#else +#define OPTIONS_BIT13 0x0 +#endif /* SGX_FEATURE_SYSTEM_CACHE */ + +#if defined(SGX_SUPPORT_HWPROFILING) || defined (INTERNAL_TEST) +#define SGX_SUPPORT_HWPROFILING_SET_OFFSET OPTIONS_BIT14 +#define OPTIONS_BIT14 (0x1U << 14) +#else +#define OPTIONS_BIT14 0x0 +#endif /* SGX_SUPPORT_HWPROFILING */ + + + +#if defined(SUPPORT_ACTIVE_POWER_MANAGEMENT) || defined (INTERNAL_TEST) +#define SUPPORT_ACTIVE_POWER_MANAGEMENT_SET_OFFSET OPTIONS_BIT15 +#define OPTIONS_BIT15 (0x1U << 15) +#else +#define OPTIONS_BIT15 0x0 +#endif /* SUPPORT_ACTIVE_POWER_MANAGEMENT */ + +#if defined(SUPPORT_DISPLAYCONTROLLER_TILING) || defined (INTERNAL_TEST) +#define SUPPORT_DISPLAYCONTROLLER_TILING_SET_OFFSET OPTIONS_BIT16 +#define OPTIONS_BIT16 (0x1U << 16) +#else +#define OPTIONS_BIT16 0x0 +#endif /* SUPPORT_DISPLAYCONTROLLER_TILING */ + +#if defined(SUPPORT_PERCONTEXT_PB) || defined (INTERNAL_TEST) +#define SUPPORT_PERCONTEXT_PB_SET_OFFSET OPTIONS_BIT17 +#define OPTIONS_BIT17 (0x1U << 17) +#else +#define OPTIONS_BIT17 0x0 +#endif /* SUPPORT_PERCONTEXT_PB */ + +#if defined(SUPPORT_SGX_HWPERF) || defined (INTERNAL_TEST) +#define SUPPORT_SGX_HWPERF_SET_OFFSET OPTIONS_BIT18 +#define OPTIONS_BIT18 (0x1U << 18) +#else +#define OPTIONS_BIT18 0x0 +#endif /* SUPPORT_SGX_HWPERF */ + + + +#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE) || defined (INTERNAL_TEST) +#define SUPPORT_SGX_MMU_DUMMY_PAGE_SET_OFFSET OPTIONS_BIT19 +#define OPTIONS_BIT19 (0x1U << 19) +#else +#define OPTIONS_BIT19 0x0 +#endif /* SUPPORT_SGX_MMU_DUMMY_PAGE */ + +#if defined(SUPPORT_SGX_PRIORITY_SCHEDULING) || defined (INTERNAL_TEST) +#define SUPPORT_SGX_PRIORITY_SCHEDULING_SET_OFFSET OPTIONS_BIT20 +#define OPTIONS_BIT20 (0x1U << 20) +#else +#define OPTIONS_BIT20 0x0 +#endif /* SUPPORT_SGX_PRIORITY_SCHEDULING */ + +#if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) || defined (INTERNAL_TEST) +#define SUPPORT_SGX_LOW_LATENCY_SCHEDULING_SET_OFFSET OPTIONS_BIT21 +#define OPTIONS_BIT21 (0x1U << 21) +#else +#define OPTIONS_BIT21 0x0 +#endif /* SUPPORT_SGX_LOW_LATENCY_SCHEDULING */ + +#if defined(USE_SUPPORT_NO_TA3D_OVERLAP) || defined (INTERNAL_TEST) +#define USE_SUPPORT_NO_TA3D_OVERLAP_SET_OFFSET OPTIONS_BIT22 +#define OPTIONS_BIT22 (0x1U << 22) +#else +#define OPTIONS_BIT22 0x0 +#endif /* USE_SUPPORT_NO_TA3D_OVERLAP */ + +#if defined(SGX_FEATURE_MP) || defined (INTERNAL_TEST) +#if defined(SGX_FEATURE_MP_CORE_COUNT) +#define OPTIONS_HIGHBYTE ((SGX_FEATURE_MP_CORE_COUNT-1) << SGX_FEATURE_MP_CORE_COUNT_SET_OFFSET) +#define SGX_FEATURE_MP_CORE_COUNT_SET_OFFSET 28UL +#define SGX_FEATURE_MP_CORE_COUNT_SET_MASK 0xFF +#else +#define OPTIONS_HIGHBYTE (((SGX_FEATURE_MP_CORE_COUNT_TA-1) << SGX_FEATURE_MP_CORE_COUNT_SET_OFFSET) |\ + ((SGX_FEATURE_MP_CORE_COUNT_3D-1) << SGX_FEATURE_MP_CORE_COUNT_SET_OFFSET_3D)) +#define SGX_FEATURE_MP_CORE_COUNT_SET_OFFSET 24UL +#define SGX_FEATURE_MP_CORE_COUNT_SET_OFFSET_3D 28UL +#define SGX_FEATURE_MP_CORE_COUNT_SET_MASK 0xFF +#endif +#else /* SGX_FEATURE_MP */ +#define OPTIONS_HIGHBYTE 0x0 +#endif /* SGX_FEATURE_MP */ + + + +#define SGX_BUILD_OPTIONS \ + OPTIONS_BIT0 |\ + OPTIONS_BIT1 |\ + OPTIONS_BIT2 |\ + OPTIONS_BIT3 |\ + OPTIONS_BIT4 |\ + OPTIONS_BIT5 |\ + OPTIONS_BIT6 |\ + OPTIONS_BIT8 |\ + OPTIONS_BIT9 |\ + OPTIONS_BIT10 |\ + OPTIONS_BIT11 |\ + OPTIONS_BIT12 |\ + OPTIONS_BIT13 |\ + OPTIONS_BIT14 |\ + OPTIONS_BIT15 |\ + OPTIONS_BIT16 |\ + OPTIONS_BIT17 |\ + OPTIONS_BIT18 |\ + OPTIONS_BIT19 |\ + OPTIONS_BIT20 |\ + OPTIONS_BIT21 |\ + OPTIONS_BIT22 |\ + OPTIONS_HIGHBYTE + diff --git a/jacinto6/sgx_src/eurasia_km/include4/sgxapi_km.h b/jacinto6/sgx_src/eurasia_km/include4/sgxapi_km.h new file mode 100644 index 0000000..bb8776a --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/include4/sgxapi_km.h @@ -0,0 +1,524 @@ +/*************************************************************************/ /*! +@Title SGX KM API Header +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Exported SGX API details +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef __SGXAPI_KM_H__ +#define __SGXAPI_KM_H__ + +#if defined (__cplusplus) +extern "C" { +#endif + +#include "sgxdefs.h" + +#if (defined(__linux__) || defined(__QNXNTO__)) && !defined(USE_CODE) + #if defined(__KERNEL__) + #include + #else + #include + #endif +#endif + +/****************************************************************************** + Some defines... +******************************************************************************/ + +/* SGX Heap IDs, note: not all heaps are available to clients */ +#define SGX_UNDEFINED_HEAP_ID (~0LU) +#define SGX_GENERAL_HEAP_ID 0 +#define SGX_TADATA_HEAP_ID 1 +#define SGX_KERNEL_CODE_HEAP_ID 2 +#define SGX_KERNEL_DATA_HEAP_ID 3 +#define SGX_PIXELSHADER_HEAP_ID 4 +#define SGX_VERTEXSHADER_HEAP_ID 5 +#define SGX_PDSPIXEL_CODEDATA_HEAP_ID 6 +#define SGX_PDSVERTEX_CODEDATA_HEAP_ID 7 +#define SGX_SYNCINFO_HEAP_ID 8 +#define SGX_SHARED_3DPARAMETERS_HEAP_ID 9 +#define SGX_PERCONTEXT_3DPARAMETERS_HEAP_ID 10 +#if defined(SUPPORT_SGX_GENERAL_MAPPING_HEAP) +#define SGX_GENERAL_MAPPING_HEAP_ID 11 +#endif +#if defined(SGX_FEATURE_2D_HARDWARE) +#define SGX_2D_HEAP_ID 12 +#endif +#if defined(SUPPORT_MEMORY_TILING) +#define SGX_VPB_TILED_HEAP_ID 14 +#endif +#if defined(SUPPORT_ION) +#define SGX_ION_HEAP_ID 15 +#endif + +#define SGX_MAX_HEAP_ID 16 + +/* + * Keep SGX_3DPARAMETERS_HEAP_ID as TQ full custom + * shaders need it to select which heap to write + * their ISP controll stream to. + */ +#if (defined(SUPPORT_PERCONTEXT_PB) || defined(SUPPORT_HYBRID_PB)) +#define SGX_3DPARAMETERS_HEAP_ID SGX_PERCONTEXT_3DPARAMETERS_HEAP_ID +#else +#define SGX_3DPARAMETERS_HEAP_ID SGX_SHARED_3DPARAMETERS_HEAP_ID +#endif +/* Define for number of bytes between consecutive code base registers */ +#if defined(SGX543) || defined(SGX544) || defined(SGX554) +#define SGX_USE_CODE_SEGMENT_RANGE_BITS 23 +#else +#define SGX_USE_CODE_SEGMENT_RANGE_BITS 19 +#endif + +#define SGX_MAX_TA_STATUS_VALS 32 +#define SGX_MAX_3D_STATUS_VALS 4 + +#if defined(SUPPORT_SGX_GENERALISED_SYNCOBJECTS) +/* sync info structure array size */ +#define SGX_MAX_TA_DST_SYNCS 1 +#define SGX_MAX_TA_SRC_SYNCS 1 +#define SGX_MAX_3D_SRC_SYNCS 4 +/* note: there is implicitly 1 3D Dst Sync */ +#else +/* sync info structure array size */ +#define SGX_MAX_SRC_SYNCS_TA 32 +#define SGX_MAX_DST_SYNCS_TA 1 +/* note: there is implicitly 1 3D Dst Sync */ +#define SGX_MAX_SRC_SYNCS_TQ 8 +#define SGX_MAX_DST_SYNCS_TQ 1 +#endif + + +#if defined(SGX_FEATURE_EXTENDED_PERF_COUNTERS) +#define PVRSRV_SGX_HWPERF_NUM_COUNTERS 8 +#define PVRSRV_SGX_HWPERF_NUM_MISC_COUNTERS 11 +#else +#define PVRSRV_SGX_HWPERF_NUM_COUNTERS 9 +#define PVRSRV_SGX_HWPERF_NUM_MISC_COUNTERS 8 +#endif /* SGX543 */ + +#define PVRSRV_SGX_HWPERF_INVALID 0x1 + +#define PVRSRV_SGX_HWPERF_TRANSFER 0x2 +#define PVRSRV_SGX_HWPERF_TA 0x3 +#define PVRSRV_SGX_HWPERF_3D 0x4 +#define PVRSRV_SGX_HWPERF_2D 0x5 +#define PVRSRV_SGX_HWPERF_POWER 0x6 +#define PVRSRV_SGX_HWPERF_PERIODIC 0x7 +#define PVRSRV_SGX_HWPERF_3DSPM 0x8 + +#define PVRSRV_SGX_HWPERF_MK_EVENT 0x101 +#define PVRSRV_SGX_HWPERF_MK_TA 0x102 +#define PVRSRV_SGX_HWPERF_MK_3D 0x103 +#define PVRSRV_SGX_HWPERF_MK_2D 0x104 +#define PVRSRV_SGX_HWPERF_MK_TRANSFER_DUMMY 0x105 +#define PVRSRV_SGX_HWPERF_MK_TA_DUMMY 0x106 +#define PVRSRV_SGX_HWPERF_MK_3D_DUMMY 0x107 +#define PVRSRV_SGX_HWPERF_MK_2D_DUMMY 0x108 +#define PVRSRV_SGX_HWPERF_MK_TA_LOCKUP 0x109 +#define PVRSRV_SGX_HWPERF_MK_3D_LOCKUP 0x10A +#define PVRSRV_SGX_HWPERF_MK_2D_LOCKUP 0x10B + +#define PVRSRV_SGX_HWPERF_TYPE_STARTEND_BIT 28 +#define PVRSRV_SGX_HWPERF_TYPE_OP_MASK ((1UL << PVRSRV_SGX_HWPERF_TYPE_STARTEND_BIT) - 1) +#define PVRSRV_SGX_HWPERF_TYPE_OP_START (0UL << PVRSRV_SGX_HWPERF_TYPE_STARTEND_BIT) +#define PVRSRV_SGX_HWPERF_TYPE_OP_END (1Ul << PVRSRV_SGX_HWPERF_TYPE_STARTEND_BIT) + +#define PVRSRV_SGX_HWPERF_TYPE_TRANSFER_START (PVRSRV_SGX_HWPERF_TRANSFER | PVRSRV_SGX_HWPERF_TYPE_OP_START) +#define PVRSRV_SGX_HWPERF_TYPE_TRANSFER_END (PVRSRV_SGX_HWPERF_TRANSFER | PVRSRV_SGX_HWPERF_TYPE_OP_END) +#define PVRSRV_SGX_HWPERF_TYPE_TA_START (PVRSRV_SGX_HWPERF_TA | PVRSRV_SGX_HWPERF_TYPE_OP_START) +#define PVRSRV_SGX_HWPERF_TYPE_TA_END (PVRSRV_SGX_HWPERF_TA | PVRSRV_SGX_HWPERF_TYPE_OP_END) +#define PVRSRV_SGX_HWPERF_TYPE_3D_START (PVRSRV_SGX_HWPERF_3D | PVRSRV_SGX_HWPERF_TYPE_OP_START) +#define PVRSRV_SGX_HWPERF_TYPE_3D_END (PVRSRV_SGX_HWPERF_3D | PVRSRV_SGX_HWPERF_TYPE_OP_END) +#define PVRSRV_SGX_HWPERF_TYPE_2D_START (PVRSRV_SGX_HWPERF_2D | PVRSRV_SGX_HWPERF_TYPE_OP_START) +#define PVRSRV_SGX_HWPERF_TYPE_2D_END (PVRSRV_SGX_HWPERF_2D | PVRSRV_SGX_HWPERF_TYPE_OP_END) +#define PVRSRV_SGX_HWPERF_TYPE_POWER_START (PVRSRV_SGX_HWPERF_POWER | PVRSRV_SGX_HWPERF_TYPE_OP_START) +#define PVRSRV_SGX_HWPERF_TYPE_POWER_END (PVRSRV_SGX_HWPERF_POWER | PVRSRV_SGX_HWPERF_TYPE_OP_END) +#define PVRSRV_SGX_HWPERF_TYPE_PERIODIC (PVRSRV_SGX_HWPERF_PERIODIC) +#define PVRSRV_SGX_HWPERF_TYPE_3DSPM_START (PVRSRV_SGX_HWPERF_3DSPM | PVRSRV_SGX_HWPERF_TYPE_OP_START) +#define PVRSRV_SGX_HWPERF_TYPE_3DSPM_END (PVRSRV_SGX_HWPERF_3DSPM | PVRSRV_SGX_HWPERF_TYPE_OP_END) +#define PVRSRV_SGX_HWPERF_TYPE_MK_TRANSFER_DUMMY_START (PVRSRV_SGX_HWPERF_MK_TRANSFER_DUMMY | PVRSRV_SGX_HWPERF_TYPE_OP_START) +#define PVRSRV_SGX_HWPERF_TYPE_MK_TRANSFER_DUMMY_END (PVRSRV_SGX_HWPERF_MK_TRANSFER_DUMMY | PVRSRV_SGX_HWPERF_TYPE_OP_END) +#define PVRSRV_SGX_HWPERF_TYPE_MK_TA_DUMMY_START (PVRSRV_SGX_HWPERF_MK_TA_DUMMY | PVRSRV_SGX_HWPERF_TYPE_OP_START) +#define PVRSRV_SGX_HWPERF_TYPE_MK_TA_DUMMY_END (PVRSRV_SGX_HWPERF_MK_TA_DUMMY | PVRSRV_SGX_HWPERF_TYPE_OP_END) +#define PVRSRV_SGX_HWPERF_TYPE_MK_3D_DUMMY_START (PVRSRV_SGX_HWPERF_MK_3D_DUMMY | PVRSRV_SGX_HWPERF_TYPE_OP_START) +#define PVRSRV_SGX_HWPERF_TYPE_MK_3D_DUMMY_END (PVRSRV_SGX_HWPERF_MK_3D_DUMMY | PVRSRV_SGX_HWPERF_TYPE_OP_END) +#define PVRSRV_SGX_HWPERF_TYPE_MK_2D_DUMMY_START (PVRSRV_SGX_HWPERF_MK_2D_DUMMY | PVRSRV_SGX_HWPERF_TYPE_OP_START) +#define PVRSRV_SGX_HWPERF_TYPE_MK_2D_DUMMY_END (PVRSRV_SGX_HWPERF_MK_2D_DUMMY | PVRSRV_SGX_HWPERF_TYPE_OP_END) +#define PVRSRV_SGX_HWPERF_TYPE_MK_TA_LOCKUP (PVRSRV_SGX_HWPERF_MK_TA_LOCKUP) +#define PVRSRV_SGX_HWPERF_TYPE_MK_3D_LOCKUP (PVRSRV_SGX_HWPERF_MK_3D_LOCKUP) +#define PVRSRV_SGX_HWPERF_TYPE_MK_2D_LOCKUP (PVRSRV_SGX_HWPERF_MK_2D_LOCKUP) + +#define PVRSRV_SGX_HWPERF_TYPE_MK_EVENT_START (PVRSRV_SGX_HWPERF_MK_EVENT | PVRSRV_SGX_HWPERF_TYPE_OP_START) +#define PVRSRV_SGX_HWPERF_TYPE_MK_EVENT_END (PVRSRV_SGX_HWPERF_MK_EVENT | PVRSRV_SGX_HWPERF_TYPE_OP_END) +#define PVRSRV_SGX_HWPERF_TYPE_MK_TA_START (PVRSRV_SGX_HWPERF_MK_TA | PVRSRV_SGX_HWPERF_TYPE_OP_START) +#define PVRSRV_SGX_HWPERF_TYPE_MK_TA_END (PVRSRV_SGX_HWPERF_MK_TA | PVRSRV_SGX_HWPERF_TYPE_OP_END) +#define PVRSRV_SGX_HWPERF_TYPE_MK_3D_START (PVRSRV_SGX_HWPERF_MK_3D | PVRSRV_SGX_HWPERF_TYPE_OP_START) +#define PVRSRV_SGX_HWPERF_TYPE_MK_3D_END (PVRSRV_SGX_HWPERF_MK_3D | PVRSRV_SGX_HWPERF_TYPE_OP_END) +#define PVRSRV_SGX_HWPERF_TYPE_MK_2D_START (PVRSRV_SGX_HWPERF_MK_2D | PVRSRV_SGX_HWPERF_TYPE_OP_START) +#define PVRSRV_SGX_HWPERF_TYPE_MK_2D_END (PVRSRV_SGX_HWPERF_MK_2D | PVRSRV_SGX_HWPERF_TYPE_OP_END) + +#define PVRSRV_SGX_HWPERF_STATUS_OFF (0x0) +#define PVRSRV_SGX_HWPERF_STATUS_RESET_COUNTERS (1UL << 0) +#define PVRSRV_SGX_HWPERF_STATUS_GRAPHICS_ON (1UL << 1) +#define PVRSRV_SGX_HWPERF_STATUS_PERIODIC_ON (1UL << 2) +#define PVRSRV_SGX_HWPERF_STATUS_MK_EXECUTION_ON (1UL << 3) + + +/*! + ***************************************************************************** + * One entry in the HWPerf Circular Buffer. + *****************************************************************************/ +typedef struct _PVRSRV_SGX_HWPERF_CB_ENTRY_ +{ + IMG_UINT32 ui32FrameNo; + IMG_UINT32 ui32PID; + IMG_UINT32 ui32RTData; + IMG_UINT32 ui32Type; + IMG_UINT32 ui32Ordinal; + IMG_UINT32 ui32Info; + IMG_UINT32 ui32Clocksx16; + /* NOTE: There should always be at least as many 3D cores as TA cores. */ + IMG_UINT32 ui32Counters[SGX_FEATURE_MP_CORE_COUNT_3D][PVRSRV_SGX_HWPERF_NUM_COUNTERS]; + IMG_UINT32 ui32MiscCounters[SGX_FEATURE_MP_CORE_COUNT_3D][PVRSRV_SGX_HWPERF_NUM_MISC_COUNTERS]; +} PVRSRV_SGX_HWPERF_CB_ENTRY; + + +/* + Status values control structure +*/ +typedef struct _CTL_STATUS_ +{ + IMG_DEV_VIRTADDR sStatusDevAddr; + IMG_UINT32 ui32StatusValue; +} CTL_STATUS; + + +/*! + List of possible requests/commands to SGXGetMiscInfo() +*/ +typedef enum _SGX_MISC_INFO_REQUEST_ +{ + SGX_MISC_INFO_REQUEST_CLOCKSPEED = 0, + SGX_MISC_INFO_REQUEST_SGXREV, + SGX_MISC_INFO_REQUEST_DRIVER_SGXREV, +#if defined(SUPPORT_SGX_EDM_MEMORY_DEBUG) + SGX_MISC_INFO_REQUEST_MEMREAD, + SGX_MISC_INFO_REQUEST_MEMCOPY, +#endif /* SUPPORT_SGX_EDM_MEMORY_DEBUG */ + SGX_MISC_INFO_REQUEST_SET_HWPERF_STATUS, +#if defined(SGX_FEATURE_DATA_BREAKPOINTS) + SGX_MISC_INFO_REQUEST_SET_BREAKPOINT, + SGX_MISC_INFO_REQUEST_POLL_BREAKPOINT, + SGX_MISC_INFO_REQUEST_RESUME_BREAKPOINT, +#endif /* SGX_FEATURE_DATA_BREAKPOINTS */ + SGX_MISC_INFO_DUMP_DEBUG_INFO, + SGX_MISC_INFO_DUMP_DEBUG_INFO_FORCE_REGS, + SGX_MISC_INFO_PANIC, + SGX_MISC_INFO_REQUEST_SPM, + SGX_MISC_INFO_REQUEST_ACTIVEPOWER, + SGX_MISC_INFO_REQUEST_LOCKUPS, + SGX_MISC_INFO_REQUEST_FORCE_I16 = 0x7fff +} SGX_MISC_INFO_REQUEST; + + +/****************************************************************************** + * Struct for passing SGX core rev/features from ukernel to driver. + * This is accessed from the kernel part of the driver and microkernel; it is + * only accessed in user space during buffer allocation in srvinit. + ******************************************************************************/ +typedef struct _PVRSRV_SGX_MISCINFO_FEATURES +{ + IMG_UINT32 ui32CoreRev; /*!< SGX Core revision from HW register */ + IMG_UINT32 ui32CoreID; /*!< SGX Core ID from HW register */ + IMG_UINT32 ui32DDKVersion; /*!< software DDK version */ + IMG_UINT32 ui32DDKBuild; /*!< software DDK build no. */ + IMG_UINT32 ui32CoreIdSW; /*!< software core version (ID), e.g. SGX535, SGX540 */ + IMG_UINT32 ui32CoreRevSW; /*!< software core revision */ + IMG_UINT32 ui32BuildOptions; /*!< build options bit-field */ +#if defined(SUPPORT_SGX_EDM_MEMORY_DEBUG) + IMG_UINT32 ui32DeviceMemValue; /*!< device mem value read from ukernel */ +#endif +#if defined(PVRSRV_USSE_EDM_STATUS_DEBUG) + IMG_DEV_VIRTADDR sDevVAEDMStatusBuffer; /*!< DevVAddr of the EDM status buffer */ + IMG_PVOID pvEDMStatusBuffer; /*!< CPUVAddr of the EDM status buffer */ +#endif +} PVRSRV_SGX_MISCINFO_FEATURES; + + +/****************************************************************************** + * Struct for getting lock-up stats from the kernel driver + ******************************************************************************/ +typedef struct _PVRSRV_SGX_MISCINFO_LOCKUPS +{ + IMG_UINT32 ui32HostDetectedLockups; /*!< Host timer detected lockups */ + IMG_UINT32 ui32uKernelDetectedLockups; /*!< Microkernel detected lockups */ +} PVRSRV_SGX_MISCINFO_LOCKUPS; + + +/****************************************************************************** + * Struct for getting lock-up stats from the kernel driver + ******************************************************************************/ +typedef struct _PVRSRV_SGX_MISCINFO_ACTIVEPOWER +{ + IMG_UINT32 ui32NumActivePowerEvents; /*!< active power events */ +} PVRSRV_SGX_MISCINFO_ACTIVEPOWER; + + +/****************************************************************************** + * Struct for getting SPM stats fro the kernel driver + ******************************************************************************/ +typedef struct _PVRSRV_SGX_MISCINFO_SPM +{ + IMG_HANDLE hRTDataSet; /*!< render target data set handle returned from SGXAddRenderTarget */ + IMG_UINT32 ui32NumOutOfMemSignals; /*!< Number of Out of Mem Signals */ + IMG_UINT32 ui32NumSPMRenders; /*!< Number of SPM renders */ +} PVRSRV_SGX_MISCINFO_SPM; + + +#if defined(SGX_FEATURE_DATA_BREAKPOINTS) +/*! + ****************************************************************************** + * Structure for SGX break points control + *****************************************************************************/ +typedef struct _SGX_BREAKPOINT_INFO +{ + /* set/clear BP boolean */ + IMG_BOOL bBPEnable; + /* Index of BP to set */ + IMG_UINT32 ui32BPIndex; + /* On which DataMaster(s) should the breakpoint fire? */ + IMG_UINT32 ui32DataMasterMask; + /* DevVAddr of BP to set */ + IMG_DEV_VIRTADDR sBPDevVAddr, sBPDevVAddrEnd; + /* Whether or not the desired breakpoint will be trapped */ + IMG_BOOL bTrapped; + /* Will the requested breakpoint fire for reads? */ + IMG_BOOL bRead; + /* Will the requested breakpoint fire for writes? */ + IMG_BOOL bWrite; + /* Has a breakpoint been trapped? */ + IMG_BOOL bTrappedBP; + /* Extra information recorded about a trapped breakpoint */ + IMG_UINT32 ui32CoreNum; + IMG_DEV_VIRTADDR sTrappedBPDevVAddr; + IMG_UINT32 ui32TrappedBPBurstLength; + IMG_BOOL bTrappedBPRead; + IMG_UINT32 ui32TrappedBPDataMaster; + IMG_UINT32 ui32TrappedBPTag; +} SGX_BREAKPOINT_INFO; +#endif /* SGX_FEATURE_DATA_BREAKPOINTS */ + + +/*! + ****************************************************************************** + * Structure for setting the hardware performance status + *****************************************************************************/ +typedef struct _PVRSRV_SGX_MISCINFO_SET_HWPERF_STATUS +{ + /* See PVRSRV_SGX_HWPERF_STATUS_* */ + IMG_UINT32 ui32NewHWPerfStatus; + + #if defined(SGX_FEATURE_EXTENDED_PERF_COUNTERS) + /* Specifies the HW's active group selectors */ + IMG_UINT32 aui32PerfGroup[PVRSRV_SGX_HWPERF_NUM_COUNTERS]; + /* Specifies the HW's active bit selectors */ + IMG_UINT32 aui32PerfBit[PVRSRV_SGX_HWPERF_NUM_COUNTERS]; + /* Specifies the HW's counter bit selectors */ + IMG_UINT32 ui32PerfCounterBitSelect; + /* Specifies the HW's sum_mux selectors */ + IMG_UINT32 ui32PerfSumMux; + #else + /* Specifies the HW's active group */ + IMG_UINT32 ui32PerfGroup; + #endif /* SGX_FEATURE_EXTENDED_PERF_COUNTERS */ +} PVRSRV_SGX_MISCINFO_SET_HWPERF_STATUS; + + +/*! + ****************************************************************************** + * Structure for misc SGX commands in services + *****************************************************************************/ +typedef struct _SGX_MISC_INFO_ +{ + SGX_MISC_INFO_REQUEST eRequest; /*!< Command request to SGXGetMiscInfo() */ + IMG_UINT32 ui32Padding; +#if defined(SUPPORT_SGX_EDM_MEMORY_DEBUG) + IMG_DEV_VIRTADDR sDevVAddrSrc; /*!< dev virtual addr for mem read */ + IMG_DEV_VIRTADDR sDevVAddrDest; /*!< dev virtual addr for mem write */ + IMG_HANDLE hDevMemContext; /*!< device memory context for mem debug */ +#endif + union + { + IMG_UINT32 reserved; /*!< Unused: ensures valid code in the case everything else is compiled out */ + PVRSRV_SGX_MISCINFO_FEATURES sSGXFeatures; + IMG_UINT32 ui32SGXClockSpeed; + PVRSRV_SGX_MISCINFO_ACTIVEPOWER sActivePower; + PVRSRV_SGX_MISCINFO_LOCKUPS sLockups; + PVRSRV_SGX_MISCINFO_SPM sSPM; +#if defined(SGX_FEATURE_DATA_BREAKPOINTS) + SGX_BREAKPOINT_INFO sSGXBreakpointInfo; +#endif + PVRSRV_SGX_MISCINFO_SET_HWPERF_STATUS sSetHWPerfStatus; + } uData; +} SGX_MISC_INFO; + +#if defined(SGX_FEATURE_2D_HARDWARE) +/* + * The largest number of source sync objects that can be associated with a blit + * command. Allows for src, pattern, and mask + */ +#define PVRSRV_MAX_BLT_SRC_SYNCS 3 +#endif + + +#define SGX_KICKTA_DUMPBITMAP_MAX_NAME_LENGTH 256 + +/* + Structure for dumping bitmaps +*/ +typedef struct _SGX_KICKTA_DUMPBITMAP_ +{ + IMG_DEV_VIRTADDR sDevBaseAddr; + IMG_UINT32 ui32Flags; + IMG_UINT32 ui32Width; + IMG_UINT32 ui32Height; + IMG_UINT32 ui32Stride; + IMG_UINT32 ui32PDUMPFormat; + IMG_UINT32 ui32BytesPP; + IMG_CHAR pszName[SGX_KICKTA_DUMPBITMAP_MAX_NAME_LENGTH]; +} SGX_KICKTA_DUMPBITMAP, *PSGX_KICKTA_DUMPBITMAP; + +#define PVRSRV_SGX_PDUMP_CONTEXT_MAX_BITMAP_ARRAY_SIZE (16) + +/*! + ****************************************************************************** + * Data required only when dumping parameters + *****************************************************************************/ +typedef struct _PVRSRV_SGX_PDUMP_CONTEXT_ +{ + /* cache control word for micro kernel cache flush/invalidates */ + IMG_UINT32 ui32CacheControl; + +} PVRSRV_SGX_PDUMP_CONTEXT; + + +#if !defined (SUPPORT_SID_INTERFACE) +typedef struct _SGX_KICKTA_DUMP_ROFF_ +{ + IMG_HANDLE hKernelMemInfo; /*< Buffer handle */ + IMG_UINT32 uiAllocIndex; /*< Alloc index for LDDM */ + IMG_UINT32 ui32Offset; /*< Byte offset to value to dump */ + IMG_UINT32 ui32Value; /*< Actual value to dump */ + IMG_PCHAR pszName; /*< Name of buffer */ +} SGX_KICKTA_DUMP_ROFF, *PSGX_KICKTA_DUMP_ROFF; +#endif + +#if defined (SUPPORT_SID_INTERFACE) +typedef struct _SGX_KICKTA_DUMP_BUFFER_KM_ +#else +typedef struct _SGX_KICKTA_DUMP_BUFFER_ +#endif +{ + IMG_UINT32 ui32SpaceUsed; + IMG_UINT32 ui32Start; /*< Byte offset of start to dump */ + IMG_UINT32 ui32End; /*< Byte offset of end of dump (non-inclusive) */ + IMG_UINT32 ui32BufferSize; /*< Size of buffer */ + IMG_UINT32 ui32BackEndLength; /*< Size of back end portion, if End < Start */ + IMG_UINT32 uiAllocIndex; + IMG_HANDLE hKernelMemInfo; /*< MemInfo handle for the circular buffer */ + IMG_PVOID pvLinAddr; +#if defined(SUPPORT_SGX_NEW_STATUS_VALS) + IMG_HANDLE hCtrlKernelMemInfo; /*< MemInfo handle for the control structure of the + circular buffer */ + IMG_DEV_VIRTADDR sCtrlDevVAddr; /*< Device virtual address of the memory in the + control structure to be checked */ +#endif + IMG_PCHAR pszName; /*< Name of buffer */ + +#if defined (__QNXNTO__) + IMG_UINT32 ui32NameLength; /*< Number of characters in buffer name */ +#endif +#if defined (SUPPORT_SID_INTERFACE) +} SGX_KICKTA_DUMP_BUFFER_KM, *PSGX_KICKTA_DUMP_BUFFER_KM; +#else +} SGX_KICKTA_DUMP_BUFFER, *PSGX_KICKTA_DUMP_BUFFER; +#endif + +#if !defined (SUPPORT_SID_INTERFACE) +#ifdef PDUMP +/* + PDUMP version of above kick structure +*/ +typedef struct _SGX_KICKTA_PDUMP_ +{ + // Bitmaps to dump + PSGX_KICKTA_DUMPBITMAP psPDumpBitmapArray; + IMG_UINT32 ui32PDumpBitmapSize; + + // Misc buffers to dump (e.g. TA, PDS etc..) + PSGX_KICKTA_DUMP_BUFFER psBufferArray; + IMG_UINT32 ui32BufferArraySize; + + // Roffs to dump + PSGX_KICKTA_DUMP_ROFF psROffArray; + IMG_UINT32 ui32ROffArraySize; +} SGX_KICKTA_PDUMP, *PSGX_KICKTA_PDUMP; +#endif /* PDUMP */ +#endif /* #if !defined (SUPPORT_SID_INTERFACE) */ + +#if defined(TRANSFER_QUEUE) +#if defined(SGX_FEATURE_2D_HARDWARE) +/* Maximum size of ctrl stream for 2d blit command (in 32 bit words) */ +#define SGX_MAX_2D_BLIT_CMD_SIZE 26 +#define SGX_MAX_2D_SRC_SYNC_OPS 3 +#endif +#define SGX_MAX_TRANSFER_STATUS_VALS 2 +#define SGX_MAX_TRANSFER_SYNC_OPS 5 +#endif + +#if defined (__cplusplus) +} +#endif + +#endif /* __SGXAPI_KM_H__ */ + +/****************************************************************************** + End of file (sgxapi_km.h) +******************************************************************************/ diff --git a/jacinto6/sgx_src/eurasia_km/include4/sgxscript.h b/jacinto6/sgx_src/eurasia_km/include4/sgxscript.h new file mode 100644 index 0000000..46b89d2 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/include4/sgxscript.h @@ -0,0 +1,99 @@ +/*************************************************************************/ /*! +@Title SGX kernel services structues/functions +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description SGX initialisation script definitions. +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ +#ifndef __SGXSCRIPT_H__ +#define __SGXSCRIPT_H__ + +#if defined (__cplusplus) +extern "C" { +#endif + +#define SGX_MAX_INIT_COMMANDS 64 +#define SGX_MAX_DEINIT_COMMANDS 16 + +typedef enum _SGX_INIT_OPERATION +{ + SGX_INIT_OP_ILLEGAL = 0, + SGX_INIT_OP_WRITE_HW_REG, + SGX_INIT_OP_READ_HW_REG, +#if defined(PDUMP) + SGX_INIT_OP_PDUMP_HW_REG, +#endif + SGX_INIT_OP_HALT +} SGX_INIT_OPERATION; + +typedef union _SGX_INIT_COMMAND +{ + SGX_INIT_OPERATION eOp; + struct { + SGX_INIT_OPERATION eOp; + IMG_UINT32 ui32Offset; + IMG_UINT32 ui32Value; + } sWriteHWReg; + struct { + SGX_INIT_OPERATION eOp; + IMG_UINT32 ui32Offset; + } sReadHWReg; +#if defined(PDUMP) + struct { + SGX_INIT_OPERATION eOp; + IMG_UINT32 ui32Offset; + IMG_UINT32 ui32Value; + } sPDumpHWReg; +#endif +} SGX_INIT_COMMAND; + +typedef struct _SGX_INIT_SCRIPTS_ +{ + SGX_INIT_COMMAND asInitCommandsPart1[SGX_MAX_INIT_COMMANDS]; + SGX_INIT_COMMAND asInitCommandsPart2[SGX_MAX_INIT_COMMANDS]; + SGX_INIT_COMMAND asDeinitCommands[SGX_MAX_DEINIT_COMMANDS]; +} SGX_INIT_SCRIPTS; + +#if defined(__cplusplus) +} +#endif + +#endif /* __SGXSCRIPT_H__ */ + +/***************************************************************************** + End of file (sgxscript.h) +*****************************************************************************/ diff --git a/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/Kbuild.mk b/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/Kbuild.mk new file mode 100644 index 0000000..4bbcfd0 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/Kbuild.mk @@ -0,0 +1,47 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +ccflags-y += \ + -I$(TOP)/services4/3rdparty/dc_nohw \ + -DDC_NOHW_DISCONTIG_BUFFERS -DDC_NOHW_GET_BUFFER_DIMENSIONS + +dcnohw-y += \ + services4/3rdparty/dc_nohw/dc_nohw_displayclass.o \ + services4/3rdparty/dc_nohw/dc_nohw_linux.o diff --git a/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/Linux.mk b/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/Linux.mk new file mode 100644 index 0000000..9bd3e01 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/Linux.mk @@ -0,0 +1,45 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +modules := dc_nohw + +dc_nohw_type := kernel_module +dc_nohw_target := dcnohw.ko +dc_nohw_makefile := $(THIS_DIR)/Kbuild.mk diff --git a/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/dc_nohw.h b/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/dc_nohw.h new file mode 100644 index 0000000..403361f --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/dc_nohw.h @@ -0,0 +1,288 @@ +/*************************************************************************/ /*! +@Title Dummy 3rd party display driver structures and prototypes +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +/************************************************************************** + The 3rd party driver is a specification of an API to integrate the + IMG PowerVR Services driver with 3rd Party display hardware. + It is NOT a specification for a display controller driver, rather a + specification to extend the API for a pre-existing driver for the display hardware. + + The 3rd party driver interface provides IMG PowerVR client drivers (e.g. PVR2D) + with an API abstraction of the system's underlying display hardware, allowing + the client drivers to indirectly control the display hardware and access its + associated memory. + + Functions of the API include + + - query primary surface attributes (width, height, stride, pixel format, + CPU physical and virtual address) + - swap/flip chain creation and subsequent query of surface attributes + - asynchronous display surface flipping, taking account of asynchronous + read (flip) and write (render) operations to the display surface + + Note: having queried surface attributes the client drivers are able to map + the display memory to any IMG PowerVR Services device by calling + PVRSRVMapDeviceClassMemory with the display surface handle. + + This code is intended to be an example of how a pre-existing display driver + may be extended to support the 3rd Party Display interface to + PowerVR Services - IMG is not providing a display driver implementation + **************************************************************************/ + +#ifndef __DC_NOHW_H__ +#define __DC_NOHW_H__ + + +#if defined(__cplusplus) +extern "C" { +#endif + +#if defined(USE_BASE_VIDEO_FRAMEBUFFER) +#if defined (ENABLE_DISPLAY_MODE_TRACKING) +#error Cannot have both USE_BASE_VIDEO_FRAMEBUFFER and ENABLE_DISPLAY_MODE_TRACKING defined +#endif +#endif + +#if !defined(DC_NOHW_BUFFER_WIDTH) && !defined(DC_NOHW_BUFFER_HEIGHT) +/* Default buffer size */ +#define DC_NOHW_BUFFER_WIDTH 320 +#define DC_NOHW_BUFFER_HEIGHT 240 +#endif + +#define DC_NOHW_BUFFER_BIT_DEPTH 32 +#define DC_NOHW_BUFFER_PIXEL_FORMAT PVRSRV_PIXEL_FORMAT_ARGB8888 + +#define DC_NOHW_DEPTH_BITS_PER_BYTE 8 + +#define dc_nohw_byte_depth_from_bit_depth(bit_depth) (((IMG_UINT32)(bit_depth) + DC_NOHW_DEPTH_BITS_PER_BYTE - 1)/DC_NOHW_DEPTH_BITS_PER_BYTE) +#define dc_nohw_bit_depth_from_byte_depth(byte_depth) ((IMG_UINT32)(byte_depth) * DC_NOHW_DEPTH_BITS_PER_BYTE) +#define dc_nohw_roundup_bit_depth(bd) dc_nohw_bit_depth_from_byte_depth(dc_nohw_byte_depth_from_bit_depth(bd)) + +#define dc_nohw_byte_stride(width, bit_depth) ((IMG_UINT32)(width) * dc_nohw_byte_depth_from_bit_depth(bit_depth)) + +#if defined(DC_NOHW_GET_BUFFER_DIMENSIONS) +IMG_BOOL GetBufferDimensions(IMG_UINT32 *pui32Width, IMG_UINT32 *pui32Height, PVRSRV_PIXEL_FORMAT *pePixelFormat, IMG_UINT32 *pui32Stride); +#else +#define DC_NOHW_BUFFER_BYTE_STRIDE dc_nohw_byte_stride(DC_NOHW_BUFFER_WIDTH, DC_NOHW_BUFFER_BIT_DEPTH) +#endif + +extern IMG_BOOL IMG_IMPORT PVRGetDisplayClassJTable(PVRSRV_DC_DISP2SRV_KMJTABLE *psJTable); + +#define DC_NOHW_MAXFORMATS (1) +#define DC_NOHW_MAXDIMS (1) +#define DC_NOHW_MAX_BACKBUFFERS (3) + + +typedef void * DC_HANDLE; + +typedef struct DC_NOHW_BUFFER_TAG +{ + DC_HANDLE hSwapChain; + DC_HANDLE hMemChunk; + + /* member using IMG structures to minimise API function code */ + /* replace with own structures where necessary */ +#if defined(DC_NOHW_DISCONTIG_BUFFERS) + IMG_SYS_PHYADDR *psSysAddr; +#else + IMG_SYS_PHYADDR sSysAddr; +#endif + IMG_DEV_VIRTADDR sDevVAddr; + IMG_CPU_VIRTADDR sCPUVAddr; + PVRSRV_SYNC_DATA* psSyncData; + + struct DC_NOHW_BUFFER_TAG *psNext; +} DC_NOHW_BUFFER; + + +/* DC_NOHW buffer structure */ +typedef struct DC_NOHW_SWAPCHAIN_TAG +{ + unsigned long ulBufferCount; + DC_NOHW_BUFFER *psBuffer; +} DC_NOHW_SWAPCHAIN; + + +/* kernel device information structure */ +typedef struct DC_NOHW_DEVINFO_TAG +{ + unsigned int uiDeviceID; + + /* system surface info */ + DC_NOHW_BUFFER sSystemBuffer; + + /* number of supported display formats */ + unsigned long ulNumFormats; + + /* number of supported display dims */ + unsigned long ulNumDims; + + /* jump table into PVR services */ + PVRSRV_DC_DISP2SRV_KMJTABLE sPVRJTable; + + /* jump table into DC */ + PVRSRV_DC_SRV2DISP_KMJTABLE sDCJTable; + + /* + handle for connection to kernel services + - OS specific - may not be required + */ + DC_HANDLE hPVRServices; + + /* back buffer info */ + DC_NOHW_BUFFER asBackBuffers[DC_NOHW_MAX_BACKBUFFERS]; + + /* ref count */ + unsigned long ulRefCount; + + DC_NOHW_SWAPCHAIN *psSwapChain; + + /* member using IMG structures to minimise API function code */ + /* replace with own structures where necessary */ + DISPLAY_INFO sDisplayInfo; + + /* system surface info */ + DISPLAY_FORMAT sSysFormat; + DISPLAY_DIMS sSysDims; + IMG_UINT32 ui32BufferSize; + + /* list of supported display formats */ + DISPLAY_FORMAT asDisplayFormatList[DC_NOHW_MAXFORMATS]; + + /* list of supported display formats */ + DISPLAY_DIMS asDisplayDimList[DC_NOHW_MAXDIMS]; + + /* back buffer info */ + DISPLAY_FORMAT sBackBufferFormat[DC_NOHW_MAXFORMATS]; + +} DC_NOHW_DEVINFO; + + +/*! + ***************************************************************************** + * Error values + *****************************************************************************/ +typedef enum _DC_ERROR_ +{ + DC_OK = 0, + DC_ERROR_GENERIC = 1, + DC_ERROR_OUT_OF_MEMORY = 2, + DC_ERROR_TOO_FEW_BUFFERS = 3, + DC_ERROR_INVALID_PARAMS = 4, + DC_ERROR_INIT_FAILURE = 5, + DC_ERROR_CANT_REGISTER_CALLBACK = 6, + DC_ERROR_INVALID_DEVICE = 7, + DC_ERROR_DEVICE_REGISTER_FAILED = 8 +} DC_ERROR; + + +#ifndef UNREFERENCED_PARAMETER +#define UNREFERENCED_PARAMETER(param) (param) = (param) +#endif + +DC_ERROR Init(void); +DC_ERROR Deinit(void); + +#if defined(USE_BASE_VIDEO_FRAMEBUFFER) || defined (ENABLE_DISPLAY_MODE_TRACKING) +DC_ERROR OpenMiniport(void); +DC_ERROR CloseMiniport(void); +#endif /* #if defined(USE_BASE_VIDEO_FRAMEBUFFER) || defined (ENABLE_DISPLAY_MODE_TRACKING) */ + +#if defined(USE_BASE_VIDEO_FRAMEBUFFER) +PVRSRV_ERROR SetupDevInfo (DC_NOHW_DEVINFO *psDevInfo); +PVRSRV_ERROR FreeBackBuffers (DC_NOHW_DEVINFO *psDevInfo); +#endif + +#if defined (ENABLE_DISPLAY_MODE_TRACKING) +DC_ERROR Shadow_Desktop_Resolution(DC_NOHW_DEVINFO *psDevInfo); +#endif /* #if defined (ENABLE_DISPLAY_MODE_TRACKING) */ + +#if !defined(DC_NOHW_DISCONTIG_BUFFERS) && !defined(USE_BASE_VIDEO_FRAMEBUFFER) +IMG_SYS_PHYADDR CpuPAddrToSysPAddr(IMG_CPU_PHYADDR cpu_paddr); +IMG_CPU_PHYADDR SysPAddrToCpuPAddr(IMG_SYS_PHYADDR sys_paddr); +#endif + +/* OS Specific APIs */ +DC_ERROR OpenPVRServices (DC_HANDLE *phPVRServices); +DC_ERROR ClosePVRServices (DC_HANDLE hPVRServices); + +#if defined(DC_NOHW_DISCONTIG_BUFFERS) +DC_ERROR AllocDiscontigMemory(unsigned long ulSize, + DC_HANDLE * phMemChunk, + IMG_CPU_VIRTADDR *pLinAddr, + IMG_SYS_PHYADDR **pPhysAddr); + +void FreeDiscontigMemory(unsigned long ulSize, + DC_HANDLE hMemChunk, + IMG_CPU_VIRTADDR LinAddr, + IMG_SYS_PHYADDR *pPhysAddr); +#else + + + +DC_ERROR AllocContigMemory(unsigned long ulSize, + DC_HANDLE * phMemHandle, + IMG_CPU_VIRTADDR *pLinAddr, + IMG_CPU_PHYADDR *pPhysAddr); + +void FreeContigMemory(unsigned long ulSize, + DC_HANDLE hMemChunk, + IMG_CPU_VIRTADDR LinAddr, + IMG_CPU_PHYADDR PhysAddr); + + +#endif + +void *AllocKernelMem(unsigned long ulSize); +void FreeKernelMem (void *pvMem); + +DC_ERROR GetLibFuncAddr (DC_HANDLE hExtDrv, char *szFunctionName, PFN_DC_GET_PVRJTABLE *ppfnFuncTable); + +#if defined(__cplusplus) +} +#endif + +#endif /* __DC_NOHW_H__ */ + +/****************************************************************************** + End of file (dc_nohw.h) +******************************************************************************/ + diff --git a/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/dc_nohw_displayclass.c b/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/dc_nohw_displayclass.c new file mode 100644 index 0000000..d47a171 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/dc_nohw_displayclass.c @@ -0,0 +1,982 @@ +/*************************************************************************/ /*! +@Title NOHW display driver display-specific functions +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +/************************************************************************** + The 3rd party driver is a specification of an API to integrate the IMG POWERVR + Services driver with 3rd Party display hardware. It is NOT a specification for + a display controller driver, rather a specification to extend the API for a + pre-existing driver for the display hardware. + + The 3rd party driver interface provides IMG POWERVR client drivers (e.g. PVR2D) + with an API abstraction of the system's underlying display hardware, allowing + the client drivers to indirectly control the display hardware and access its + associated memory. + + Functions of the API include + - query primary surface attributes (width, height, stride, pixel format, CPU + physical and virtual address) + - swap/flip chain creation and subsequent query of surface attributes + - asynchronous display surface flipping, taking account of asynchronous read + (flip) and write (render) operations to the display surface + + Note: having queried surface attributes the client drivers are able to map the + display memory to any IMG POWERVR Services device by calling + PVRSRVMapDeviceClassMemory with the display surface handle. + + This code is intended to be an example of how a pre-existing display driver may + be extended to support the 3rd Party Display interface to POWERVR Services + - IMG is not providing a display driver implementation. + **************************************************************************/ + +#if defined(__linux__) +#include +#else +#include +#endif + +/* IMG services headers */ +#include "img_defs.h" +#include "servicesext.h" +#include "kerneldisplay.h" + +#include "dc_nohw.h" + +#define DISPLAY_DEVICE_NAME "DC_NOHW" + +#define DC_NOHW_COMMAND_COUNT 1 + +/* top level 'hook ptr' */ +static void *gpvAnchor = 0; +static PFN_DC_GET_PVRJTABLE pfnGetPVRJTable = 0; + + + + +/* + Kernel services is a kernel module and must be loaded first. + The display controller driver is also a kernel module and must be loaded after the pvr services module. + The display controller driver should be able to retrieve the + address of the services PVRGetDisplayClassJTable from (the already loaded) + kernel services module. +*/ + +/* returns anchor pointer */ +static DC_NOHW_DEVINFO * GetAnchorPtr(void) +{ + return (DC_NOHW_DEVINFO *)gpvAnchor; +} + +/* sets anchor pointer */ +static void SetAnchorPtr(DC_NOHW_DEVINFO *psDevInfo) +{ + gpvAnchor = (void *)psDevInfo; +} + +#if !defined(DC_NOHW_DISCONTIG_BUFFERS) && !defined(USE_BASE_VIDEO_FRAMEBUFFER) +IMG_SYS_PHYADDR CpuPAddrToSysPAddr(IMG_CPU_PHYADDR cpu_paddr) +{ + IMG_SYS_PHYADDR sys_paddr; + + /* This would only be an inequality if the CPU's MMU did not point to sys address 0, + ie. multi CPU system */ + sys_paddr.uiAddr = cpu_paddr.uiAddr; + return sys_paddr; +} + +IMG_CPU_PHYADDR SysPAddrToCpuPAddr(IMG_SYS_PHYADDR sys_paddr) +{ + IMG_CPU_PHYADDR cpu_paddr; + + /* This would only be an inequality if the CPU's MMU did not point to sys address 0, + ie. multi CPU system */ + cpu_paddr.uiAddr = sys_paddr.uiAddr; + return cpu_paddr; +} +#endif + + +static PVRSRV_ERROR OpenDCDevice(IMG_UINT32 ui32DeviceID, + IMG_HANDLE *phDevice, + PVRSRV_SYNC_DATA* psSystemBufferSyncData) +{ + DC_NOHW_DEVINFO *psDevInfo; + PVR_UNREFERENCED_PARAMETER(ui32DeviceID); + + psDevInfo = GetAnchorPtr(); + +#if defined (ENABLE_DISPLAY_MODE_TRACKING) + if (Shadow_Desktop_Resolution(psDevInfo) != DC_OK) + { + return (PVRSRV_ERROR_NOT_SUPPORTED); + } +#endif + + /* store the system surface sync data */ + psDevInfo->asBackBuffers[0].psSyncData = psSystemBufferSyncData; + + /* return handle to the devinfo */ + *phDevice = (IMG_HANDLE)psDevInfo; + +#if defined(USE_BASE_VIDEO_FRAMEBUFFER) + return (SetupDevInfo(psDevInfo)); +#else + return (PVRSRV_OK); +#endif +} + + +static PVRSRV_ERROR CloseDCDevice(IMG_HANDLE hDevice) +{ + UNREFERENCED_PARAMETER(hDevice); + +#if defined(USE_BASE_VIDEO_FRAMEBUFFER) + FreeBackBuffers(GetAnchorPtr()); +#endif + + return (PVRSRV_OK); +} + + +static PVRSRV_ERROR EnumDCFormats(IMG_HANDLE hDevice, + IMG_UINT32 *pui32NumFormats, + DISPLAY_FORMAT *psFormat) +{ + DC_NOHW_DEVINFO *psDevInfo; + + if(!hDevice || !pui32NumFormats) + { + return (PVRSRV_ERROR_INVALID_PARAMS); + } + + psDevInfo = (DC_NOHW_DEVINFO *)hDevice; + + *pui32NumFormats = (IMG_UINT32)psDevInfo->ulNumFormats; + + if(psFormat != IMG_NULL) + { + unsigned long i; + + for(i=0; iulNumFormats; i++) + { + psFormat[i] = psDevInfo->asDisplayFormatList[i]; + } + } + + return (PVRSRV_OK); +} + + +static PVRSRV_ERROR EnumDCDims(IMG_HANDLE hDevice, + DISPLAY_FORMAT *psFormat, + IMG_UINT32 *pui32NumDims, + DISPLAY_DIMS *psDim) +{ + DC_NOHW_DEVINFO *psDevInfo; + + if(!hDevice || !psFormat || !pui32NumDims) + { + return (PVRSRV_ERROR_INVALID_PARAMS); + } + + psDevInfo = (DC_NOHW_DEVINFO *)hDevice; + + *pui32NumDims = (IMG_UINT32)psDevInfo->ulNumDims; + + /* given psFormat return the available Dims */ + + if(psDim != IMG_NULL) + { + unsigned long i; + + for(i=0; iulNumDims; i++) + { + psDim[i] = psDevInfo->asDisplayDimList[i]; + } + } + + return (PVRSRV_OK); +} + + +static PVRSRV_ERROR GetDCSystemBuffer(IMG_HANDLE hDevice, IMG_HANDLE *phBuffer) +{ + DC_NOHW_DEVINFO *psDevInfo; + + if(!hDevice || !phBuffer) + { + return (PVRSRV_ERROR_INVALID_PARAMS); + } + + psDevInfo = (DC_NOHW_DEVINFO *)hDevice; + + *phBuffer = (IMG_HANDLE)&psDevInfo->asBackBuffers[0]; + + return (PVRSRV_OK); +} + + +static PVRSRV_ERROR GetDCInfo(IMG_HANDLE hDevice, DISPLAY_INFO *psDCInfo) +{ + DC_NOHW_DEVINFO *psDevInfo; + + if(!hDevice || !psDCInfo) + { + return (PVRSRV_ERROR_INVALID_PARAMS); + } + + psDevInfo = (DC_NOHW_DEVINFO *)hDevice; + + *psDCInfo = psDevInfo->sDisplayInfo; + + return (PVRSRV_OK); +} + + +static PVRSRV_ERROR GetDCBufferAddr(IMG_HANDLE hDevice, + IMG_HANDLE hBuffer, + IMG_SYS_PHYADDR **ppsSysAddr, + IMG_UINT32 *pui32ByteSize, + IMG_VOID **ppvCpuVAddr, + IMG_HANDLE *phOSMapInfo, + IMG_BOOL *pbIsContiguous, + IMG_UINT32 *pui32TilingStride) +{ + DC_NOHW_DEVINFO *psDevInfo; + DC_NOHW_BUFFER *psBuffer; + + if(!hDevice || !hBuffer || !ppsSysAddr || !pui32ByteSize) + { + return (PVRSRV_ERROR_INVALID_PARAMS); + } + + psDevInfo = (DC_NOHW_DEVINFO *)hDevice; + + psBuffer = (DC_NOHW_BUFFER*)hBuffer; + + *ppvCpuVAddr = psBuffer->sCPUVAddr; + + *pui32ByteSize = (IMG_UINT32)(psDevInfo->asDisplayDimList[0].ui32Height * psDevInfo->asDisplayDimList[0].ui32ByteStride); + *phOSMapInfo = IMG_NULL; + +#if defined(DC_NOHW_DISCONTIG_BUFFERS) + *ppsSysAddr = psBuffer->psSysAddr; + *pbIsContiguous = IMG_FALSE; +#else + *ppsSysAddr = &psBuffer->sSysAddr; + *pbIsContiguous = IMG_TRUE; +#endif + +#if defined(SUPPORT_MEMORY_TILING) + { + IMG_UINT32 ui32Stride = psDevInfo->asDisplayDimList[0].ui32ByteStride; + IMG_UINT32 ui32NumBits = 0, ui32StrideTopBit, n; + + // How many bits for x? + for(n = 0; n < 32; n++) + { + if(ui32Stride & (1<psSwapChain) + { + return (PVRSRV_ERROR_FLIP_CHAIN_EXISTS); + } + + /* check the buffer count */ + if(ui32BufferCount > DC_NOHW_MAX_BACKBUFFERS) + { + return (PVRSRV_ERROR_TOOMANYBUFFERS); + } + + /* + verify the DST/SRC attributes + - SRC/DST must match the current display mode config + */ + if(psDstSurfAttrib->pixelformat != psDevInfo->sSysFormat.pixelformat + || psDstSurfAttrib->sDims.ui32ByteStride != psDevInfo->sSysDims.ui32ByteStride + || psDstSurfAttrib->sDims.ui32Width != psDevInfo->sSysDims.ui32Width + || psDstSurfAttrib->sDims.ui32Height != psDevInfo->sSysDims.ui32Height) + { + /* DST doesn't match the current mode */ + return (PVRSRV_ERROR_INVALID_PARAMS); + } + + if(psDstSurfAttrib->pixelformat != psSrcSurfAttrib->pixelformat + || psDstSurfAttrib->sDims.ui32ByteStride != psSrcSurfAttrib->sDims.ui32ByteStride + || psDstSurfAttrib->sDims.ui32Width != psSrcSurfAttrib->sDims.ui32Width + || psDstSurfAttrib->sDims.ui32Height != psSrcSurfAttrib->sDims.ui32Height) + { + /* DST doesn't match the SRC */ + return (PVRSRV_ERROR_INVALID_PARAMS); + } + + /* INTEGRATION_POINT: check the flags */ + UNREFERENCED_PARAMETER(ui32Flags); + + /* create a swapchain structure */ + psSwapChain = (DC_NOHW_SWAPCHAIN*)AllocKernelMem(sizeof(DC_NOHW_SWAPCHAIN)); + if(!psSwapChain) + { + return (PVRSRV_ERROR_OUT_OF_MEMORY); + } + + psBuffer = (DC_NOHW_BUFFER*)AllocKernelMem(sizeof(DC_NOHW_BUFFER) * ui32BufferCount); + if(!psBuffer) + { + FreeKernelMem(psSwapChain); + return (PVRSRV_ERROR_OUT_OF_MEMORY); + } + + /* initialise allocations */ + memset(psSwapChain, 0, sizeof(DC_NOHW_SWAPCHAIN)); + memset(psBuffer, 0, sizeof(DC_NOHW_BUFFER) * ui32BufferCount); + + psSwapChain->ulBufferCount = (unsigned long)ui32BufferCount; + psSwapChain->psBuffer = psBuffer; + + /* link the buffers */ + for(i=0; iasBackBuffers[i].psSysAddr; +#else + psBuffer[i].sSysAddr = psDevInfo->asBackBuffers[i].sSysAddr; +#endif + psBuffer[i].sDevVAddr = psDevInfo->asBackBuffers[i].sDevVAddr; + psBuffer[i].sCPUVAddr = psDevInfo->asBackBuffers[i].sCPUVAddr; + psBuffer[i].hSwapChain = (DC_HANDLE)psSwapChain; + } + + /* mark swapchain's existence */ + psDevInfo->psSwapChain = psSwapChain; + + /* return swapchain handle */ + *phSwapChain = (IMG_HANDLE)psSwapChain; + + /* INTEGRATION_POINT: enable Vsync ISR */ + + return (PVRSRV_OK); +} + + +static PVRSRV_ERROR DestroyDCSwapChain(IMG_HANDLE hDevice, + IMG_HANDLE hSwapChain) +{ + DC_NOHW_DEVINFO *psDevInfo; + DC_NOHW_SWAPCHAIN *psSwapChain; + + /* check parameters */ + if(!hDevice + || !hSwapChain) + { + return (PVRSRV_ERROR_INVALID_PARAMS); + } + + psDevInfo = (DC_NOHW_DEVINFO*)hDevice; + psSwapChain = (DC_NOHW_SWAPCHAIN*)hSwapChain; + + /* free resources */ + FreeKernelMem(psSwapChain->psBuffer); + FreeKernelMem(psSwapChain); + + /* mark swapchain as not existing */ + psDevInfo->psSwapChain = 0; + + /* INTEGRATION_POINT: disable Vsync ISR */ + + return (PVRSRV_OK); +} + + +static PVRSRV_ERROR SetDCDstRect(IMG_HANDLE hDevice, + IMG_HANDLE hSwapChain, + IMG_RECT *psRect) +{ + UNREFERENCED_PARAMETER(hDevice); + UNREFERENCED_PARAMETER(hSwapChain); + UNREFERENCED_PARAMETER(psRect); + + return (PVRSRV_ERROR_NOT_SUPPORTED); +} + + +static PVRSRV_ERROR SetDCSrcRect(IMG_HANDLE hDevice, + IMG_HANDLE hSwapChain, + IMG_RECT *psRect) +{ + UNREFERENCED_PARAMETER(hDevice); + UNREFERENCED_PARAMETER(hSwapChain); + UNREFERENCED_PARAMETER(psRect); + + return (PVRSRV_ERROR_NOT_SUPPORTED); +} + + +static PVRSRV_ERROR SetDCDstColourKey(IMG_HANDLE hDevice, + IMG_HANDLE hSwapChain, + IMG_UINT32 ui32CKColour) +{ + UNREFERENCED_PARAMETER(hDevice); + UNREFERENCED_PARAMETER(hSwapChain); + UNREFERENCED_PARAMETER(ui32CKColour); + + return (PVRSRV_ERROR_NOT_SUPPORTED); +} + + +static PVRSRV_ERROR SetDCSrcColourKey(IMG_HANDLE hDevice, + IMG_HANDLE hSwapChain, + IMG_UINT32 ui32CKColour) +{ + UNREFERENCED_PARAMETER(hDevice); + UNREFERENCED_PARAMETER(hSwapChain); + UNREFERENCED_PARAMETER(ui32CKColour); + + return (PVRSRV_ERROR_NOT_SUPPORTED); +} + + +static PVRSRV_ERROR GetDCBuffers(IMG_HANDLE hDevice, + IMG_HANDLE hSwapChain, + IMG_UINT32 *pui32BufferCount, + IMG_HANDLE *phBuffer) +{ +/* DC_NOHW_DEVINFO *psDevInfo; */ + DC_NOHW_SWAPCHAIN *psSwapChain; + unsigned long i; + + /* check parameters */ + if(!hDevice + || !hSwapChain + || !pui32BufferCount + || !phBuffer) + { + return (PVRSRV_ERROR_INVALID_PARAMS); + } + +/* psDevInfo = (DC_NOHW_DEVINFO*)hDevice; */ + psSwapChain = (DC_NOHW_SWAPCHAIN*)hSwapChain; + + /* return the buffer count */ + *pui32BufferCount = (IMG_UINT32)psSwapChain->ulBufferCount; + + /* return the buffers */ + for(i=0; iulBufferCount; i++) + { + phBuffer[i] = (IMG_HANDLE)&psSwapChain->psBuffer[i]; + } + + return (PVRSRV_OK); +} + + +static PVRSRV_ERROR SwapToDCBuffer(IMG_HANDLE hDevice, + IMG_HANDLE hBuffer, + IMG_UINT32 ui32SwapInterval, + IMG_HANDLE hPrivateTag, + IMG_UINT32 ui32ClipRectCount, + IMG_RECT *psClipRect) +{ + UNREFERENCED_PARAMETER(ui32SwapInterval); + UNREFERENCED_PARAMETER(hPrivateTag); + UNREFERENCED_PARAMETER(psClipRect); + + if(!hDevice + || !hBuffer + || (ui32ClipRectCount != 0)) + { + return (PVRSRV_ERROR_INVALID_PARAMS); + } + + /* nothing to do for no hw */ + return (PVRSRV_OK); +} + + +static DC_ERROR Flip(DC_NOHW_DEVINFO *psDevInfo, + DC_NOHW_BUFFER *psBuffer) +{ + /* check parameters */ + if(!psDevInfo || !psBuffer) + { + return (DC_ERROR_INVALID_PARAMS); + } + /* to be implemented */ + + return (DC_OK); +} + + +static IMG_BOOL ProcessFlip(IMG_HANDLE hCmdCookie, + IMG_UINT32 ui32DataSize, + IMG_VOID *pvData) +{ + DC_ERROR eError; + DISPLAYCLASS_FLIP_COMMAND *psFlipCmd; + DC_NOHW_DEVINFO *psDevInfo; + DC_NOHW_BUFFER *psBuffer; + + /* check parameters */ + if(!hCmdCookie) + { + return (IMG_FALSE); + } + + /* validate data packet */ + psFlipCmd = (DISPLAYCLASS_FLIP_COMMAND*)pvData; + if (psFlipCmd == IMG_NULL || sizeof(DISPLAYCLASS_FLIP_COMMAND) != ui32DataSize) + { + return (IMG_FALSE); + } + + /* setup some useful pointers */ + psDevInfo = (DC_NOHW_DEVINFO*)psFlipCmd->hExtDevice; + + psBuffer = (DC_NOHW_BUFFER*)psFlipCmd->hExtBuffer; + + /* flip the display */ + eError = Flip(psDevInfo, psBuffer); + if(eError != DC_OK) + { + return (IMG_FALSE); + } + + /* call command complete Callback */ + psDevInfo->sPVRJTable.pfnPVRSRVCmdComplete(hCmdCookie, IMG_FALSE); + + return (IMG_TRUE); +} + + +DC_ERROR Init(void) +{ + DC_NOHW_DEVINFO *psDevInfo; + DC_ERROR eError; + unsigned long ulBBuf; + unsigned long ulNBBuf; + /* + - connect to services + - register with services + - allocate and setup private data structure + */ + + + /* + in kernel driver, data structures must be anchored to something for subsequent retrieval + this may be a single global pointer or TLS or something else - up to you + call API to retrieve this ptr + */ + + /* + get the anchor pointer + */ + psDevInfo = GetAnchorPtr(); + + if (psDevInfo == 0) + { + PFN_CMD_PROC pfnCmdProcList[DC_NOHW_COMMAND_COUNT]; + IMG_UINT32 aui32SyncCountList[DC_NOHW_COMMAND_COUNT][2]; + + /* allocate device info. structure */ + psDevInfo = (DC_NOHW_DEVINFO *)AllocKernelMem(sizeof(*psDevInfo)); + + if(!psDevInfo) + { + eError = DC_ERROR_OUT_OF_MEMORY;/* failure */ + goto ExitError; + } + + /* initialise allocation */ + memset(psDevInfo, 0, sizeof(*psDevInfo)); + + /* set the top-level anchor */ + SetAnchorPtr((void*)psDevInfo); + + /* set ref count */ + psDevInfo->ulRefCount = 0UL; + + if(OpenPVRServices(&psDevInfo->hPVRServices) != DC_OK) + { + eError = DC_ERROR_INIT_FAILURE; + goto ExitFreeDevInfo; + } + if(GetLibFuncAddr (psDevInfo->hPVRServices, "PVRGetDisplayClassJTable", &pfnGetPVRJTable) != DC_OK) + { + eError = DC_ERROR_INIT_FAILURE; + goto ExitCloseServices; + } + + /* got the kernel services function table */ + if((*pfnGetPVRJTable)(&psDevInfo->sPVRJTable) == IMG_FALSE) + { + eError = DC_ERROR_INIT_FAILURE; + goto ExitCloseServices; + } + + /* + Setup the devinfo + */ + psDevInfo->psSwapChain = 0; + psDevInfo->sDisplayInfo.ui32MinSwapInterval = 0UL; + psDevInfo->sDisplayInfo.ui32MaxSwapInterval = 1UL; + psDevInfo->sDisplayInfo.ui32MaxSwapChains = 1UL; + psDevInfo->sDisplayInfo.ui32MaxSwapChainBuffers = DC_NOHW_MAX_BACKBUFFERS; + strncpy(psDevInfo->sDisplayInfo.szDisplayName, DISPLAY_DEVICE_NAME, MAX_DISPLAY_NAME_SIZE); + + psDevInfo->ulNumFormats = 1UL; + + psDevInfo->ulNumDims = 1UL; + +#if defined(DC_NOHW_GET_BUFFER_DIMENSIONS) + if (!GetBufferDimensions(&psDevInfo->asDisplayDimList[0].ui32Width, + &psDevInfo->asDisplayDimList[0].ui32Height, + &psDevInfo->asDisplayFormatList[0].pixelformat, + &psDevInfo->asDisplayDimList[0].ui32ByteStride)) + { + eError = DC_ERROR_INIT_FAILURE; + goto ExitCloseServices; + } +#else /* defined(DC_NOHW_GET_BUFFER_DIMENSIONS) */ + #if defined (ENABLE_DISPLAY_MODE_TRACKING) + // Set sizes to zero to force re-alloc on display mode change. + psDevInfo->asDisplayFormatList[0].pixelformat = DC_NOHW_BUFFER_PIXEL_FORMAT; + psDevInfo->asDisplayDimList[0].ui32Width = 0; + psDevInfo->asDisplayDimList[0].ui32Height = 0; + psDevInfo->asDisplayDimList[0].ui32ByteStride = 0; + #else + psDevInfo->asDisplayFormatList[0].pixelformat = DC_NOHW_BUFFER_PIXEL_FORMAT; + psDevInfo->asDisplayDimList[0].ui32Width = DC_NOHW_BUFFER_WIDTH; + psDevInfo->asDisplayDimList[0].ui32Height = DC_NOHW_BUFFER_HEIGHT; + psDevInfo->asDisplayDimList[0].ui32ByteStride = DC_NOHW_BUFFER_BYTE_STRIDE; + #endif +#endif /* defined(DC_NOHW_GET_BUFFER_DIMENSIONS) */ + + psDevInfo->sSysFormat = psDevInfo->asDisplayFormatList[0]; + psDevInfo->sSysDims.ui32Width = psDevInfo->asDisplayDimList[0].ui32Width; + psDevInfo->sSysDims.ui32Height = psDevInfo->asDisplayDimList[0].ui32Height; + psDevInfo->sSysDims.ui32ByteStride = psDevInfo->asDisplayDimList[0].ui32ByteStride; + psDevInfo->ui32BufferSize = psDevInfo->sSysDims.ui32Height * psDevInfo->sSysDims.ui32ByteStride; + + + /* setup swapchain details */ + for(ulBBuf=0; ulBBufasBackBuffers[ulBBuf].sSysAddr.uiAddr = IMG_NULL; + psDevInfo->asBackBuffers[ulBBuf].sCPUVAddr = IMG_NULL; +#else +#if defined(DC_NOHW_DISCONTIG_BUFFERS) + if (AllocDiscontigMemory(psDevInfo->ui32BufferSize, + &psDevInfo->asBackBuffers[ulBBuf].hMemChunk, + &psDevInfo->asBackBuffers[ulBBuf].sCPUVAddr, + &psDevInfo->asBackBuffers[ulBBuf].psSysAddr) != DC_OK) + { + eError = DC_ERROR_INIT_FAILURE; + goto ExitFreeMem; + } +#else + IMG_CPU_PHYADDR sBufferCPUPAddr; + + if (AllocContigMemory(psDevInfo->ui32BufferSize, + &psDevInfo->asBackBuffers[ulBBuf].hMemChunk, + &psDevInfo->asBackBuffers[ulBBuf].sCPUVAddr, + &sBufferCPUPAddr) != DC_OK) + { + eError = DC_ERROR_INIT_FAILURE; + goto ExitFreeMem; + } + + psDevInfo->asBackBuffers[ulBBuf].sSysAddr = CpuPAddrToSysPAddr(sBufferCPUPAddr); +#endif +#endif /* #if defined(USE_BASE_VIDEO_FRAMEBUFFER) */ + /* sDevVAddr not meaningful for nohw */ + psDevInfo->asBackBuffers[ulBBuf].sDevVAddr.uiAddr = 0UL; + psDevInfo->asBackBuffers[ulBBuf].hSwapChain = 0; + psDevInfo->asBackBuffers[ulBBuf].psSyncData = 0; + psDevInfo->asBackBuffers[ulBBuf].psNext = 0; + } + + /* + setup the DC Jtable so SRVKM can call into this driver + */ + psDevInfo->sDCJTable.ui32TableSize = sizeof(PVRSRV_DC_SRV2DISP_KMJTABLE); + psDevInfo->sDCJTable.pfnOpenDCDevice = OpenDCDevice; + psDevInfo->sDCJTable.pfnCloseDCDevice = CloseDCDevice; + psDevInfo->sDCJTable.pfnEnumDCFormats = EnumDCFormats; + psDevInfo->sDCJTable.pfnEnumDCDims = EnumDCDims; + psDevInfo->sDCJTable.pfnGetDCSystemBuffer = GetDCSystemBuffer; + psDevInfo->sDCJTable.pfnGetDCInfo = GetDCInfo; + psDevInfo->sDCJTable.pfnGetBufferAddr = GetDCBufferAddr; + psDevInfo->sDCJTable.pfnCreateDCSwapChain = CreateDCSwapChain; + psDevInfo->sDCJTable.pfnDestroyDCSwapChain = DestroyDCSwapChain; + psDevInfo->sDCJTable.pfnSetDCDstRect = SetDCDstRect; + psDevInfo->sDCJTable.pfnSetDCSrcRect = SetDCSrcRect; + psDevInfo->sDCJTable.pfnSetDCDstColourKey = SetDCDstColourKey; + psDevInfo->sDCJTable.pfnSetDCSrcColourKey = SetDCSrcColourKey; + psDevInfo->sDCJTable.pfnGetDCBuffers = GetDCBuffers; + psDevInfo->sDCJTable.pfnSwapToDCBuffer = SwapToDCBuffer; + psDevInfo->sDCJTable.pfnSetDCState = IMG_NULL; + + /* register device with services and retrieve device index */ + if(psDevInfo->sPVRJTable.pfnPVRSRVRegisterDCDevice (&psDevInfo->sDCJTable, + &psDevInfo->uiDeviceID ) != PVRSRV_OK) + { + eError = DC_ERROR_DEVICE_REGISTER_FAILED; + goto ExitFreeMem; + } + + /* + setup private command processing function table + */ + pfnCmdProcList[DC_FLIP_COMMAND] = ProcessFlip; + + /* + and associated sync count(s) + */ + aui32SyncCountList[DC_FLIP_COMMAND][0] = 0UL;/* no writes */ + aui32SyncCountList[DC_FLIP_COMMAND][1] = 2UL;/* 2 reads: To / From */ + + /* + register private command processing functions with + the Command Queue Manager and setup the general + command complete function in the devinfo + */ + if (psDevInfo->sPVRJTable.pfnPVRSRVRegisterCmdProcList(psDevInfo->uiDeviceID, + &pfnCmdProcList[0], + aui32SyncCountList, + DC_NOHW_COMMAND_COUNT) != PVRSRV_OK) + { + eError = DC_ERROR_CANT_REGISTER_CALLBACK; + goto ExitRemoveDevice; + } + } + + /* increment the ref count */ + psDevInfo->ulRefCount++; + + /* return success */ + return (DC_OK); + +ExitRemoveDevice: + (IMG_VOID) psDevInfo->sPVRJTable.pfnPVRSRVRemoveDCDevice(psDevInfo->uiDeviceID); + +ExitFreeMem: + ulNBBuf = ulBBuf; + for(ulBBuf=0; ulBBufui32BufferSize, + psDevInfo->asBackBuffers[ulBBuf].hMemChunk, + psDevInfo->asBackBuffers[ulBBuf].sCPUVAddr, + psDevInfo->asBackBuffers[ulBBuf].psSysAddr); +#else +#if !defined(USE_BASE_VIDEO_FRAMEBUFFER) + + FreeContigMemory(psDevInfo->ui32BufferSize, + psDevInfo->asBackBuffers[ulBBuf].hMemChunk, + psDevInfo->asBackBuffers[ulBBuf].sCPUVAddr, + SysPAddrToCpuPAddr(psDevInfo->asBackBuffers[ulBBuf].sSysAddr)); + + +#endif /* #if defined(USE_BASE_VIDEO_FRAMEBUFFER) */ +#endif /* #if defined(DC_NOHW_DISCONTIG_BUFFERS) */ + } + +ExitCloseServices: + (void)ClosePVRServices(psDevInfo->hPVRServices); + +ExitFreeDevInfo: + FreeKernelMem(psDevInfo); + SetAnchorPtr(0); + +ExitError: + return eError; +} + + + +/* + * Deinit + */ +DC_ERROR Deinit(void) +{ + DC_NOHW_DEVINFO *psDevInfo, *psDevFirst; +#if !defined(USE_BASE_VIDEO_FRAMEBUFFER) + unsigned long i; +#endif + + psDevFirst = GetAnchorPtr(); + psDevInfo = psDevFirst; + + /* check DevInfo has been setup */ + if (psDevInfo == 0) + { + return (DC_ERROR_GENERIC);/* failure */ + } + + /* decrement ref count */ + psDevInfo->ulRefCount--; + + if (psDevInfo->ulRefCount == 0UL) + { + /* all references gone - de-init device information */ + PVRSRV_DC_DISP2SRV_KMJTABLE *psJTable = &psDevInfo->sPVRJTable; + + /* Remove display class device from kernel services device register */ + if (psJTable->pfnPVRSRVRemoveDCDevice((IMG_UINT32)psDevInfo->uiDeviceID) != PVRSRV_OK) + { + return (DC_ERROR_GENERIC);/* failure */ + } + + if (psDevInfo->sPVRJTable.pfnPVRSRVRemoveCmdProcList(psDevInfo->uiDeviceID, + DC_NOHW_COMMAND_COUNT) != PVRSRV_OK) + { + return (DC_ERROR_GENERIC);/* failure */ + } + + if (ClosePVRServices(psDevInfo->hPVRServices) != DC_OK) + { + psDevInfo->hPVRServices = 0; + return (DC_ERROR_GENERIC);/* failure */ + } + +#if !defined(USE_BASE_VIDEO_FRAMEBUFFER) + for(i=0; iasBackBuffers[i].sCPUVAddr) + { + #if defined(DC_NOHW_DISCONTIG_BUFFERS) + FreeDiscontigMemory(psDevInfo->ui32BufferSize, + psDevInfo->asBackBuffers[i].hMemChunk, + psDevInfo->asBackBuffers[i].sCPUVAddr, + psDevInfo->asBackBuffers[i].psSysAddr); + #else + + FreeContigMemory(psDevInfo->ui32BufferSize, + psDevInfo->asBackBuffers[i].hMemChunk, + psDevInfo->asBackBuffers[i].sCPUVAddr, + SysPAddrToCpuPAddr(psDevInfo->asBackBuffers[i].sSysAddr)); + #endif + } + } +#endif /* #if !defined(USE_BASE_VIDEO_FRAMEBUFFER) */ + + /* de-allocate data structure */ + FreeKernelMem(psDevInfo); + } + +#if defined (ENABLE_DISPLAY_MODE_TRACKING) + CloseMiniport(); +#endif + /* clear the top-level anchor */ + SetAnchorPtr(0); + + /* return success */ + return (DC_OK); +} + +/****************************************************************************** + End of file (dc_nohw_displayclass.c) +******************************************************************************/ diff --git a/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/dc_nohw_linux.c b/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/dc_nohw_linux.c new file mode 100644 index 0000000..2f603ea --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_nohw/dc_nohw_linux.c @@ -0,0 +1,376 @@ +/*************************************************************************/ /*! +@Title Dummy 3rd party driver linux specific declarations. +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +/************************************************************************** + The 3rd party driver is a specification of an API to integrate the + IMG PowerVR Services driver with 3rd Party display hardware. + It is NOT a specification for a display controller driver, rather a + specification to extend the API for a pre-existing driver for the display hardware. + + The 3rd party driver interface provides IMG PowerVR client drivers (e.g. PVR2D) + with an API abstraction of the system's underlying display hardware, allowing + the client drivers to indirectly control the display hardware and access its + associated memory. + + Functions of the API include + + - query primary surface attributes (width, height, stride, pixel format, + CPU physical and virtual address) + - swap/flip chain creation and subsequent query of surface attributes + - asynchronous display surface flipping, taking account of asynchronous + read (flip) and write (render) operations to the display surface + + Note: having queried surface attributes the client drivers are able to map + the display memory to any IMG PowerVR Services device by calling + PVRSRVMapDeviceClassMemory with the display surface handle. + + This code is intended to be an example of how a pre-existing display driver + may be extended to support the 3rd Party Display interface to + PowerVR Services - IMG is not providing a display driver implementation + **************************************************************************/ + +#include + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)) +#ifndef AUTOCONF_INCLUDED +#include +#endif +#endif + +#include +#include +#include + +#if defined(SUPPORT_DRI_DRM) +#include +#endif + +#if defined(DC_NOHW_DISCONTIG_BUFFERS) +#include +#include +#else +#include +#endif + +#include "img_defs.h" +#include "servicesext.h" +#include "kerneldisplay.h" +#include "dc_nohw.h" +#include "pvrmodule.h" + +#if defined(SUPPORT_DRI_DRM) +#include "pvr_drm.h" +#endif + +#if defined(DC_USE_SET_MEMORY) + #undef DC_USE_SET_MEMORY +#endif + +#if !defined(DC_NOHW_DISCONTIG_BUFFERS) + #if defined(__i386__) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)) && defined(SUPPORT_LINUX_X86_PAT) && defined(SUPPORT_LINUX_X86_WRITECOMBINE) + #include + #define DC_USE_SET_MEMORY + #endif +#endif /* defined(DC_NOHW_DISCONTIG_BUFFERS) */ + +#define DRVNAME "dcnohw" + +#if !defined(SUPPORT_DRI_DRM) +MODULE_SUPPORTED_DEVICE(DRVNAME); +#endif + +#define unref__ __attribute__ ((unused)) + +#if defined(DC_NOHW_GET_BUFFER_DIMENSIONS) +static unsigned long width = DC_NOHW_BUFFER_WIDTH; +static unsigned long height = DC_NOHW_BUFFER_HEIGHT; +static unsigned long depth = DC_NOHW_BUFFER_BIT_DEPTH; + +module_param(width, ulong, S_IRUGO); +module_param(height, ulong, S_IRUGO); +module_param(depth, ulong, S_IRUGO); + +IMG_BOOL GetBufferDimensions(IMG_UINT32 *pui32Width, IMG_UINT32 *pui32Height, PVRSRV_PIXEL_FORMAT *pePixelFormat, IMG_UINT32 *pui32Stride) +{ + if (width == 0 || height == 0 || depth == 0 || + depth != dc_nohw_roundup_bit_depth(depth)) + { + printk(KERN_WARNING DRVNAME ": Illegal module parameters (width %lu, height %lu, depth %lu)\n", width, height, depth); + return IMG_FALSE; + } + + *pui32Width = (IMG_UINT32)width; + *pui32Height = (IMG_UINT32)height; + + switch(depth) + { + case 32: + *pePixelFormat = PVRSRV_PIXEL_FORMAT_ARGB8888; + break; + case 16: + *pePixelFormat = PVRSRV_PIXEL_FORMAT_RGB565; + break; + default: + printk(KERN_WARNING DRVNAME ": Display depth %lu not supported\n", depth); + *pePixelFormat = PVRSRV_PIXEL_FORMAT_UNKNOWN; + return IMG_FALSE; + } + + *pui32Stride = dc_nohw_byte_stride(width, depth); + +#if defined(DEBUG) + printk(KERN_INFO DRVNAME " Width: %lu\n", (unsigned long)*pui32Width); + printk(KERN_INFO DRVNAME " Height: %lu\n", (unsigned long)*pui32Height); + printk(KERN_INFO DRVNAME " Depth: %lu bits\n", depth); + printk(KERN_INFO DRVNAME " Stride: %lu bytes\n", (unsigned long)*pui32Stride); +#endif /* defined(DEBUG) */ + + return IMG_TRUE; +} +#endif /* defined(DC_NOHW_GET_BUFFER_DIMENSIONS) */ + +/***************************************************************************** + Function Name: DC_NOHW_Init + Description : Insert the driver into the kernel. + + __init places the function in a special memory section that + the kernel frees once the function has been run. Refer also + to module_init() macro call below. + +*****************************************************************************/ +#if defined(SUPPORT_DRI_DRM) +int PVR_DRM_MAKENAME(DISPLAY_CONTROLLER, _Init)(struct drm_device unref__ *dev) +#else +static int __init DC_NOHW_Init(void) +#endif +{ + if(Init() != DC_OK) + { + return -ENODEV; + } + + return 0; +} /*DC_NOHW_Init*/ + +/***************************************************************************** + Function Name: DC_NOHW_Cleanup + Description : Remove the driver from the kernel. + + __exit places the function in a special memory section that + the kernel frees once the function has been run. Refer also + to module_exit() macro call below. + +*****************************************************************************/ +#if defined(SUPPORT_DRI_DRM) +void PVR_DRM_MAKENAME(DISPLAY_CONTROLLER, _Cleanup)(struct drm_device unref__ *dev) +#else +static void __exit DC_NOHW_Cleanup(void) +#endif +{ + if(Deinit() != DC_OK) + { + printk (KERN_INFO DRVNAME ": DC_NOHW_Cleanup: can't deinit device\n"); + } +} /*DC_NOHW_Cleanup*/ + + +void *AllocKernelMem(unsigned long ulSize) +{ + return kmalloc(ulSize, GFP_KERNEL); +} + +void FreeKernelMem(void *pvMem) +{ + kfree(pvMem); +} + +#if defined(DC_NOHW_DISCONTIG_BUFFERS) + +#define RANGE_TO_PAGES(range) (((range) + (PAGE_SIZE - 1)) >> PAGE_SHIFT) +#define VMALLOC_TO_PAGE_PHYS(vAddr) page_to_phys(vmalloc_to_page(vAddr)) + +DC_ERROR AllocDiscontigMemory(unsigned long ulSize, + DC_HANDLE unref__ *phMemHandle, + IMG_CPU_VIRTADDR *pLinAddr, + IMG_SYS_PHYADDR **ppPhysAddr) +{ + unsigned long ulPages = RANGE_TO_PAGES(ulSize); + IMG_SYS_PHYADDR *pPhysAddr; + unsigned long ulPage; + IMG_CPU_VIRTADDR LinAddr; + + LinAddr = __vmalloc(ulSize, GFP_KERNEL | __GFP_HIGHMEM, pgprot_noncached(PAGE_KERNEL)); + if (!LinAddr) + { + return DC_ERROR_OUT_OF_MEMORY; + } + + pPhysAddr = kmalloc(ulPages * sizeof(IMG_SYS_PHYADDR), GFP_KERNEL); + if (!pPhysAddr) + { + vfree(LinAddr); + return DC_ERROR_OUT_OF_MEMORY; + } + + *pLinAddr = LinAddr; + + for (ulPage = 0; ulPage < ulPages; ulPage++) + { + pPhysAddr[ulPage].uiAddr = VMALLOC_TO_PAGE_PHYS(LinAddr); + + LinAddr += PAGE_SIZE; + } + + *ppPhysAddr = pPhysAddr; + + return DC_OK; +} + +void FreeDiscontigMemory(unsigned long ulSize, + DC_HANDLE unref__ hMemHandle, + IMG_CPU_VIRTADDR LinAddr, + IMG_SYS_PHYADDR *pPhysAddr) +{ + kfree(pPhysAddr); + + vfree(LinAddr); +} +#else /* defined(DC_NOHW_DISCONTIG_BUFFERS) */ +DC_ERROR AllocContigMemory(unsigned long ulSize, + DC_HANDLE unref__ *phMemHandle, + IMG_CPU_VIRTADDR *pLinAddr, + IMG_CPU_PHYADDR *pPhysAddr) +{ +#if defined(DC_USE_SET_MEMORY) + void *pvLinAddr; + unsigned long ulAlignedSize = PAGE_ALIGN(ulSize); + int iPages = (int)(ulAlignedSize >> PAGE_SHIFT); + int iError; + + pvLinAddr = kmalloc(ulAlignedSize, GFP_KERNEL); + iError = set_memory_wc((unsigned long)pvLinAddr, iPages); + if (iError != 0) + { + printk(KERN_ERR DRVNAME ": AllocContigMemory: set_memory_wc failed (%d)\n", iError); + + return DC_ERROR_OUT_OF_MEMORY; + } + + pPhysAddr->uiAddr = virt_to_phys(pvLinAddr); + *pLinAddr = pvLinAddr; + + return DC_OK; +#else /* DC_USE_SET_MEMORY */ + dma_addr_t dma; + IMG_VOID *pvLinAddr; + + pvLinAddr = dma_alloc_coherent(NULL, ulSize, &dma, GFP_KERNEL); + + if (pvLinAddr == NULL) + { + return DC_ERROR_OUT_OF_MEMORY; + } + + pPhysAddr->uiAddr = dma; + *pLinAddr = pvLinAddr; + + return DC_OK; +#endif /* DC_USE_SET_MEMORY */ +} + +void FreeContigMemory(unsigned long ulSize, + DC_HANDLE unref__ hMemHandle, + IMG_CPU_VIRTADDR LinAddr, + IMG_CPU_PHYADDR PhysAddr) +{ +#if defined(DC_USE_SET_MEMORY) + unsigned long ulAlignedSize = PAGE_ALIGN(ulSize); + int iError; + int iPages = (int)(ulAlignedSize >> PAGE_SHIFT); + + iError = set_memory_wb((unsigned long)LinAddr, iPages); + if (iError != 0) + { + printk(KERN_ERR DRVNAME ": FreeContigMemory: set_memory_wb failed (%d)\n", iError); + } + kfree(LinAddr); +#else /* DC_USE_SET_MEMORY */ + dma_free_coherent(NULL, ulSize, LinAddr, (dma_addr_t)PhysAddr.uiAddr); +#endif /* DC_USE_SET_MEMORY */ +} +#endif /* defined(DC_NOHW_DISCONTIG_BUFFERS) */ + +DC_ERROR OpenPVRServices (DC_HANDLE *phPVRServices) +{ + /* Nothing to do - we have already checked services module insertion */ + *phPVRServices = 0; + return DC_OK; +} + +DC_ERROR ClosePVRServices (DC_HANDLE unref__ hPVRServices) +{ + /* Nothing to do */ + return DC_OK; +} + +DC_ERROR GetLibFuncAddr (DC_HANDLE unref__ hExtDrv, char *szFunctionName, PFN_DC_GET_PVRJTABLE *ppfnFuncTable) +{ + if(strcmp("PVRGetDisplayClassJTable", szFunctionName) != 0) + { + return DC_ERROR_INVALID_PARAMS; + } + + /* Nothing to do - should be exported from pvrsrv.ko */ + *ppfnFuncTable = PVRGetDisplayClassJTable; + + return DC_OK; +} + +#if !defined(SUPPORT_DRI_DRM) +/* + These macro calls define the initialisation and removal functions of the + driver. Although they are prefixed `module_', they apply when compiling + statically as well; in both cases they define the function the kernel will + run to start/stop the driver. +*/ +module_init(DC_NOHW_Init); +module_exit(DC_NOHW_Cleanup); +#endif diff --git a/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_omapfb3_linux/Kbuild.mk b/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_omapfb3_linux/Kbuild.mk new file mode 100644 index 0000000..7f4fd99 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_omapfb3_linux/Kbuild.mk @@ -0,0 +1,48 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +ccflags-y += \ + -I$(TOP)/services4/3rdparty/dc_omapfb3_linux \ + -I$(KERNELDIR)/drivers/video/omap2 \ + -I$(KERNELDIR)/arch/arm/plat-omap/include + +omaplfb-y += \ + services4/3rdparty/dc_omapfb3_linux/omaplfb_displayclass.o \ + services4/3rdparty/dc_omapfb3_linux/omaplfb_linux.o diff --git a/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_omapfb3_linux/Linux.mk b/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_omapfb3_linux/Linux.mk new file mode 100644 index 0000000..75d11a9 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_omapfb3_linux/Linux.mk @@ -0,0 +1,45 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +modules := dc_omapfb3_linux + +dc_omapfb3_linux_type := kernel_module +dc_omapfb3_linux_target := omaplfb.ko +dc_omapfb3_linux_makefile := $(THIS_DIR)/Kbuild.mk diff --git a/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_omapfb3_linux/omaplfb.h b/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_omapfb3_linux/omaplfb.h new file mode 100644 index 0000000..804695b --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_omapfb3_linux/omaplfb.h @@ -0,0 +1,323 @@ +/*************************************************************************/ /*! +@Title OMAP Linux display driver structures and prototypes +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ +#ifndef __OMAPLFB_H__ +#define __OMAPLFB_H__ + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#ifdef CONFIG_HAS_EARLYSUSPEND +#include +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) +#define OMAPLFB_CONSOLE_LOCK() console_lock() +#define OMAPLFB_CONSOLE_UNLOCK() console_unlock() +#else +#define OMAPLFB_CONSOLE_LOCK() acquire_console_sem() +#define OMAPLFB_CONSOLE_UNLOCK() release_console_sem() +#endif + +#define unref__ __attribute__ ((unused)) + +typedef void * OMAPLFB_HANDLE; + +typedef bool OMAPLFB_BOOL, *OMAPLFB_PBOOL; +#define OMAPLFB_FALSE false +#define OMAPLFB_TRUE true + +typedef atomic_t OMAPLFB_ATOMIC_BOOL; + +typedef atomic_t OMAPLFB_ATOMIC_INT; + +/* OMAPLFB buffer structure */ +typedef struct OMAPLFB_BUFFER_TAG +{ + struct OMAPLFB_BUFFER_TAG *psNext; + struct OMAPLFB_DEVINFO_TAG *psDevInfo; + + struct work_struct sWork; + + /* Position of this buffer in the virtual framebuffer */ + unsigned long ulYOffset; + + /* IMG structures used, to minimise API function code */ + /* replace with own structures where necessary */ + IMG_SYS_PHYADDR sSysAddr; + IMG_CPU_VIRTADDR sCPUVAddr; + PVRSRV_SYNC_DATA *psSyncData; + + OMAPLFB_HANDLE hCmdComplete; + unsigned long ulSwapInterval; +} OMAPLFB_BUFFER; + +/* OMAPLFB swapchain structure */ +typedef struct OMAPLFB_SWAPCHAIN_TAG +{ + /* Swap chain ID */ + unsigned int uiSwapChainID; + + /* number of buffers in swapchain */ + unsigned long ulBufferCount; + + /* list of buffers in the swapchain */ + OMAPLFB_BUFFER *psBuffer; + + /* Swap chain work queue */ + struct workqueue_struct *psWorkQueue; + + /* + * Set if we didn't manage to wait for VSync on last swap, + * or if we think we need to wait for VSync on the next flip. + * The flag helps to avoid jitter when the screen is + * unblanked, by forcing an extended wait for VSync before + * attempting the next flip. + */ + OMAPLFB_BOOL bNotVSynced; + + /* Previous number of blank events */ + int iBlankEvents; + + /* Framebuffer Device ID for messages (e.g. printk) */ + unsigned int uiFBDevID; +} OMAPLFB_SWAPCHAIN; + +typedef struct OMAPLFB_FBINFO_TAG +{ + unsigned long ulFBSize; + unsigned long ulBufferSize; + unsigned long ulRoundedBufferSize; + unsigned long ulWidth; + unsigned long ulHeight; + unsigned long ulByteStride; + unsigned long ulPhysicalWidthmm; + unsigned long ulPhysicalHeightmm; + + /* IMG structures used, to minimise API function code */ + /* replace with own structures where necessary */ + IMG_SYS_PHYADDR sSysAddr;//system physical address + IMG_CPU_VIRTADDR sCPUVAddr; + + /* pixelformat of system/primary surface */ + PVRSRV_PIXEL_FORMAT ePixelFormat; + +#if defined(CONFIG_DSSCOMP) + OMAPLFB_BOOL bIs2D; + IMG_SYS_PHYADDR *psPageList; + struct ion_handle *psIONHandle; + IMG_UINT32 uiBytesPerPixel; +#endif +} OMAPLFB_FBINFO; + +/* kernel device information structure */ +typedef struct OMAPLFB_DEVINFO_TAG +{ + /* Framebuffer Device ID */ + unsigned int uiFBDevID; + + /* PVR Device ID */ + unsigned int uiPVRDevID; + + /* Swapchain create/destroy mutex */ + struct mutex sCreateSwapChainMutex; + + /* system surface info */ + OMAPLFB_BUFFER sSystemBuffer; + + /* jump table into PVR services */ + PVRSRV_DC_DISP2SRV_KMJTABLE sPVRJTable; + + /* jump table into DC */ + PVRSRV_DC_SRV2DISP_KMJTABLE sDCJTable; + + /* fb info structure */ + OMAPLFB_FBINFO sFBInfo; + + /* Only one swapchain supported by this device so hang it here */ + OMAPLFB_SWAPCHAIN *psSwapChain; + + /* Swap chain ID */ + unsigned int uiSwapChainID; + + /* True if PVR Services is flushing its command queues */ + OMAPLFB_ATOMIC_BOOL sFlushCommands; + + /* pointer to linux frame buffer information structure */ + struct fb_info *psLINFBInfo; + + /* Linux Framebuffer event notification block */ + struct notifier_block sLINNotifBlock; + + /* IMG structures used, to minimise API function code */ + /* replace with own structures where necessary */ + + /* Address of the surface being displayed */ + IMG_DEV_VIRTADDR sDisplayDevVAddr; + + DISPLAY_INFO sDisplayInfo; + + /* Display format */ + DISPLAY_FORMAT sDisplayFormat; + + /* Display dimensions */ + DISPLAY_DIMS sDisplayDim; + + /* True if screen is blanked */ + OMAPLFB_ATOMIC_BOOL sBlanked; + + /* Number of blank/unblank events */ + OMAPLFB_ATOMIC_INT sBlankEvents; + +#ifdef CONFIG_HAS_EARLYSUSPEND + /* Set by early suspend */ + OMAPLFB_ATOMIC_BOOL sEarlySuspendFlag; + + struct early_suspend sEarlySuspend; +#endif + +#if defined(SUPPORT_DRI_DRM) + OMAPLFB_ATOMIC_BOOL sLeaveVT; +#endif + +} OMAPLFB_DEVINFO; + +#define OMAPLFB_PAGE_SIZE 4096 + +/* DEBUG only printk */ +#ifdef DEBUG +#define DEBUG_PRINTK(x) printk x +#else +#define DEBUG_PRINTK(x) +#endif + +#define DISPLAY_DEVICE_NAME "PowerVR OMAP Linux Display Driver" +#define DRVNAME "omaplfb" +#define DEVNAME DRVNAME +#define DRIVER_PREFIX DRVNAME + +/*! + ***************************************************************************** + * Error values + *****************************************************************************/ +typedef enum _OMAPLFB_ERROR_ +{ + OMAPLFB_OK = 0, + OMAPLFB_ERROR_GENERIC = 1, + OMAPLFB_ERROR_OUT_OF_MEMORY = 2, + OMAPLFB_ERROR_TOO_FEW_BUFFERS = 3, + OMAPLFB_ERROR_INVALID_PARAMS = 4, + OMAPLFB_ERROR_INIT_FAILURE = 5, + OMAPLFB_ERROR_CANT_REGISTER_CALLBACK = 6, + OMAPLFB_ERROR_INVALID_DEVICE = 7, + OMAPLFB_ERROR_DEVICE_REGISTER_FAILED = 8, + OMAPLFB_ERROR_SET_UPDATE_MODE_FAILED = 9 +} OMAPLFB_ERROR; + +typedef enum _OMAPLFB_UPDATE_MODE_ +{ + OMAPLFB_UPDATE_MODE_UNDEFINED = 0, + OMAPLFB_UPDATE_MODE_MANUAL = 1, + OMAPLFB_UPDATE_MODE_AUTO = 2, + OMAPLFB_UPDATE_MODE_DISABLED = 3 +} OMAPLFB_UPDATE_MODE; + +#ifndef UNREFERENCED_PARAMETER +#define UNREFERENCED_PARAMETER(param) (param) = (param) +#endif + +OMAPLFB_ERROR OMAPLFBInit(void); +OMAPLFB_ERROR OMAPLFBDeInit(void); + +/* OS Specific APIs */ +OMAPLFB_DEVINFO *OMAPLFBGetDevInfoPtr(unsigned uiFBDevID); +unsigned OMAPLFBMaxFBDevIDPlusOne(void); +void *OMAPLFBAllocKernelMem(unsigned long ulSize); +void OMAPLFBFreeKernelMem(void *pvMem); +OMAPLFB_ERROR OMAPLFBGetLibFuncAddr(char *szFunctionName, PFN_DC_GET_PVRJTABLE *ppfnFuncTable); +OMAPLFB_ERROR OMAPLFBCreateSwapQueue (OMAPLFB_SWAPCHAIN *psSwapChain); +void OMAPLFBDestroySwapQueue(OMAPLFB_SWAPCHAIN *psSwapChain); +void OMAPLFBInitBufferForSwap(OMAPLFB_BUFFER *psBuffer); +void OMAPLFBSwapHandler(OMAPLFB_BUFFER *psBuffer); +void OMAPLFBQueueBufferForSwap(OMAPLFB_SWAPCHAIN *psSwapChain, OMAPLFB_BUFFER *psBuffer); +void OMAPLFBFlip(OMAPLFB_DEVINFO *psDevInfo, OMAPLFB_BUFFER *psBuffer); +OMAPLFB_UPDATE_MODE OMAPLFBGetUpdateMode(OMAPLFB_DEVINFO *psDevInfo); +OMAPLFB_BOOL OMAPLFBSetUpdateMode(OMAPLFB_DEVINFO *psDevInfo, OMAPLFB_UPDATE_MODE eMode); +OMAPLFB_BOOL OMAPLFBWaitForVSync(OMAPLFB_DEVINFO *psDevInfo); +OMAPLFB_BOOL OMAPLFBManualSync(OMAPLFB_DEVINFO *psDevInfo); +OMAPLFB_BOOL OMAPLFBCheckModeAndSync(OMAPLFB_DEVINFO *psDevInfo); +OMAPLFB_ERROR OMAPLFBUnblankDisplay(OMAPLFB_DEVINFO *psDevInfo); +OMAPLFB_ERROR OMAPLFBEnableLFBEventNotification(OMAPLFB_DEVINFO *psDevInfo); +OMAPLFB_ERROR OMAPLFBDisableLFBEventNotification(OMAPLFB_DEVINFO *psDevInfo); +void OMAPLFBCreateSwapChainLockInit(OMAPLFB_DEVINFO *psDevInfo); +void OMAPLFBCreateSwapChainLockDeInit(OMAPLFB_DEVINFO *psDevInfo); +void OMAPLFBCreateSwapChainLock(OMAPLFB_DEVINFO *psDevInfo); +void OMAPLFBCreateSwapChainUnLock(OMAPLFB_DEVINFO *psDevInfo); +void OMAPLFBAtomicBoolInit(OMAPLFB_ATOMIC_BOOL *psAtomic, OMAPLFB_BOOL bVal); +void OMAPLFBAtomicBoolDeInit(OMAPLFB_ATOMIC_BOOL *psAtomic); +void OMAPLFBAtomicBoolSet(OMAPLFB_ATOMIC_BOOL *psAtomic, OMAPLFB_BOOL bVal); +OMAPLFB_BOOL OMAPLFBAtomicBoolRead(OMAPLFB_ATOMIC_BOOL *psAtomic); +void OMAPLFBAtomicIntInit(OMAPLFB_ATOMIC_INT *psAtomic, int iVal); +void OMAPLFBAtomicIntDeInit(OMAPLFB_ATOMIC_INT *psAtomic); +void OMAPLFBAtomicIntSet(OMAPLFB_ATOMIC_INT *psAtomic, int iVal); +int OMAPLFBAtomicIntRead(OMAPLFB_ATOMIC_INT *psAtomic); +void OMAPLFBAtomicIntInc(OMAPLFB_ATOMIC_INT *psAtomic); + +#if defined(DEBUG) +void OMAPLFBPrintInfo(OMAPLFB_DEVINFO *psDevInfo); +#else +#define OMAPLFBPrintInfo(psDevInfo) +#endif + +#endif /* __OMAPLFB_H__ */ + +/****************************************************************************** + End of file (omaplfb.h) +******************************************************************************/ + diff --git a/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_omapfb3_linux/omaplfb_displayclass.c b/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_omapfb3_linux/omaplfb_displayclass.c new file mode 100644 index 0000000..ebca814 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/services4/3rdparty/dc_omapfb3_linux/omaplfb_displayclass.c @@ -0,0 +1,1722 @@ +/*************************************************************************/ /*! +@Title OMAP common display driver components +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +/************************************************************************** + The 3rd party driver is a specification of an API to integrate the IMG POWERVR + Services driver with 3rd Party display hardware. It is NOT a specification for + a display controller driver, rather a specification to extend the API for a + pre-existing driver for the display hardware. + + The 3rd party driver interface provides IMG POWERVR client drivers (e.g. PVR2D) + with an API abstraction of the system's underlying display hardware, allowing + the client drivers to indirectly control the display hardware and access its + associated memory. + + Functions of the API include + - query primary surface attributes (width, height, stride, pixel format, CPU + physical and virtual address) + - swap/flip chain creation and subsequent query of surface attributes + - asynchronous display surface flipping, taking account of asynchronous read + (flip) and write (render) operations to the display surface + + Note: having queried surface attributes the client drivers are able to map the + display memory to any IMG POWERVR Services device by calling + PVRSRVMapDeviceClassMemory with the display surface handle. + + This code is intended to be an example of how a pre-existing display driver may + be extended to support the 3rd Party Display interface to POWERVR Services + - IMG is not providing a display driver implementation. + **************************************************************************/ + +/* + * OMAP Linux 3rd party display driver. + * This is based on the Generic PVR Linux Framebuffer 3rd party display + * driver, with OMAP specific extensions to support flipping. + */ + +#include +#include +#include +#include +#include +#include +#include + +/* IMG services headers */ +#include "img_defs.h" +#include "servicesext.h" +#include "kerneldisplay.h" +#include "omaplfb.h" + +#if defined(CONFIG_DSSCOMP) + +#if !defined(CONFIG_ION_OMAP) +#error CONFIG_DSSCOMP support requires CONFIG_ION_OMAP +#endif + +#include +#include + +extern struct ion_client *gpsIONClient; + +#include +#include