Commit 2b4be465 authored by Charlie Jacobsen's avatar Charlie Jacobsen Committed by Vikram Narayanan

libasync-integration: Set up task_struct with thc per-thread state.

parent bd8ac307
......@@ -19,7 +19,8 @@
#define INIT_LCD(tsk) \
.lcd = NULL, \
.cptr_cache = NULL, \
.lcd_resource_trees[0] = NULL, .lcd_resource_trees[1] = NULL,
.lcd_resource_trees[0] = NULL, .lcd_resource_trees[1] = NULL, \
.ptstate = NULL,
#ifdef CONFIG_SMP
# define INIT_PUSHABLE_TASKS(tsk) \
......
......@@ -64,6 +64,7 @@ struct sched_param {
struct lcd;
struct cptr_cache;
struct lcd_resource_tree;
struct ptstate_t;
#include <asm/processor.h>
......@@ -1930,6 +1931,7 @@ struct task_struct {
struct lcd *lcd;
struct cptr_cache *cptr_cache;
struct lcd_resource_tree *lcd_resource_trees[2];
struct ptstate_t *ptstate;
/* CPU-specific state of this task */
struct thread_struct thread;
......
......@@ -20,8 +20,10 @@
#include <stdio.h>
#include <string.h>
#include <assert.h>
#ifdef linux
#include <pthread.h>
#endif
#endif
#ifdef BARRELFISH
#include <barrelfish/barrelfish.h>
......@@ -30,16 +32,14 @@
#include <thc/thc.h>
#elif LCD_DOMAINS
#include <lcd_config/pre_hook.h>
#include <liblcd/thc.h>
#include <liblcd/thcsync.h>
#include <liblcd/thcinternal.h>
#include <linux/slab.h>
#include <thc.h>
#include <lcd_config/post_hook.h>
#else
#include "thc.h"
#include <thc.h>
#endif
#define NOT_REACHED /*assert(0 && "Not reached")*/
#define NOT_REACHED assert(0 && "Not reached")
/* It is necessary to set the esp of a lazy awe some way into it's lazy */
/* allocated stack, so that it can pass arguments below its current esp */
......@@ -237,8 +237,16 @@ static void thc_print_pts_stats(PTState_t *t, int clear)
// but which is not currently in use. It is placed at the top of the
// memory reserved for the stack.
#define STACK_COMMIT_BYTES (16*4096)
#define STACK_GUARD_BYTES (1*4096)
#ifndef THC_NR_STACK_COMMIT_PAGES
#define THC_NR_STACK_COMMIT_PAGES 16
#endif
#ifndef THC_NR_STACK_GUARD_PAGES
#define THC_NR_STACK_GUARD_PAGES 1
#endif
#define STACK_COMMIT_BYTES (THC_NR_STACK_COMMIT_PAGES*4096)
#define STACK_GUARD_BYTES (THC_NR_STACK_GUARD_PAGES*4096)
// Allocate a new stack, returning an address just above the top of
// the committed region. The stack comprises STACK_COMMIT_BYTES
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment