File: io_static.c

package info (click to toggle)
xmbmon 2.05-8
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 928 kB
  • ctags: 910
  • sloc: ansic: 6,089; sh: 2,151; perl: 87; makefile: 79
file content (21 lines) | stat: -rw-r--r-- 300 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* static open/close IO routines used some places */

#include "io_cpu.h"

static int OpenIO()
{
	if (iopl_counter == 0) {
		if (SET_IOPL() < 0)
			return -1;
	}
	++iopl_counter;
	return 0;
}

static void CloseIO()
{
	if (iopl_counter == 1)
		RESET_IOPL();
	if (iopl_counter > 0)
		--iopl_counter;
}