| /* |
| * Licensed to the Apache Software Foundation (ASF) under one or more |
| * contributor license agreements. See the NOTICE file distributed with |
| * this work for additional information regarding copyright ownership. |
| * The ASF licenses this file to You under the Apache License, Version 2.0 |
| * (the "License"); you may not use this file except in compliance with |
| * the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| #define CDEV_CURRENT_FUNCTION _comment_ |
| |
| /** |
| * @file |
| * @ingroup Port |
| * @brief CPU Control. |
| * |
| * Functions setting CPU attributes. |
| */ |
| |
| #undef CDEV_CURRENT_FUNCTION |
| |
| #include <windows.h> |
| #include "hyport.h" |
| |
| #define CDEV_CURRENT_FUNCTION hycpu_startup |
| /** |
| * PortLibrary startup. |
| * |
| * This function is called during startup of the portLibrary. Any resources that are required for |
| * the exit operations may be created here. All resources created here should be destroyed |
| * in @ref hycpu_shutdown. |
| * |
| * @param[in] portLibrary The port library |
| * |
| * @return 0 on success, negative error code on failure. Error code values returned are |
| * \arg HYPORT_ERROR_STARTUP_CPU |
| * |
| * @note Most implementations will simply return success. |
| */ |
| I_32 VMCALL |
| hycpu_startup (struct HyPortLibrary *portLibrary) |
| { |
| return 0; |
| } |
| |
| #undef CDEV_CURRENT_FUNCTION |
| |
| #define CDEV_CURRENT_FUNCTION hycpu_shutdown |
| /** |
| * PortLibrary shutdown. |
| * |
| * This function is called during shutdown of the portLibrary. Any resources that were created by @ref hycpu_startup |
| * should be destroyed here. |
| * |
| * @param[in] portLibrary The port library |
| * |
| * @note Most implementations will be empty. |
| */ |
| void VMCALL |
| hycpu_shutdown (struct HyPortLibrary *portLibrary) |
| { |
| /* empty */ |
| } |
| |
| #undef CDEV_CURRENT_FUNCTION |
| |
| #define CDEV_CURRENT_FUNCTION hycpu_flush_icache |
| /** |
| * @brief CPU Control operations. |
| * |
| * Flush the instruction cache to memory. |
| * |
| * @param[in] portLibrary The port library |
| * @param[in] memoryPointer The base address of memory to flush. |
| * @param[in] byteAmount Number of bytes to flush. |
| */ |
| void VMCALL |
| hycpu_flush_icache (struct HyPortLibrary *portLibrary, void *memoryPointer, |
| UDATA byteAmount) |
| { |
| FlushInstructionCache (GetCurrentProcess (), memoryPointer, byteAmount); |
| } |
| |
| #undef CDEV_CURRENT_FUNCTION |