summaryrefslogtreecommitdiffstats
path: root/osdep/osdep.h
diff options
context:
space:
mode:
authorkomh <komh@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-03-04 12:55:30 +0000
committerkomh <komh@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-03-04 12:55:30 +0000
commit66278a55ec69be0c4acc8650926f634ebc7f3f9e (patch)
treee18a2c8cffc108437576fd3a00674ee597aa97c0 /osdep/osdep.h
parent6cf92cd32a416ab6fd4741983f0b1d989f6e7158 (diff)
downloadmpv-66278a55ec69be0c4acc8650926f634ebc7f3f9e.tar.bz2
mpv-66278a55ec69be0c4acc8650926f634ebc7f3f9e.tar.xz
1. Move the macros for priority classes for OS/2 from priority.c to osdep.h
2. Define SetPriorityClass() and GetCurrentProcess() in osdep.h 3. Include osdep.h in priority.c This removes OS2-platform check in priority.c git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30828 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'osdep/osdep.h')
-rw-r--r--osdep/osdep.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/osdep/osdep.h b/osdep/osdep.h
index 0a64c31120..654309c015 100644
--- a/osdep/osdep.h
+++ b/osdep/osdep.h
@@ -27,7 +27,24 @@
#define INCL_DOS
#define INCL_DOSDEVIOCTL
#include <os2.h>
-#endif
+
+#include <process.h> /* getpid() */
+
+#define REALTIME_PRIORITY_CLASS MAKESHORT(0, PRTYC_TIMECRITICAL)
+#define HIGH_PRIORITY_CLASS MAKESHORT(PRTYD_MAXIMUM, PRTYC_REGULAR)
+#define ABOVE_NORMAL_PRIORITY_CLASS MAKESHORT(PRTYD_MAXIMUM / 2, PRTYC_REGULAR)
+#define NORMAL_PRIORITY_CLASS MAKESHORT(0, PRTYC_REGULAR)
+#define BELOW_NORMAL_PRIORITY_CLASS MAKESHORT(PRTYD_MAXIMUM, PRTYC_IDLETIME)
+#define IDLE_PRIORITY_CLASS MAKESHORT(0, PRTYC_IDLETIME)
+
+#define SetPriorityClass(pid, prio) \
+ DosSetPriority(PRTYS_PROCESS, \
+ HIBYTE(prio), \
+ LOBYTE(prio), \
+ pid)
+
+#define GetCurrentProcess() getpid()
+#endif /* __OS2__ */
#endif /* MPLAYER_OSDEP_H */