Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions include/kernel/cpu/ipi.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ typedef struct ipi_chip
*/
typedef struct
{
void* private;
void* data;
} ipi_func_data_t;

/**
Expand All @@ -73,7 +73,7 @@ typedef void (*ipi_func_t)(ipi_func_data_t* data);
typedef struct ipi
{
ipi_func_t func;
void* private;
void* data;
} ipi_t;

/**
Expand Down Expand Up @@ -158,15 +158,15 @@ uint64_t ipi_chip_amount(void);
* @param cpu The specified CPU, check `ipi_flags_t`.
* @param flags The flags for how to send the IPI.
* @param func The function to execute on target CPU(s).
* @param private The private data to pass to the function, will be found in `irq_func_data_t->private`.
* @param private The private data to pass to the function, will be found in `irq_func_data_t->data`.
* @return On success, `0`. On failure, `ERR` and `errno` is set to:
* - `EINVAL`: Invalid parameters.
* - `ENODEV`: No IPI chip is registered.
* - `ENOSYS`: The registered IPI chip does not have a `notify` function.
* - `EBUSY`: The target CPU's IPI queue is full, some or all IPIs could not be sent.
* - Other errors returned by the IPI chip's `notify` function.
*/
uint64_t ipi_send(cpu_t* cpu, ipi_flags_t flags, ipi_func_t func, void* private);
uint64_t ipi_send(cpu_t* cpu, ipi_flags_t flags, ipi_func_t func, void* data);

/**
* @brief Wake up one or more CPUs.
Expand Down
12 changes: 6 additions & 6 deletions include/kernel/cpu/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ typedef struct
{
interrupt_frame_t* frame;
irq_virt_t virt;
void* private;
void* data;
} irq_func_data_t;

/**
Expand All @@ -79,7 +79,7 @@ typedef struct
{
list_entry_t entry;
irq_func_t func;
void* private;
void* data;
irq_virt_t virt;
} irq_handler_t;

Expand Down Expand Up @@ -127,7 +127,7 @@ typedef struct irq_domain
{
list_entry_t entry;
irq_chip_t* chip;
void* private;
void* data;
irq_phys_t start; ///< Inclusive
irq_phys_t end; ///< Exclusive
} irq_domain_t;
Expand Down Expand Up @@ -222,14 +222,14 @@ uint64_t irq_virt_set_affinity(irq_virt_t virt, cpu_t* cpu);
* @param chip The IRQ chip to register.
* @param start The start of the physical IRQ range.
* @param end The end of the physical IRQ range.
* @param private Private data for the IRQ chip, will be found in `irq_t->domain->private`.
* @param private Private data for the IRQ chip, will be found in `irq_t->domain->data`.
* @return On success, `0`. On failure, `ERR` and `errno` is set to:
* - `EINVAL`: Invalid parameters.
* - `EEXIST`: A chip with a domain overlapping the given range is already registered.
* - `ENOMEM`: Memory allocation failed.
* - Other errors as returned by the IRQ chip's `enable` function.
*/
uint64_t irq_chip_register(irq_chip_t* chip, irq_phys_t start, irq_phys_t end, void* private);
uint64_t irq_chip_register(irq_chip_t* chip, irq_phys_t start, irq_phys_t end, void* data);

/**
* @brief Unregister all instances of the given IRQ chip within the specified range.
Expand Down Expand Up @@ -265,7 +265,7 @@ uint64_t irq_chip_amount(void);
* - `ENOMEM`: Memory allocation failed.
* - Other errors as returned by the IRQ chip's `enable` function.
*/
uint64_t irq_handler_register(irq_virt_t virt, irq_func_t func, void* private);
uint64_t irq_handler_register(irq_virt_t virt, irq_func_t func, void* data);

