summaryrefslogtreecommitdiff
path: root/liboffloadmic/runtime/emulator
diff options
context:
space:
mode:
Diffstat (limited to 'liboffloadmic/runtime/emulator')
-rw-r--r--liboffloadmic/runtime/emulator/coi_common.h7
-rw-r--r--liboffloadmic/runtime/emulator/coi_device.cpp23
-rw-r--r--liboffloadmic/runtime/emulator/coi_device.h2
-rw-r--r--liboffloadmic/runtime/emulator/coi_host.cpp151
-rw-r--r--liboffloadmic/runtime/emulator/coi_host.h2
-rw-r--r--liboffloadmic/runtime/emulator/coi_version_asm.h81
-rw-r--r--liboffloadmic/runtime/emulator/coi_version_linker_script.map14
-rw-r--r--liboffloadmic/runtime/emulator/myo_client.cpp2
-rw-r--r--liboffloadmic/runtime/emulator/myo_service.cpp46
-rw-r--r--liboffloadmic/runtime/emulator/myo_service.h2
-rw-r--r--liboffloadmic/runtime/emulator/myo_version_asm.h32
-rw-r--r--liboffloadmic/runtime/emulator/myo_version_linker_script.map10
12 files changed, 291 insertions, 81 deletions
diff --git a/liboffloadmic/runtime/emulator/coi_common.h b/liboffloadmic/runtime/emulator/coi_common.h
index 482c8885437..7eae324ee74 100644
--- a/liboffloadmic/runtime/emulator/coi_common.h
+++ b/liboffloadmic/runtime/emulator/coi_common.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2014 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2014-2015 Intel Corporation. All Rights Reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -62,8 +62,8 @@
/* Environment variable for target executable run command. */
#define OFFLOAD_EMUL_RUN_ENV "OFFLOAD_EMUL_RUN"
-/* Environment variable for number ok KNC devices. */
-#define OFFLOAD_EMUL_KNC_NUM_ENV "OFFLOAD_EMUL_KNC_NUM"
+/* Environment variable for number of emulated devices. */
+#define OFFLOAD_EMUL_NUM_ENV "OFFLOAD_EMUL_NUM"
/* Path to engine directory. */
@@ -133,6 +133,7 @@ typedef enum
CMD_BUFFER_UNMAP,
CMD_GET_FUNCTION_HANDLE,
CMD_OPEN_LIBRARY,
+ CMD_CLOSE_LIBRARY,
CMD_RUN_FUNCTION,
CMD_SHUTDOWN
} cmd_t;
diff --git a/liboffloadmic/runtime/emulator/coi_device.cpp b/liboffloadmic/runtime/emulator/coi_device.cpp
index 1a89a3f55df..8773a7910ce 100644
--- a/liboffloadmic/runtime/emulator/coi_device.cpp
+++ b/liboffloadmic/runtime/emulator/coi_device.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2014 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2014-2015 Intel Corporation. All Rights Reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -109,8 +109,8 @@ SYMBOL_VERSION (COIProcessWaitForShutdown, 1) ()
strlen (PIPE_HOST_PATH) + strlen (mic_dir) + 1);
MALLOC (char *, pipe_target_path,
strlen (PIPE_TARGET_PATH) + strlen (mic_dir) + 1);
- sprintf (pipe_host_path, "%s"PIPE_HOST_PATH, mic_dir);
- sprintf (pipe_target_path, "%s"PIPE_TARGET_PATH, mic_dir);
+ sprintf (pipe_host_path, "%s" PIPE_HOST_PATH, mic_dir);
+ sprintf (pipe_target_path, "%s" PIPE_TARGET_PATH, mic_dir);
pipe_host = open (pipe_host_path, O_CLOEXEC | O_WRONLY);
if (pipe_host < 0)
COIERROR ("Cannot open target-to-host pipe.");
@@ -237,6 +237,7 @@ SYMBOL_VERSION (COIProcessWaitForShutdown, 1) ()
{
char *lib_path;
size_t len;
+ void *handle;
/* Receive data from host. */
READ (pipe_target, &len, sizeof (size_t));
@@ -244,14 +245,28 @@ SYMBOL_VERSION (COIProcessWaitForShutdown, 1) ()
READ (pipe_target, lib_path, len);
/* Open library. */
- if (dlopen (lib_path, RTLD_LAZY | RTLD_GLOBAL) == 0)
+ handle = dlopen (lib_path, RTLD_LAZY | RTLD_GLOBAL);
+ if (handle == NULL)
COIERROR ("Cannot load %s: %s", lib_path, dlerror ());
+ /* Send data to host. */
+ WRITE (pipe_host, &handle, sizeof (void *));
+
/* Clean up. */
free (lib_path);
break;
}
+ case CMD_CLOSE_LIBRARY:
+ {
+ /* Receive data from host. */
+ void *handle;
+ READ (pipe_target, &handle, sizeof (void *));
+
+ dlclose (handle);
+
+ break;
+ }
case CMD_RUN_FUNCTION:
{
uint16_t misc_data_len, return_data_len;
diff --git a/liboffloadmic/runtime/emulator/coi_device.h b/liboffloadmic/runtime/emulator/coi_device.h
index 779fdae69e7..616c91849ac 100644
--- a/liboffloadmic/runtime/emulator/coi_device.h
+++ b/liboffloadmic/runtime/emulator/coi_device.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2014 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2014-2015 Intel Corporation. All Rights Reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
diff --git a/liboffloadmic/runtime/emulator/coi_host.cpp b/liboffloadmic/runtime/emulator/coi_host.cpp
index 3425920a4a1..cdc04c208e4 100644
--- a/liboffloadmic/runtime/emulator/coi_host.cpp
+++ b/liboffloadmic/runtime/emulator/coi_host.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2014 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2014-2015 Intel Corporation. All Rights Reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -40,8 +40,8 @@ extern char **environ;
char **tmp_dirs;
unsigned tmp_dirs_num = 0;
-/* Number of KNC engines. */
-long knc_engines_num;
+/* Number of emulated MIC engines. */
+long num_engines;
/* Mutex to sync parallel execution. */
pthread_mutex_t mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
@@ -116,8 +116,7 @@ __attribute__((constructor))
static void
init ()
{
- if (read_long_env (OFFLOAD_EMUL_KNC_NUM_ENV, &knc_engines_num, 1)
- == COI_ERROR)
+ if (read_long_env (OFFLOAD_EMUL_NUM_ENV, &num_engines, 1) == COI_ERROR)
exit (0);
}
@@ -665,10 +664,10 @@ SYMBOL_VERSION (COIEngineGetCount, 1) (COI_ISA_TYPE isa,
COITRACE ("COIEngineGetCount");
/* Features of liboffload. */
- assert (isa == COI_ISA_KNC);
+ assert (isa == COI_ISA_MIC);
/* Prepare output arguments. */
- *count = knc_engines_num;
+ *count = num_engines;
return COI_SUCCESS;
}
@@ -684,10 +683,10 @@ SYMBOL_VERSION (COIEngineGetHandle, 1) (COI_ISA_TYPE isa,
Engine *engine;
/* Features of liboffload. */
- assert (isa == COI_ISA_KNC);
+ assert (isa == COI_ISA_MIC);
/* Check engine index. */
- if (index >= knc_engines_num)
+ if (index >= num_engines)
COIERROR ("Wrong engine index.");
/* Create engine handle. */
@@ -889,7 +888,7 @@ SYMBOL_VERSION (COIProcessCreateFromMemory, 1) (COIENGINE engine,
/* Create directory for pipes to prevent names collision. */
MALLOC (char *, pipes_path, strlen (PIPES_PATH) + strlen (eng->dir) + 1);
- sprintf (pipes_path, "%s"PIPES_PATH, eng->dir);
+ sprintf (pipes_path, "%s" PIPES_PATH, eng->dir);
if (mkdir (pipes_path, S_IRWXU) < 0)
COIERROR ("Cannot create folder %s.", pipes_path);
@@ -900,8 +899,8 @@ SYMBOL_VERSION (COIProcessCreateFromMemory, 1) (COIENGINE engine,
strlen (PIPE_TARGET_PATH) + strlen (eng->dir) + 1);
if (pipe_target_path == NULL)
COIERROR ("Cannot allocate memory.");
- sprintf (pipe_host_path, "%s"PIPE_HOST_PATH, eng->dir);
- sprintf (pipe_target_path, "%s"PIPE_TARGET_PATH, eng->dir);
+ sprintf (pipe_host_path, "%s" PIPE_HOST_PATH, eng->dir);
+ sprintf (pipe_target_path, "%s" PIPE_TARGET_PATH, eng->dir);
if (mkfifo (pipe_host_path, S_IRUSR | S_IWUSR) < 0)
COIERROR ("Cannot create pipe %s.", pipe_host_path);
if (mkfifo (pipe_target_path, S_IRUSR | S_IWUSR) < 0)
@@ -1019,6 +1018,27 @@ SYMBOL_VERSION (COIProcessCreateFromMemory, 1) (COIENGINE engine,
COIRESULT
+SYMBOL_VERSION (COIProcessCreateFromFile, 1) (COIENGINE in_Engine,
+ const char *in_pBinaryName,
+ int in_Argc,
+ const char **in_ppArgv,
+ uint8_t in_DupEnv,
+ const char **in_ppAdditionalEnv,
+ uint8_t in_ProxyActive,
+ const char *in_Reserved,
+ uint64_t in_BufferSpace,
+ const char *in_LibrarySearchPath,
+ COIPROCESS *out_pProcess)
+{
+ COITRACE ("COIProcessCreateFromFile");
+
+ /* liboffloadmic with GCC compiled binaries should never go here. */
+ assert (false);
+ return COI_ERROR;
+}
+
+
+COIRESULT
SYMBOL_VERSION (COIProcessDestroy, 1) (COIPROCESS process,
int32_t wait_timeout, // Ignored
uint8_t force,
@@ -1129,38 +1149,39 @@ SYMBOL_VERSION (COIProcessGetFunctionHandles, 1) (COIPROCESS process,
COIRESULT
-SYMBOL_VERSION (COIProcessLoadLibraryFromMemory, 2) (COIPROCESS process,
- const void *lib_buffer,
- uint64_t lib_buffer_len,
- const char *lib_name,
- const char *lib_search_path,
- const char *file_of_origin, // Ignored
- uint64_t file_from_origin_offset, // Ignored
- uint32_t flags, // Ignored
- COILIBRARY *library) // Ignored
+SYMBOL_VERSION (COIProcessLoadLibraryFromMemory, 2) (COIPROCESS in_Process,
+ const void *in_pLibraryBuffer,
+ uint64_t in_LibraryBufferLength,
+ const char *in_pLibraryName,
+ const char *in_LibrarySearchPath, // Ignored
+ const char *in_FileOfOrigin, // Ignored
+ uint64_t in_FileOfOriginOffset, // Ignored
+ uint32_t in_Flags, // Ignored
+ COILIBRARY *out_pLibrary)
{
COITRACE ("COIProcessLoadLibraryFromMemory");
+ const cmd_t cmd = CMD_OPEN_LIBRARY;
char *lib_path;
- cmd_t cmd = CMD_OPEN_LIBRARY;
int fd;
FILE *file;
size_t len;
/* Convert input arguments. */
- Process *proc = (Process *) process;
+ Process *proc = (Process *) in_Process;
/* Create target library file. */
MALLOC (char *, lib_path,
- strlen (proc->engine->dir) + strlen (lib_name) + 2);
- sprintf (lib_path, "%s/%s", proc->engine->dir, lib_name);
+ strlen (proc->engine->dir) + strlen (in_pLibraryName) + 2);
+ sprintf (lib_path, "%s/%s", proc->engine->dir, in_pLibraryName);
fd = open (lib_path, O_CLOEXEC | O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR);
if (fd < 0)
COIERROR ("Cannot create file %s.", lib_path);
file = fdopen (fd, "wb");
if (file == NULL)
COIERROR ("Cannot associate stream with file descriptor.");
- if (fwrite (lib_buffer, 1, lib_buffer_len, file) != lib_buffer_len)
+ if (fwrite (in_pLibraryBuffer, 1, in_LibraryBufferLength, file)
+ != in_LibraryBufferLength)
COIERROR ("Cannot write in file %s.", lib_path);
if (fclose (file) != 0)
COIERROR ("Cannot close file %s.", lib_path);
@@ -1176,6 +1197,10 @@ SYMBOL_VERSION (COIProcessLoadLibraryFromMemory, 2) (COIPROCESS process,
WRITE (proc->pipeline->pipe_target, &len, sizeof (size_t));
WRITE (proc->pipeline->pipe_target, lib_path, len);
+ /* Receive data from target. */
+ void *handle;
+ READ (proc->pipeline->pipe_host, &handle, sizeof (void *));
+
/* Finish critical section. */
if (pthread_mutex_unlock (&mutex) != 0)
COIERROR ("Cannot unlock mutex.");
@@ -1183,6 +1208,7 @@ SYMBOL_VERSION (COIProcessLoadLibraryFromMemory, 2) (COIPROCESS process,
/* Clean up. */
free (lib_path);
+ *out_pLibrary = (COILIBRARY) handle;
return COI_SUCCESS;
}
@@ -1202,6 +1228,33 @@ SYMBOL_VERSION (COIProcessRegisterLibraries, 1) (uint32_t libraries_num,
}
+COIRESULT
+SYMBOL_VERSION (COIProcessUnloadLibrary, 1) (COIPROCESS in_Process,
+ COILIBRARY in_Library)
+{
+ COITRACE ("COIProcessUnloadLibrary");
+
+ const cmd_t cmd = CMD_CLOSE_LIBRARY;
+
+ /* Convert input arguments. */
+ Process *proc = (Process *) in_Process;
+
+ /* Start critical section. */
+ if (pthread_mutex_lock (&mutex) != 0)
+ COIERROR ("Cannot lock mutex.");
+
+ /* Make target close library. */
+ WRITE (proc->pipeline->pipe_target, &cmd, sizeof (cmd_t));
+ WRITE (proc->pipeline->pipe_target, &in_Library, sizeof (void *));
+
+ /* Finish critical section. */
+ if (pthread_mutex_unlock (&mutex) != 0)
+ COIERROR ("Cannot unlock mutex.");
+
+ return COI_SUCCESS;
+}
+
+
uint64_t
SYMBOL_VERSION (COIPerfGetCycleFrequency, 1) ()
{
@@ -1210,5 +1263,51 @@ SYMBOL_VERSION (COIPerfGetCycleFrequency, 1) ()
return (uint64_t) CYCLE_FREQUENCY;
}
+
+COIRESULT
+SYMBOL_VERSION (COIPipelineClearCPUMask, 1) (COI_CPU_MASK *in_Mask)
+{
+ COITRACE ("COIPipelineClearCPUMask");
+
+ /* Looks like we have nothing to do here. */
+
+ return COI_SUCCESS;
+}
+
+
+COIRESULT
+SYMBOL_VERSION (COIPipelineSetCPUMask, 1) (COIPROCESS in_Process,
+ uint32_t in_CoreID,
+ uint8_t in_ThreadID,
+ COI_CPU_MASK *out_pMask)
+{
+ COITRACE ("COIPipelineSetCPUMask");
+
+ /* Looks like we have nothing to do here. */
+
+ return COI_SUCCESS;
+}
+
+
+COIRESULT
+SYMBOL_VERSION (COIEngineGetInfo, 1) (COIENGINE in_EngineHandle,
+ uint32_t in_EngineInfoSize,
+ COI_ENGINE_INFO *out_pEngineInfo)
+{
+ COITRACE ("COIEngineGetInfo");
+
+ out_pEngineInfo->ISA = COI_ISA_x86_64;
+ out_pEngineInfo->NumCores = 1;
+ out_pEngineInfo->NumThreads = 8;
+ out_pEngineInfo->CoreMaxFrequency = SYMBOL_VERSION(COIPerfGetCycleFrequency,1)() / 1000000;
+ out_pEngineInfo->PhysicalMemory = 1024;
+ out_pEngineInfo->PhysicalMemoryFree = 1024;
+ out_pEngineInfo->SwapMemory = 1024;
+ out_pEngineInfo->SwapMemoryFree = 1024;
+ out_pEngineInfo->MiscFlags = COI_ENG_ECC_DISABLED;
+
+ return COI_SUCCESS;
+}
+
} // extern "C"
diff --git a/liboffloadmic/runtime/emulator/coi_host.h b/liboffloadmic/runtime/emulator/coi_host.h
index 58ebd97ed7e..82260da9db9 100644
--- a/liboffloadmic/runtime/emulator/coi_host.h
+++ b/liboffloadmic/runtime/emulator/coi_host.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2014 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2014-2015 Intel Corporation. All Rights Reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
diff --git a/liboffloadmic/runtime/emulator/coi_version_asm.h b/liboffloadmic/runtime/emulator/coi_version_asm.h
index 672d062d72f..25806391b29 100644
--- a/liboffloadmic/runtime/emulator/coi_version_asm.h
+++ b/liboffloadmic/runtime/emulator/coi_version_asm.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2013 Intel Corporation.
+ * Copyright 2010-2015 Intel Corporation.
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
@@ -38,31 +38,54 @@
* intellectual property rights is granted herein.
*/
-__asm__ (".symver COIBufferAddRef1,COIBufferAddRef@@COI_1.0");
-__asm__ (".symver COIBufferCopy1,COIBufferCopy@@COI_1.0");
-__asm__ (".symver COIBufferCreate1,COIBufferCreate@@COI_1.0");
-__asm__ (".symver COIBufferCreateFromMemory1,COIBufferCreateFromMemory@@COI_1.0");
-__asm__ (".symver COIBufferDestroy1,COIBufferDestroy@@COI_1.0");
-__asm__ (".symver COIBufferGetSinkAddress1,COIBufferGetSinkAddress@@COI_1.0");
-__asm__ (".symver COIBufferMap1,COIBufferMap@@COI_1.0");
-__asm__ (".symver COIBufferRead1,COIBufferRead@@COI_1.0");
-__asm__ (".symver COIBufferReleaseRef1,COIBufferReleaseRef@@COI_1.0");
-__asm__ (".symver COIBufferSetState1,COIBufferSetState@@COI_1.0");
-__asm__ (".symver COIBufferUnmap1,COIBufferUnmap@@COI_1.0");
-__asm__ (".symver COIBufferWrite1,COIBufferWrite@@COI_1.0");
-__asm__ (".symver COIEngineGetCount1,COIEngineGetCount@@COI_1.0");
-__asm__ (".symver COIEngineGetHandle1,COIEngineGetHandle@@COI_1.0");
-__asm__ (".symver COIEngineGetIndex1,COIEngineGetIndex@@COI_1.0");
-__asm__ (".symver COIEventWait1,COIEventWait@@COI_1.0");
-__asm__ (".symver COIPerfGetCycleFrequency1,COIPerfGetCycleFrequency@@COI_1.0");
-__asm__ (".symver COIPipelineCreate1,COIPipelineCreate@@COI_1.0");
-__asm__ (".symver COIPipelineDestroy1,COIPipelineDestroy@@COI_1.0");
-__asm__ (".symver COIPipelineRunFunction1,COIPipelineRunFunction@@COI_1.0");
-__asm__ (".symver COIPipelineStartExecutingRunFunctions1,COIPipelineStartExecutingRunFunctions@@COI_1.0");
-__asm__ (".symver COIProcessCreateFromMemory1,COIProcessCreateFromMemory@@COI_1.0");
-__asm__ (".symver COIProcessDestroy1,COIProcessDestroy@@COI_1.0");
-__asm__ (".symver COIProcessGetFunctionHandles1,COIProcessGetFunctionHandles@@COI_1.0");
-__asm__ (".symver COIProcessLoadLibraryFromMemory2,COIProcessLoadLibraryFromMemory@COI_2.0");
-__asm__ (".symver COIProcessRegisterLibraries1,COIProcessRegisterLibraries@@COI_1.0");
-__asm__ (".symver COIProcessWaitForShutdown1,COIProcessWaitForShutdown@@COI_1.0");
-
+// Originally generated via:
+// cd include;
+// ctags -x --c-kinds=fp -R sink/ source/ common/ | grep -v COIX | awk '{print "__asm__(\".symver "$1"1,"$1"@@COI_1.0\");"}'
+//
+// These directives must have an associated linker script with VERSION stuff.
+// See coi_version_linker_script.map
+// Passed in as
+// -Wl,--version-script coi_version_linker_script.map
+// when building Intel(R) Coprocessor Offload Infrastructure (Intel(R) COI)
+//
+// See http://sourceware.org/binutils/docs/ld/VERSION.html#VERSION for more info
+//
+// This is not strictly a .h file, so no need to #pragma once or anything.
+// You must include these asm directives in the same translation unit as the
+// one where the function body is.
+// Otherwise we'd have add this file to the list of files needed to build
+// libcoi*, instead of including it in each of the api/*/*cpp files.
+//
+__asm__(".symver COIBufferAddRef1,COIBufferAddRef@@COI_1.0");
+__asm__(".symver COIBufferCopy1,COIBufferCopy@@COI_1.0");
+__asm__(".symver COIBufferCreate1,COIBufferCreate@@COI_1.0");
+__asm__(".symver COIBufferCreateFromMemory1,COIBufferCreateFromMemory@@COI_1.0");
+__asm__(".symver COIBufferDestroy1,COIBufferDestroy@@COI_1.0");
+__asm__(".symver COIBufferGetSinkAddress1,COIBufferGetSinkAddress@@COI_1.0");
+__asm__(".symver COIBufferMap1,COIBufferMap@@COI_1.0");
+__asm__(".symver COIBufferRead1,COIBufferRead@@COI_1.0");
+__asm__(".symver COIBufferReleaseRef1,COIBufferReleaseRef@@COI_1.0");
+__asm__(".symver COIBufferSetState1,COIBufferSetState@@COI_1.0");
+__asm__(".symver COIBufferUnmap1,COIBufferUnmap@@COI_1.0");
+__asm__(".symver COIBufferWrite1,COIBufferWrite@@COI_1.0");
+__asm__(".symver COIEngineGetCount1,COIEngineGetCount@@COI_1.0");
+__asm__(".symver COIEngineGetHandle1,COIEngineGetHandle@@COI_1.0");
+__asm__(".symver COIEngineGetIndex1,COIEngineGetIndex@@COI_1.0");
+__asm__(".symver COIEngineGetInfo1,COIEngineGetInfo@@COI_1.0");
+__asm__(".symver COIEventRegisterCallback1,COIEventRegisterCallback@@COI_1.0");
+__asm__(".symver COIEventWait1,COIEventWait@@COI_1.0");
+__asm__(".symver COIPerfGetCycleFrequency1,COIPerfGetCycleFrequency@@COI_1.0");
+__asm__(".symver COIPipelineClearCPUMask1,COIPipelineClearCPUMask@@COI_1.0");
+__asm__(".symver COIPipelineCreate1,COIPipelineCreate@@COI_1.0");
+__asm__(".symver COIPipelineDestroy1,COIPipelineDestroy@@COI_1.0");
+__asm__(".symver COIPipelineRunFunction1,COIPipelineRunFunction@@COI_1.0");
+__asm__(".symver COIPipelineSetCPUMask1,COIPipelineSetCPUMask@@COI_1.0");
+__asm__(".symver COIPipelineStartExecutingRunFunctions1,COIPipelineStartExecutingRunFunctions@@COI_1.0");
+__asm__(".symver COIProcessCreateFromFile1,COIProcessCreateFromFile@@COI_1.0");
+__asm__(".symver COIProcessCreateFromMemory1,COIProcessCreateFromMemory@@COI_1.0");
+__asm__(".symver COIProcessDestroy1,COIProcessDestroy@@COI_1.0");
+__asm__(".symver COIProcessGetFunctionHandles1,COIProcessGetFunctionHandles@@COI_1.0");
+__asm__(".symver COIProcessLoadLibraryFromMemory2,COIProcessLoadLibraryFromMemory@COI_2.0");
+__asm__(".symver COIProcessRegisterLibraries1,COIProcessRegisterLibraries@@COI_1.0");
+__asm__(".symver COIProcessUnloadLibrary1,COIProcessUnloadLibrary@@COI_1.0");
+__asm__(".symver COIProcessWaitForShutdown1,COIProcessWaitForShutdown@@COI_1.0");
diff --git a/liboffloadmic/runtime/emulator/coi_version_linker_script.map b/liboffloadmic/runtime/emulator/coi_version_linker_script.map
index 496713fb4f7..a98cbc6e784 100644
--- a/liboffloadmic/runtime/emulator/coi_version_linker_script.map
+++ b/liboffloadmic/runtime/emulator/coi_version_linker_script.map
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2013 Intel Corporation.
+ * Copyright 2010-2015 Intel Corporation.
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
@@ -38,6 +38,12 @@
* intellectual property rights is granted herein.
*/
+/***
+* See http://sourceware.org/binutils/docs/ld/VERSION.html#VERSION for more info.
+* Use this in conjunction with coi_version_asm.h.
+* // Comments don't work in this file.
+***/
+
COI_1.0
{
global:
@@ -56,17 +62,23 @@ COI_1.0
COIEngineGetCount;
COIEngineGetHandle;
COIEngineGetIndex;
+ COIEngineGetInfo;
COIEventWait;
+ COIEventRegisterCallback;
COIPerfGetCycleFrequency;
+ COIPipelineClearCPUMask;
COIPipelineCreate;
COIPipelineDestroy;
COIPipelineRunFunction;
+ COIPipelineSetCPUMask;
COIPipelineStartExecutingRunFunctions;
+ COIProcessCreateFromFile;
COIProcessCreateFromMemory;
COIProcessDestroy;
COIProcessGetFunctionHandles;
COIProcessLoadLibraryFromMemory;
COIProcessRegisterLibraries;
+ COIProcessUnloadLibrary;
COIProcessWaitForShutdown;
local:
*;
diff --git a/liboffloadmic/runtime/emulator/myo_client.cpp b/liboffloadmic/runtime/emulator/myo_client.cpp
index bee59f0e113..d9d5f309ed1 100644
--- a/liboffloadmic/runtime/emulator/myo_client.cpp
+++ b/liboffloadmic/runtime/emulator/myo_client.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2014 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2014-2015 Intel Corporation. All Rights Reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
diff --git a/liboffloadmic/runtime/emulator/myo_service.cpp b/liboffloadmic/runtime/emulator/myo_service.cpp
index e18abecd05c..0473253f731 100644
--- a/liboffloadmic/runtime/emulator/myo_service.cpp
+++ b/liboffloadmic/runtime/emulator/myo_service.cpp
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2014 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2014-2015 Intel Corporation. All Rights Reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@@ -155,5 +155,49 @@ SYMBOL_VERSION (myoiTargetFptrTableRegister, 1) (void *table,
return MYO_ERROR;
}
+
+MYOACCESSAPI MyoError
+SYMBOL_VERSION (myoArenaRelease, 1) (MyoArena in_Arena)
+{
+ MYOTRACE ("myoArenaRelease");
+
+ assert (false);
+
+ return MYO_ERROR;
+}
+
+
+MYOACCESSAPI MyoError
+SYMBOL_VERSION (myoArenaAcquire, 1) (MyoArena in_Arena)
+{
+ MYOTRACE ("myoArenaAcquire");
+
+ assert (false);
+
+ return MYO_ERROR;
+}
+
+
+MYOACCESSAPI void
+SYMBOL_VERSION (myoArenaAlignedFree, 1) (MyoArena in_Arena, void *in_pPtr)
+{
+ MYOTRACE ("myoArenaAlignedFree");
+
+ assert (false);
+}
+
+
+MYOACCESSAPI void *
+SYMBOL_VERSION (myoArenaAlignedMalloc, 1) (MyoArena in_Arena, size_t in_Size,
+ size_t in_Alignment)
+{
+ MYOTRACE ("myoArenaAlignedMalloc");
+
+ assert (false);
+
+ return 0;
+}
+
+
} // extern "C"
diff --git a/liboffloadmic/runtime/emulator/myo_service.h b/liboffloadmic/runtime/emulator/myo_service.h
index 776e8c2c40d..ffa4a5f8dcd 100644
--- a/liboffloadmic/runtime/emulator/myo_service.h
+++ b/liboffloadmic/runtime/emulator/myo_service.h
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2014 Intel Corporation. All Rights Reserved.
+ Copyright (c) 2014-2015 Intel Corporation. All Rights Reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
diff --git a/liboffloadmic/runtime/emulator/myo_version_asm.h b/liboffloadmic/runtime/emulator/myo_version_asm.h
index 2bd8302ab6a..f4db3ca4ab7 100644
--- a/liboffloadmic/runtime/emulator/myo_version_asm.h
+++ b/liboffloadmic/runtime/emulator/myo_version_asm.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2013 Intel Corporation.
+ * Copyright 2010-2015 Intel Corporation.
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
@@ -38,16 +38,24 @@
* intellectual property rights is granted herein.
*/
-__asm__ (".symver myoAcquire1,myoAcquire@@MYO_1.0");
-__asm__ (".symver myoRelease1,myoRelease@@MYO_1.0");
-__asm__ (".symver myoSharedAlignedFree1,myoSharedAlignedFree@@MYO_1.0");
-__asm__ (".symver myoSharedAlignedMalloc1,myoSharedAlignedMalloc@@MYO_1.0");
-__asm__ (".symver myoSharedFree1,myoSharedFree@@MYO_1.0");
-__asm__ (".symver myoSharedMalloc1,myoSharedMalloc@@MYO_1.0");
+/*Version for Symbols( only Functions currently versioned)
+Only that Linux Host Side code is versioned currently*/
+#if (! defined MYO_MIC_CARD) && (! defined _WIN32)
-__asm__ (".symver myoiLibInit1,myoiLibInit@@MYO_1.0");
-__asm__ (".symver myoiLibFini1,myoiLibFini@@MYO_1.0");
-__asm__ (".symver myoiMicVarTableRegister1,myoiMicVarTableRegister@@MYO_1.0");
-__asm__ (".symver myoiRemoteFuncRegister1,myoiRemoteFuncRegister@@MYO_1.0");
-__asm__ (".symver myoiTargetFptrTableRegister1,myoiTargetFptrTableRegister@@MYO_1.0");
+ __asm__(".symver myoArenaAlignedMalloc1,myoArenaAlignedMalloc@@MYO_1.0");
+ __asm__(".symver myoArenaAlignedFree1,myoArenaAlignedFree@@MYO_1.0");
+ __asm__(".symver myoArenaAcquire1,myoArenaAcquire@@MYO_1.0");
+ __asm__(".symver myoArenaRelease1,myoArenaRelease@@MYO_1.0");
+ __asm__(".symver myoAcquire1,myoAcquire@@MYO_1.0");
+ __asm__(".symver myoRelease1,myoRelease@@MYO_1.0");
+ __asm__(".symver myoSharedAlignedFree1,myoSharedAlignedFree@@MYO_1.0");
+ __asm__(".symver myoSharedAlignedMalloc1,myoSharedAlignedMalloc@@MYO_1.0");
+ __asm__(".symver myoSharedFree1,myoSharedFree@@MYO_1.0");
+ __asm__(".symver myoSharedMalloc1,myoSharedMalloc@@MYO_1.0");
+ __asm__(".symver myoiLibInit1,myoiLibInit@@MYO_1.0");
+ __asm__(".symver myoiLibFini1,myoiLibFini@@MYO_1.0");
+ __asm__(".symver myoiMicVarTableRegister1,myoiMicVarTableRegister@@MYO_1.0");
+ __asm__(".symver myoiRemoteFuncRegister1,myoiRemoteFuncRegister@@MYO_1.0");
+ __asm__(".symver myoiTargetFptrTableRegister1,myoiTargetFptrTableRegister@@MYO_1.0");
+#endif
diff --git a/liboffloadmic/runtime/emulator/myo_version_linker_script.map b/liboffloadmic/runtime/emulator/myo_version_linker_script.map
index 361b289d1b6..8f065bbb4ac 100644
--- a/liboffloadmic/runtime/emulator/myo_version_linker_script.map
+++ b/liboffloadmic/runtime/emulator/myo_version_linker_script.map
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2013 Intel Corporation.
+ * Copyright 2010-2015 Intel Corporation.
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
@@ -38,9 +38,17 @@
* intellectual property rights is granted herein.
*/
+/***
+* See http://sourceware.org/binutils/docs/ld/VERSION.html#VERSION for more info.
+***/
+
MYO_1.0
{
global:
+ myoArenaAlignedMalloc;
+ myoArenaAlignedFree;
+ myoArenaAcquire;
+ myoArenaRelease;
myoAcquire;
myoRelease;
myoSharedAlignedFree;