1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00

remove obsolete counter

This commit is contained in:
Stefan Lankes 2016-03-21 00:32:43 +01:00
parent 545073235a
commit e7b7ddb5a6
3 changed files with 2 additions and 18 deletions

View file

@ -109,7 +109,6 @@ int page_map(size_t viraddr, size_t phyaddr, size_t npages, size_t bits)
int lvl, ret = -ENOMEM;
long vpn = viraddr >> PAGE_BITS;
long first[PAGE_LEVELS], last[PAGE_LEVELS];
task_t* curr_task;
/* Calculate index boundaries for page map traversal */
for (lvl=0; lvl<PAGE_LEVELS; lvl++) {
@ -117,8 +116,6 @@ int page_map(size_t viraddr, size_t phyaddr, size_t npages, size_t bits)
last[lvl] = (vpn+npages-1) >> (lvl * PAGE_MAP_BITS);
}
curr_task = per_core(current_task);
spinlock_irqsave_lock(&page_lock);
/* Start iterating through the entries
@ -133,9 +130,6 @@ int page_map(size_t viraddr, size_t phyaddr, size_t npages, size_t bits)
if (BUILTIN_EXPECT(!phyaddr, 0))
goto out;
if (bits & PG_USER)
atomic_int64_inc(curr_task->user_usage);
/* Reference the new table within its parent */
#if 0
self[lvl][vpn] = phyaddr | bits | PG_PRESENT | PG_USER | PG_RW | PG_ACCESSED;

View file

@ -90,8 +90,6 @@ typedef struct task {
uint64_t start_tick;
/// the userspace heap
vma_t* heap;
/// usage in number of pages (including page map tables)
atomic_int64_t* user_usage;
/// parent thread
tid_t parent;
/// next task in the queue

View file

@ -51,8 +51,8 @@ extern const void tls_end;
* A task's id will be its position in this array.
*/
static task_t task_table[MAX_TASKS] = { \
[0] = {0, TASK_IDLE, 0, NULL, NULL, TASK_DEFAULT_FLAGS, 0, 0, 0, NULL, NULL, 0, NULL, NULL, 0, 0, 0}, \
[1 ... MAX_TASKS-1] = {0, TASK_INVALID, 0, NULL, NULL, TASK_DEFAULT_FLAGS, 0, 0, 0, NULL, NULL, 0, NULL, NULL, 0, 0, 0}};
[0] = {0, TASK_IDLE, 0, NULL, NULL, TASK_DEFAULT_FLAGS, 0, 0, 0, NULL, 0, NULL, NULL, 0, 0, 0}, \
[1 ... MAX_TASKS-1] = {0, TASK_INVALID, 0, NULL, NULL, TASK_DEFAULT_FLAGS, 0, 0, 0, NULL, 0, NULL, NULL, 0, 0, 0}};
static spinlock_irqsave_t table_lock = SPINLOCK_IRQSAVE_INIT;
@ -161,7 +161,6 @@ int set_idle_task(void)
set_per_core(kernel_stack, task_table[i].stack + KERNEL_STACK_SIZE - 0x10);
task_table[i].prio = IDLE_PRIO;
task_table[i].heap = NULL;
task_table[i].user_usage = NULL;
readyqueues[core_id].idle = task_table+i;
set_per_core(current_task, readyqueues[core_id].idle);
ret = 0;
@ -218,11 +217,6 @@ void finish_task_switch(void)
old->stack = NULL;
}
if (old->user_usage) {
kfree(old->user_usage);
old->user_usage = NULL;
}
if (!old->parent && old->heap) {
kfree(old->heap);
old->heap = NULL;
@ -363,7 +357,6 @@ int clone_task(tid_t* id, entry_point_t ep, void* arg, uint8_t prio)
task_table[i].tls_addr = curr_task->tls_addr;
task_table[i].tls_size = curr_task->tls_size;
task_table[i].lwip_err = 0;
task_table[i].user_usage = curr_task->user_usage;
if (id)
*id = i;
@ -453,7 +446,6 @@ int create_task(tid_t* id, entry_point_t ep, void* arg, uint8_t prio, uint32_t c
task_table[i].tls_addr = 0;
task_table[i].tls_size = 0;
task_table[i].lwip_err = 0;
task_table[i].user_usage = (atomic_int64_t*) counter;
if (id)
*id = i;