/**
* @brief Unregister an IRQ handler.
Expand Down
2 changes: 1 addition & 1 deletion include/kernel/cpu/regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define XCR0_ZMM16_32_ENABLE (1 << 7)

#define MSR_LAPIC 0x1B
#define MSR_IA32_TSC_AUX 0xC0000103
#define MSR_TSC_AUX 0xC0000103
#define MSR_EFER 0xC0000080
#define MSR_STAR 0xC0000081
#define MSR_LSTAR 0xC0000082
Expand Down
4 changes: 2 additions & 2 deletions include/kernel/drivers/abstract/fb.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ typedef struct fb
{
char name[MAX_PATH];
const fb_ops_t* ops;
void* private;
void* data;
dentry_t* dir;
list_t files;
} fb_t;
Expand All @@ -89,7 +89,7 @@ typedef struct fb
* @param private Private data for the framebuffer.
* @return On success, the new framebuffer. On failure, `NULL` and `errno` is set.
*/
fb_t* fb_new(const char* name, const fb_ops_t* ops, void* private);
fb_t* fb_new(const char* name, const fb_ops_t* ops, void* data);

/**
* @brief Frees a framebuffer.
Expand Down
4 changes: 2 additions & 2 deletions include/kernel/fs/dentry.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ typedef struct dir_ctx
*/
bool (*emit)(dir_ctx_t* ctx, const char* name, ino_t number, itype_t type);
size_t pos; ///< The current position in the directory, can be used to skip entries.
void* private; ///< Private data that the filesystem can use to conveniently pass data.
void* data; ///< Private data that the filesystem can use to conveniently pass data.
size_t index; ///< An index that the filesystem can use for its own purposes.
} dir_ctx_t;

Expand Down Expand Up @@ -162,7 +162,7 @@ typedef struct dentry
list_t children;
superblock_t* superblock;
const dentry_ops_t* ops;
void* private;
void* data;
struct dentry* next; ///< Next dentry in the dentry cache hash bucket.
_Atomic(uint64_t) mountCount; ///< Number of mounts targeting this dentry.
rcu_entry_t rcu; ///< RCU entry for deferred cleanup.
Expand Down
8 changes: 4 additions & 4 deletions include/kernel/fs/devfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void devfs_init(void);
* @param private Private data to store in the inode of the new directory, can be `NULL`.
* @return On success, the new devfs directory. On failure, `NULL` and `errno` is set.
*/
dentry_t* devfs_dir_new(dentry_t* parent, const char* name, const inode_ops_t* inodeOps, void* private);
dentry_t* devfs_dir_new(dentry_t* parent, const char* name, const inode_ops_t* inodeOps, void* data);

/**
* @brief Create a new file inside a mounted devfs instance.
Expand All @@ -52,7 +52,7 @@ dentry_t* devfs_dir_new(dentry_t* parent, const char* name, const inode_ops_t* i
* @return On success, the new devfs file. On failure, `NULL` and `errno` is set.
*/
dentry_t* devfs_file_new(dentry_t* parent, const char* name, const inode_ops_t* inodeOps, const file_ops_t* fileOps,
void* private);
void* data);

/**
* @brief Create a new symbolic link inside a mounted devfs instance.
Expand All @@ -63,7 +63,7 @@ dentry_t* devfs_file_new(dentry_t* parent, const char* name, const inode_ops_t*
* @param private Private data to store in the inode of the new symbolic link, can be `NULL`.
* @return On success, the new devfs symbolic link. On failure, `NULL` and `errno` is set.
*/
dentry_t* devfs_symlink_new(dentry_t* parent, const char* name, const inode_ops_t* inodeOps, void* private);
dentry_t* devfs_symlink_new(dentry_t* parent, const char* name, const inode_ops_t* inodeOps, void* data);

/**
* @brief Descriptor for batch file creation.
Expand All @@ -74,7 +74,7 @@ typedef struct devfs_file_desc
const char* name; ///< Name of the file, `NULL` marks end of array.
const inode_ops_t* inodeOps; ///< Inode operations, can be `NULL`.
const file_ops_t* fileOps; ///< File operations, can be `NULL`.
void* private; ///< Private data to store in the inode of the file.
void* data; ///< Private data to store in the inode of the file.
} devfs_file_desc_t;

/**
Expand Down
2 changes: 1 addition & 1 deletion include/kernel/fs/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ typedef struct file
inode_t* inode;
path_t path;
const file_ops_t* ops;
void* private;
void* data;
} file_t;

/**
Expand Down
2 changes: 1 addition & 1 deletion include/kernel/fs/filesystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ typedef struct filesystem
* @param private Private data for the filesystem's mount function.
* @return On success, the root dentry of the mounted filesystem. On failure, `NULL` and `errno` is set.
*/
dentry_t* (*mount)(filesystem_t* fs, const char* details, void* private);
dentry_t* (*mount)(filesystem_t* fs, const char* details, void* data);
} filesystem_t;

