209#define BUFFER_READ(buffer, count, offset, src, size) \
211 size_t readCount = (*(offset) <= (size)) ? MIN((count), (size) - *(offset)) : 0; \
212 memcpy((buffer), (src) + *(offset), readCount); \
213 *(offset) += readCount; \
227#define BUFFER_WRITE(buffer, count, offset, dest, size) \
229 size_t writeCount = (*(offset) <= (size)) ? MIN((count), (size) - *(offset)) : 0; \
230 memcpy((dest) + *(offset), (buffer), writeCount); \
231 *(offset) += writeCount; \
EFI_PHYSICAL_ADDRESS buffer
static uintptr_t address
Mapped virtual address of the HPET registers.
size_t vfs_seek(file_t *file, ssize_t offset, seek_origin_t origin)
Seek in a file.
uint64_t vfs_poll(poll_file_t *files, uint64_t amount, clock_t timeout)
Poll multiple files.
size_t vfs_write(file_t *file, const void *buffer, size_t count)
Write to a file.
size_t vfs_read(file_t *file, void *buffer, size_t count)
Read from a file.
file_t * vfs_open(const pathname_t *pathname, process_t *process)
Open a file.
size_t vfs_readlink(vnode_t *symlink, char *buffer, size_t size)
Read the path in a symbolic link.
uint64_t vfs_symlink(const pathname_t *target, const pathname_t *linkpath, process_t *process)
Create a symbolic link.
size_t vfs_getdents(file_t *file, dirent_t *buffer, size_t count)
Get directory entries from a directory file.
uint64_t vfs_remove(const pathname_t *pathname, process_t *process)
Remove a file or directory.
uint64_t vfs_stat(const pathname_t *pathname, stat_t *buffer, process_t *process)
Get file information.
file_t * vfs_openat(const path_t *from, const pathname_t *pathname, process_t *process)
Open a file relative to another path.
void * vfs_mmap(file_t *file, void *address, size_t length, pml_flags_t flags)
Memory map a file.
uint64_t vfs_link(const pathname_t *oldPathname, const pathname_t *newPathname, process_t *process)
Make the same file appear twice in the filesystem.
uint64_t vfs_open2(const pathname_t *pathname, file_t *files[2], process_t *process)
Open one file, returning two file handles.
uint64_t vfs_ioctl(file_t *file, uint64_t request, void *argp, size_t size)
Perform an ioctl operation on a file.
uint64_t vfs_id_get(void)
Generates a new unique ID, to be used for any VFS object.
uint64_t symlink(const char *target, const char *linkpath)
System call for creating a symbolic link.
uint8_t seek_origin_t
Type for the seek() origin argument.
__INT64_TYPE__ ssize_t
Signed size type.
__UINT64_TYPE__ clock_t
A nanosecond time.
static const path_flag_t flags[]
A entry in a page table without a specified address or callback ID.
Structure for polling multiple files.