Skip to content

Commit 04956a3

Browse files
change pid_t to 64 bit
1 parent cd0010e commit 04956a3

4 files changed

Lines changed: 10 additions & 16 deletions

File tree

include/taskswitch.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ typedef enum process_state_t {
2020
/**
2121
* @brief Process ID type (unique identifier for a process).
2222
*/
23-
typedef uint32_t pid_t;
23+
typedef uint64_t pid_t;
2424

2525
/**
2626
* @brief User ID type (reserved for future use).
2727
*/
28-
typedef uint32_t uid_t;
28+
typedef uint64_t uid_t;
2929

3030
/**
3131
* @brief Group ID type (reserved for future use).
3232
*/
33-
typedef uint32_t gid_t;
33+
typedef uint64_t gid_t;
3434

3535
/**
3636
* @brief Logical CPU ID type.

src/basic/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ void library_statement(struct basic_ctx *ctx) {
416416

417417
/* Append the renumbered library to the end of the program (this reallocates
418418
* ctx->program_ptr invalidating ctx->ptr and ctx->next_ptr - the tokeinizer
419-
* must be reinitailised and the line hash rebuilt)
419+
* must be reinitialised and the line hash rebuilt)
420420
*/
421421
ctx->program_ptr = buddy_realloc(ctx->allocator, ctx->program_ptr, strlen(ctx->program_ptr) + 5000 + library_len);
422422
if (!ctx->program_ptr) {

src/block/nvme/nvme.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,8 @@ static inline volatile uint32_t *nvme_db_ptr(volatile nvme_regs_t *r, uint32_t d
88
}
99

1010
/* ---------- Tiny 4 KiB page bounce (PRP1) ---------- */
11-
static void *nvme_page_alloc_4k(void) {
12-
uint8_t *raw = kmalloc_aligned(4096, 4096);
13-
if (!raw) {
14-
return NULL;
15-
}
16-
return raw;
11+
static inline void *nvme_page_alloc_4k(void) {
12+
return kmalloc_aligned(4096, 4096);
1713
}
1814

1915
static void nvme_page_free_4k(void *ptr) {
@@ -32,14 +28,12 @@ static nvme_sqe_t *nvme_sqe_alloc(nvme_dev_t *dev, bool admin, uint16_t *cid_out
3228
*cid_out = tail;
3329
memset(&dev->asq[tail], 0, sizeof(nvme_sqe_t));
3430
dev->a_sqt = (uint16_t) ((tail + 1) & (dev->a_qd - 1));
35-
/* DO NOT ring doorbell here */
3631
return &dev->asq[tail];
3732
} else {
3833
uint16_t tail = dev->io_sqt;
3934
*cid_out = tail;
4035
memset(&dev->iosq[tail], 0, sizeof(nvme_sqe_t));
4136
dev->io_sqt = (uint16_t) ((tail + 1) & (dev->io_qd - 1));
42-
/* DO NOT ring doorbell here */
4337
return &dev->iosq[tail];
4438
}
4539
}

src/taskswitch.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ bool proc_kill_id(pid_t id)
206206
void proc_set_idle(process_t* proc, activity_callback_t callback, void* context) {
207207
if (callback) {
208208
if (proc->check_idle) {
209-
dprintf("WARNING: Possible bug; process '%u' already has an idle callback\n", proc->pid);
209+
dprintf("WARNING: Possible bug; process '%lu' already has an idle callback\n", proc->pid);
210210
}
211211
proc->check_idle = callback;
212212
proc->idle_context = context;
@@ -239,7 +239,7 @@ const char* proc_set_csd(process_t* proc, const char* csd)
239239
if (*csd == '/') {
240240
kfree_null(&proc->csd);
241241
proc->csd = strdup(csd);
242-
dprintf("Process %d CSD set to: '%s'\n", proc->pid, proc->csd);
242+
dprintf("Process %lu CSD set to: '%s'\n", proc->pid, proc->csd);
243243
return proc->csd;
244244
}
245245

@@ -248,7 +248,7 @@ const char* proc_set_csd(process_t* proc, const char* csd)
248248
strlcat((char*)proc->csd, "/", len + csdlen + 2);
249249
}
250250
strlcat((char*)proc->csd, csd, len + csdlen + 2);
251-
dprintf("Process %d CSD set to: '%s'\n", proc->pid, proc->csd);
251+
dprintf("Process %lu CSD set to: '%s'\n", proc->pid, proc->csd);
252252
return proc->csd;
253253
}
254254

@@ -263,7 +263,7 @@ const char* proc_get_csd(process_t* proc)
263263
void proc_kill(process_t* proc)
264264
{
265265
uint8_t cpu = proc->cpu;
266-
dprintf("proc_kill id %u on cpu %d\n", proc->pid, cpu);
266+
dprintf("proc_kill id %lu on cpu %d\n", proc->pid, cpu);
267267
lock_spinlock(&proc_lock[cpu]);
268268
lock_spinlock(&combined_proc_lock);
269269
for (process_t* cur = proc_list[cpu]; cur; cur = cur->next) {

0 commit comments

Comments
 (0)