Implement waiting for process, CE add command cancelation, rctx many cpus
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m27s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m27s
This commit is contained in:
@@ -6,8 +6,24 @@
|
||||
#include <sys/smp.h>
|
||||
|
||||
struct reschedule_ctx {
|
||||
bool reschedule;
|
||||
struct cpu* cpu;
|
||||
struct cpu* cpus[CPUS_MAX];
|
||||
};
|
||||
|
||||
#define rctx_insert_cpu(rctx, cpu) \
|
||||
do { \
|
||||
bool __found = false; \
|
||||
for (size_t __i = 0; __i < CPUS_MAX; __i++) { \
|
||||
if ((rctx)->cpus[__i] == (cpu)) \
|
||||
__found = true; \
|
||||
} \
|
||||
if (!__found) { \
|
||||
for (size_t __i = 0; __i < CPUS_MAX; __i++) { \
|
||||
if ((rctx)->cpus[__i] == NULL) { \
|
||||
(rctx)->cpus[__i] = (cpu); \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif // _KERNEL_PROC_RESCHEDULE_H
|
||||
|
||||
Reference in New Issue
Block a user