mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
[MINIOS] More cleanups for the ia64 port.
Signed-off-by: Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com>
This commit is contained in:
1 parent
2b68aee829
commit
4e8586dfa3
6 files changed
+38
-22
No files matched your search
@@ -91,10 +91,11 @@ static void stack_push(struct thread *thread, unsigned long value)
|
||||
*((unsigned long *)thread->sp) = value;
|
||||
}
|
||||
|
||||
struct thread* create_thread(char *name, void (*function)(void *), void *data)
|
||||
/* Architecture specific setup of thread creation */
|
||||
struct thread* arch_create_thread(char *name, void (*function)(void *),
|
||||
void *data)
|
||||
{
|
||||
struct thread *thread;
|
||||
unsigned long flags;
|
||||
|
||||
thread = xmalloc(struct thread);
|
||||
/* Allocate 2 pages for stack, stack will be 2pages aligned */
|
||||
@@ -110,24 +111,9 @@ struct thread* create_thread(char *name, void (*function)(void *), void *data)
|
||||
stack_push(thread, (unsigned long) function);
|
||||
stack_push(thread, (unsigned long) data);
|
||||
thread->ip = (unsigned long) thread_starter;
|
||||
|
||||
/* Not runable, not exited, not sleeping */
|
||||
thread->flags = 0;
|
||||
thread->wakeup_time = 0LL;
|
||||
set_runnable(thread);
|
||||
local_irq_save(flags);
|
||||
if(idle_thread != NULL) {
|
||||
list_add_tail(&thread->thread_list, &idle_thread->thread_list);
|
||||
} else if(function != idle_thread_fn)
|
||||
{
|
||||
printk("BUG: Not allowed to create thread before initialising scheduler.\n");
|
||||
BUG();
|
||||
}
|
||||
local_irq_restore(flags);
|
||||
return thread;
|
||||
}
|
||||
|
||||
|
||||
void run_idle_thread(void)
|
||||
{
|
||||
/* Switch stacks and run the thread */
|
||||
|
||||
File renamed without changes.
@@ -31,6 +31,9 @@ void idle_thread_fn(void *unused);
|
||||
|
||||
#define switch_threads(prev, next) arch_switch_threads(prev, next)
|
||||
|
||||
/* Architecture specific setup of thread creation. */
|
||||
struct thread* arch_create_thread(char *name, void (*function)(void *),
|
||||
void *data);
|
||||
|
||||
void init_sched(void);
|
||||
void run_idle_thread(void);
|
||||
|
||||
@@ -57,6 +57,10 @@
|
||||
|
||||
#include <types.h>
|
||||
|
||||
/* On ia64 these functions lead to crashes. These are replaced by
|
||||
* assembler functions. */
|
||||
#if !defined(__ia64__)
|
||||
|
||||
/*
|
||||
* Depending on the desired operation, we view a `long long' (aka quad_t) in
|
||||
* one or more of the following formats.
|
||||
@@ -380,3 +384,4 @@ __umoddi3(u_quad_t a, u_quad_t b)
|
||||
return (r);
|
||||
}
|
||||
|
||||
#endif /* !defined(__ia64__) */
|
||||
@@ -48,6 +48,12 @@ struct xmalloc_hdr
|
||||
/* Total including this hdr. */
|
||||
size_t size;
|
||||
struct list_head freelist;
|
||||
#if defined(__ia64__)
|
||||
// Needed for ia64 as long as the align parameter in _xmalloc()
|
||||
// is not supported.
|
||||
uint64_t pad;
|
||||
#endif
|
||||
|
||||
} __cacheline_aligned;
|
||||
|
||||
static void maybe_split(struct xmalloc_hdr *hdr, size_t size, size_t block)
|
||||
|
||||
+21
-5
@@ -155,11 +155,27 @@ void schedule(void)
|
||||
if(prev != next) switch_threads(prev, next);
|
||||
}
|
||||
|
||||
|
||||
/* Gets run when a new thread is scheduled the first time ever,
|
||||
defined in x86_[32/64].S */
|
||||
extern void thread_starter(void);
|
||||
|
||||
struct thread* create_thread(char *name, void (*function)(void *), void *data)
|
||||
{
|
||||
struct thread *thread;
|
||||
unsigned long flags;
|
||||
/* Call architecture specific setup. */
|
||||
thread = arch_create_thread(name, function, data);
|
||||
/* Not runable, not exited, not sleeping */
|
||||
thread->flags = 0;
|
||||
thread->wakeup_time = 0LL;
|
||||
set_runnable(thread);
|
||||
local_irq_save(flags);
|
||||
if(idle_thread != NULL) {
|
||||
list_add_tail(&thread->thread_list, &idle_thread->thread_list);
|
||||
} else if(function != idle_thread_fn)
|
||||
{
|
||||
printk("BUG: Not allowed to create thread before initialising scheduler.\n");
|
||||
BUG();
|
||||
}
|
||||
local_irq_restore(flags);
|
||||
return thread;
|
||||
}
|
||||
|
||||
void exit_thread(void)
|
||||
{
|
||||
|
||||