/**s
Expand Down
2 changes: 1 addition & 1 deletion include/kernel/fs/inode.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ typedef struct inode
time_t modifyTime; ///< Unix time stamp for last file content alteration.
time_t changeTime; ///< Unix time stamp for the last file metadata alteration.
time_t createTime; ///< Unix time stamp for the inode creation.
void* private;
void* data;
superblock_t* superblock;
const inode_ops_t* ops;
const file_ops_t* fileOps;
Expand Down
2 changes: 1 addition & 1 deletion include/kernel/fs/namespace.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ bool namespace_rcu_traverse(namespace_t* ns, mount_t** mount, dentry_t** dentry)
* - Other errors as returned by the filesystem's `mount()` operation or `mount_new()`.
*/
mount_t* namespace_mount(namespace_t* ns, path_t* target, filesystem_t* fs, const char* options, mode_t mode,
void* private);
void* data);

/**
* @brief Bind a source path to a target path in a namespace.
Expand Down
2 changes: 1 addition & 1 deletion include/kernel/fs/netfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ typedef struct socket
socket_type_t type;
socket_state_t state;
weak_ptr_t ownerNs; ///< A weak pointer to the namespace that created the socket.
void* private;
void* data;
mutex_t mutex;
} socket_t;

Expand Down
2 changes: 1 addition & 1 deletion include/kernel/fs/superblock.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ typedef struct superblock
sbid_t id;
uint64_t blockSize;
uint64_t maxFileSize;
void* private;
void* data;
dentry_t* root; ///< Root dentry of the filesystem, should not take a reference.
const superblock_ops_t* ops;
const dentry_ops_t* dentryOps;
Expand Down
8 changes: 4 additions & 4 deletions include/kernel/fs/sysfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void sysfs_init(void);
* @param private Private data to store in the inode of the new directory, can be `NULL`.
* @return On success, the new sysfs directory. On failure, `NULL` and `errno` is set.
*/
dentry_t* sysfs_dir_new(dentry_t* parent, const char* name, const inode_ops_t* inodeOps, void* private);
dentry_t* sysfs_dir_new(dentry_t* parent, const char* name, const inode_ops_t* inodeOps, void* data);

/**
* @brief Create a new file inside a mounted sysfs instance.
Expand All @@ -57,7 +57,7 @@ dentry_t* sysfs_dir_new(dentry_t* parent, const char* name, const inode_ops_t* i
* @return On success, the new sysfs file. On failure, `NULL` and `errno` is set.
*/
dentry_t* sysfs_file_new(dentry_t* parent, const char* name, const inode_ops_t* inodeOps, const file_ops_t* fileOps,
void* private);
void* data);

/**
* @brief Create a new symbolic link inside a mounted sysfs instance.
Expand All @@ -68,7 +68,7 @@ dentry_t* sysfs_file_new(dentry_t* parent, const char* name, const inode_ops_t*
* @param private Private data to store in the inode of the new symbolic link, can be `NULL`.
* @return On success, the new sysfs symbolic link. On failure, `NULL` and `errno` is set.
*/
dentry_t* sysfs_symlink_new(dentry_t* parent, const char* name, const inode_ops_t* inodeOps, void* private);
dentry_t* sysfs_symlink_new(dentry_t* parent, const char* name, const inode_ops_t* inodeOps, void* data);

/**
* @brief Descriptor for batch file creation.
Expand All @@ -79,7 +79,7 @@ typedef struct sysfs_file_desc
const char* name; ///< Name of the file, `NULL` marks end of array.
const inode_ops_t* inodeOps; ///< Inode operations, can be `NULL`.
const file_ops_t* fileOps; ///< File operations, can be `NULL`.
void* private; ///< Private data to store in the inode of the file.
void* data; ///< Private data to store in the inode of the file.
} sysfs_file_desc_t;

/**
Expand Down
6 changes: 3 additions & 3 deletions include/kernel/mem/space.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ typedef enum
/**
* @brief Space callback function.
*/
typedef void (*space_callback_func_t)(void* private);
typedef void (*space_callback_func_t)( void* data);

/**
* @brief Space callback structure.
Expand All @@ -48,7 +48,7 @@ typedef void (*space_callback_func_t)(void* private);
typedef struct
{
space_callback_func_t func;
void* private;
void* data;
uint64_t pageAmount;
} space_callback_t;

Expand Down Expand Up @@ -261,7 +261,7 @@ uint64_t space_mapping_start(space_t* space, space_mapping_t* mapping, void* vir
* @param private Private data to pass to the callback function.
* @return On success, returns the callback ID. On failure, returns `PML_MAX_CALLBACK`.
*/
pml_callback_id_t space_alloc_callback(space_t* space, size_t pageAmount, space_callback_func_t func, void* private);
pml_callback_id_t space_alloc_callback(space_t* space, size_t pageAmount, space_callback_func_t func, void* data);

/**
* @brief Free a callback.
Expand Down
4 changes: 2 additions & 2 deletions include/kernel/mem/vmm.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ void* vmm_alloc(space_t* space, void* virtAddr, size_t length, size_t alignment,
* - Other values from `space_mapping_start()`.
*/
void* vmm_map(space_t* space, void* virtAddr, void* physAddr, size_t length, pml_flags_t flags,
space_callback_func_t func, void* private);
space_callback_func_t func, void* data);

/**
* @brief Maps an array of physical pages to virtual memory in a given address space.
Expand All @@ -220,7 +220,7 @@ void* vmm_map(space_t* space, void* virtAddr, void* physAddr, size_t length, pml
* - Other values from `space_mapping_start()`.
*/
void* vmm_map_pages(space_t* space, void* virtAddr, void** pages, size_t pageAmount, pml_flags_t flags,
space_callback_func_t func, void* private);
space_callback_func_t func, void* data);

/**
* @brief Unmaps virtual memory from a given address space.
Expand Down
4 changes: 2 additions & 2 deletions include/kernel/sync/rcu.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ typedef struct rcu_entry rcu_entry_t;
* To access RCU protected data, a read-side critical section must be created using `rcu_read_lock()` and
* `rcu_read_unlock()`, or the `RCU_READ_SCOPE()` macro.
*
* @see [https://en.wikipedia.org/wiki/Read-copy-update](Wikipedia) for more information about RCU.
* @see [https://www.kernel.org/doc/Documentation/RCU/whatisRCU.txt](kernel.org) for a explanation of RCU in the Linux kernel.
* @see [Wikipedia](https://en.wikipedia.org/wiki/Read-copy-update) for more information about RCU.
* @see [kernel.org](https://www.kernel.org/doc/Documentation/RCU/whatisRCU.txt) for a explanation of RCU in the Linux kernel.
*
* @{
*/
Expand Down
4 changes: 2 additions & 2 deletions include/libpatchwork/element.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ typedef struct
* @return On success, a pointer to the new element. On failure, `NULL` and `errno` is set.
*/
element_t* element_new(element_t* parent, element_id_t id, const rect_t* rect, const char* text, element_flags_t flags,
procedure_t procedure, void* private);
procedure_t procedure, void* data);

/**
* @brief Deinitialize and free an element and all its children.
Expand Down Expand Up @@ -126,7 +126,7 @@ element_t* element_find(element_t* elem, element_id_t id);
* @param elem The element.
* @param private Pointer to the private data.
*/
void element_set_private(element_t* elem, void* private);
void element_set_private(element_t* elem, void* data);

/**
* @brief Get private data for an element.
Expand Down
2 changes: 1 addition & 1 deletion include/libpatchwork/window.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ typedef enum window_flags
* @return On success, the new window. On failure, returns `NULL` and `errno` is set.
*/
window_t* window_new(display_t* disp, const char* name, const rect_t* rect, surface_type_t type, window_flags_t flags,
procedure_t procedure, void* private);
procedure_t procedure, void* data);

/**
* @brief Free a window.
Expand Down
1 change: 1 addition & 0 deletions include/libstd/_internal/clock_t.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ typedef __UINT64_TYPE__ clock_t;

#define CLOCKS_PER_SEC ((clock_t)1000000000ULL)
#define CLOCKS_PER_MS ((clock_t)1000000ULL)
#define CLOCKS_PER_US ((clock_t)1000ULL)
#define CLOCKS_NEVER ((clock_t)__UINT64_MAX__)

/**
Expand Down
Loading