mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-05 22:47:03 +00:00
merge rpcsx-gpu and rpcsx-os
initial watchdog implementation implement gpu -> os events implement main gfx queue
This commit is contained in:
parent
8e9711e0f6
commit
0c16e294d4
236 changed files with 4649 additions and 4669 deletions
|
|
@ -1,11 +1,13 @@
|
|||
#include "mem.hpp"
|
||||
#include <cstdio>
|
||||
#include <print>
|
||||
#include <sys/mman.h>
|
||||
#include <unistd.h>
|
||||
|
||||
extern const std::size_t rx::mem::pageSize = sysconf(_SC_PAGE_SIZE);
|
||||
|
||||
void *rx::mem::map(void *address, std::size_t size, int prot, int flags,
|
||||
int fd, std::ptrdiff_t offset) {
|
||||
void *rx::mem::map(void *address, std::size_t size, int prot, int flags, int fd,
|
||||
std::ptrdiff_t offset) {
|
||||
return ::mmap(address, size, prot, flags, fd, offset);
|
||||
}
|
||||
|
||||
|
|
@ -25,3 +27,20 @@ bool rx::mem::protect(void *address, std::size_t size, int prot) {
|
|||
bool rx::mem::unmap(void *address, std::size_t size) {
|
||||
return ::munmap(address, size) == 0;
|
||||
}
|
||||
|
||||
void rx::mem::printStats() {
|
||||
FILE *maps = fopen("/proc/self/maps", "r");
|
||||
|
||||
if (!maps) {
|
||||
return;
|
||||
}
|
||||
|
||||
char *line = nullptr;
|
||||
std::size_t size = 0;
|
||||
while (getline(&line, &size, maps) > 0) {
|
||||
std::print("{}", line);
|
||||
}
|
||||
|
||||
free(line);
|
||||
fclose(maps);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue