Commit a489d919 authored by Sergey Vojtovich's avatar Sergey Vojtovich

Cleanup UT_LOW_PRIORITY_CPU/UT_RESUME_PRIORITY_CPU

Server already has HMT_low/HMT_medium.
parent 1c4968f2
...@@ -191,7 +191,6 @@ ...@@ -191,7 +191,6 @@
#cmakedefine HAVE_PREAD 1 #cmakedefine HAVE_PREAD 1
#cmakedefine HAVE_PAUSE_INSTRUCTION 1 #cmakedefine HAVE_PAUSE_INSTRUCTION 1
#cmakedefine HAVE_FAKE_PAUSE_INSTRUCTION 1 #cmakedefine HAVE_FAKE_PAUSE_INSTRUCTION 1
#cmakedefine HAVE_HMT_PRIORITY_INSTRUCTION 1
#cmakedefine HAVE_RDTSCLL 1 #cmakedefine HAVE_RDTSCLL 1
#cmakedefine HAVE_READ_REAL_TIME 1 #cmakedefine HAVE_READ_REAL_TIME 1
#cmakedefine HAVE_PTHREAD_ATTR_CREATE 1 #cmakedefine HAVE_PTHREAD_ATTR_CREATE 1
......
...@@ -792,17 +792,6 @@ IF(NOT CMAKE_CROSSCOMPILING AND NOT MSVC) ...@@ -792,17 +792,6 @@ IF(NOT CMAKE_CROSSCOMPILING AND NOT MSVC)
} }
" HAVE_FAKE_PAUSE_INSTRUCTION) " HAVE_FAKE_PAUSE_INSTRUCTION)
ENDIF() ENDIF()
IF (NOT HAVE_PAUSE_INSTRUCTION)
CHECK_C_SOURCE_COMPILES("
#include <sys/platform/ppc.h>
int main()
{
__ppc_set_ppr_low();
__ppc_set_ppr_med();
return 0;
}
" HAVE_HMT_PRIORITY_INSTRUCTION)
ENDIF()
ENDIF() ENDIF()
CHECK_SYMBOL_EXISTS(tcgetattr "termios.h" HAVE_TCGETATTR 1) CHECK_SYMBOL_EXISTS(tcgetattr "termios.h" HAVE_TCGETATTR 1)
......
...@@ -21,17 +21,18 @@ ...@@ -21,17 +21,18 @@
The defines are the same ones used by the linux kernel The defines are the same ones used by the linux kernel
*/ */
#if defined(__powerpc__) #ifdef _ARCH_PWR8
#include <sys/platform/ppc.h>
/* Very low priority */ /* Very low priority */
#define HMT_very_low() asm volatile("or 31,31,31") #define HMT_very_low() __ppc_set_ppr_very_low()
/* Low priority */ /* Low priority */
#define HMT_low() asm volatile("or 1,1,1") #define HMT_low() __ppc_set_ppr_low()
/* Medium low priority */ /* Medium low priority */
#define HMT_medium_low() asm volatile("or 6,6,6") #define HMT_medium_low() __ppc_set_ppr_med_low()
/* Medium priority */ /* Medium priority */
#define HMT_medium() asm volatile("or 2,2,2") #define HMT_medium() __ppc_set_ppr_med()
/* Medium high priority */ /* Medium high priority */
#define HMT_medium_high() asm volatile("or 5,5,5") #define HMT_medium_high() __ppc_set_ppr_med_high()
/* High priority */ /* High priority */
#define HMT_high() asm volatile("or 3,3,3") #define HMT_high() asm volatile("or 3,3,3")
#else #else
......
...@@ -89,15 +89,6 @@ typedef time_t ib_time_t; ...@@ -89,15 +89,6 @@ typedef time_t ib_time_t;
# define UT_COMPILER_BARRIER() # define UT_COMPILER_BARRIER()
#endif #endif
#if defined(HAVE_HMT_PRIORITY_INSTRUCTION)
# include <sys/platform/ppc.h>
# define UT_LOW_PRIORITY_CPU() __ppc_set_ppr_low()
# define UT_RESUME_PRIORITY_CPU() __ppc_set_ppr_med()
#else
# define UT_LOW_PRIORITY_CPU() ((void)0)
# define UT_RESUME_PRIORITY_CPU() ((void)0)
#endif
/*********************************************************************//** /*********************************************************************//**
Delays execution for at most max_wait_us microseconds or returns earlier Delays execution for at most max_wait_us microseconds or returns earlier
if cond becomes true. if cond becomes true.
......
...@@ -37,6 +37,7 @@ Created 5/11/1994 Heikki Tuuri ...@@ -37,6 +37,7 @@ Created 5/11/1994 Heikki Tuuri
#include "trx0trx.h" #include "trx0trx.h"
#include <string> #include <string>
#include "log.h" #include "log.h"
#include "my_cpu.h"
#ifdef _WIN32 #ifdef _WIN32
/*****************************************************************//** /*****************************************************************//**
...@@ -290,14 +291,14 @@ ut_delay( ...@@ -290,14 +291,14 @@ ut_delay(
{ {
ulint i; ulint i;
UT_LOW_PRIORITY_CPU(); HMT_low();
for (i = 0; i < delay * 50; i++) { for (i = 0; i < delay * 50; i++) {
UT_RELAX_CPU(); UT_RELAX_CPU();
UT_COMPILER_BARRIER(); UT_COMPILER_BARRIER();
} }
UT_RESUME_PRIORITY_CPU(); HMT_medium();
} }
/*************************************************************//** /*************************************************************//**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment