summaryrefslogtreecommitdiff
path: root/Source/Library/Userland/Syscall/RessourceCaller.class.cpp
blob: f3b61a854bd512dd271c53fadbc6c0c7cae89e35 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "RessourceCaller.class.h"

RessourceCaller::RessourceCaller(u32int id, u32int type) {
	m_id = id;
	m_type = 1;
	m_type = doCall(0);
	if (m_type != type) m_type = 0;
}

u32int RessourceCaller::sCall(u32int type, u8int wat, u32int a, u32int b, u32int c, u32int d) {
	return syscall(0xFFFFFE00 | wat, type, a, b, c, d);
}

u32int RessourceCaller::doCall(u8int call, u32int a, u32int b, u32int c, u32int d, u32int e) {
	if (m_type == 0) return (u32int) - 1;	//Type 0 = invalid object
	u32int x = ((m_id << 8) | call);
	return syscall(x, a, b, c, d, e);
}