File: io_static.c

package info (click to toggle)
xmbmon 2.05-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 740 kB
  • ctags: 891
  • sloc: ansic: 6,085; sh: 2,697; makefile: 140; perl: 77
file content (21 lines) | stat: -rw-r--r-- 300 bytes parent folder | download | duplicates (6)
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;
}