]> xenbits.xensource.com Git - people/liuw/rumprun.git/commitdiff
Common name for thread switch routine: bmk_platform_cpu_sched_switch().
authorAntti Kantee <pooka@iki.fi>
Tue, 21 Apr 2015 11:35:34 +0000 (11:35 +0000)
committerAntti Kantee <pooka@iki.fi>
Tue, 21 Apr 2015 11:37:14 +0000 (11:37 +0000)
Not sure if it can be unified, since it needs to handle the TLS context
switch, which is apparently slightly different in a virtualized env and
on bare metal, so keep the implementations separate for now.

include/bmk-core/sched.h
platform/baremetal/arch/i386/machdep.c
platform/baremetal/sched.c
platform/xen/xen/arch/x86/sched.c
platform/xen/xen/sched.c

index d406e30e2beb4c1f5fed35c735cbf939d662b645..948719e0f3c2e4cc634525705a48306506dc31a3 100644 (file)
@@ -64,7 +64,6 @@ void  bmk_sched_settls(struct bmk_thread *, unsigned int, void *);
 void   bmk_cpu_sched_create(struct bmk_thread *, struct bmk_tcb *,
                             void (*)(void *), void *,
                             void *, unsigned long);
-void   bmk_cpu_sched_switch(struct bmk_tcb *, struct bmk_tcb *);
 
 void   bmk_sched_set_hook(void (*)(void *, void *));
 struct bmk_thread *bmk_sched_init_mainlwp(void *);
@@ -79,7 +78,8 @@ bmk_time_t    bmk_clock_epochoffset(void);
 
 /* XXX: coming up with better names considered useful */
 void   bmk_cpu_sched_bouncer(void);
-void   bmk_cpu_switch(struct bmk_tcb *, struct bmk_tcb *);
 void   bmk__cpu_switch(void *, void *);
 
+void   bmk_platform_cpu_sched_switch(struct bmk_tcb *, struct bmk_tcb *);
+
 #endif /* _BMK_CORE_SCHED_H_ */
index 90c6cd6b2b222f1a9c2944680ea7b00504f0da96..c25e3badb5b32073d74523e0cf0e033e7d5a856a 100644 (file)
@@ -258,7 +258,7 @@ bmk_cpu_nanohlt(void)
 }
 
 void
-bmk_cpu_sched_switch(struct bmk_tcb *prev, struct bmk_tcb *next)
+bmk_platform_cpu_sched_switch(struct bmk_tcb *prev, struct bmk_tcb *next)
 {
 
        adjustgs(next->btcb_tp, next->btcb_tpsize);
index c9466c6f49fdb4725ebcb87aabaacdeefa8d28c8..22105b491d193635c2aa3084ee69de666aa10382 100644 (file)
@@ -158,7 +158,7 @@ sched_switch(struct bmk_thread *prev, struct bmk_thread *next)
 
        if (scheduler_hook)
                scheduler_hook(prev->bt_cookie, next->bt_cookie);
-       bmk_cpu_sched_switch(&prev->bt_tcb, &next->bt_tcb);
+       bmk_platform_cpu_sched_switch(&prev->bt_tcb, &next->bt_tcb);
 }
 
 struct bmk_thread *
index 739c41d01f5b8f97c25b11b169d7e9ec243c5dd0..15bab5455451988ff90489c2c01522bb23360d22 100644 (file)
@@ -79,7 +79,7 @@ void dump_stack(struct thread *thread_md)
 extern void _minios_entry_thread_starter(void);
 
 void
-bmk_cpu_switch(struct bmk_tcb *prev, struct bmk_tcb *next)
+bmk_platform_cpu_sched_switch(struct bmk_tcb *prev, struct bmk_tcb *next)
 {
 
 /* XXX: TLS is available only on x86_64 currently */
index 5aa83b0374e609ba5cccabbb6bcf4d642f10d9a8..174d3a1e4eceed1affb0e515f39c0da44a49b314 100644 (file)
@@ -162,7 +162,7 @@ sched_switch(struct bmk_thread *prev, struct bmk_thread *next)
 
        if (scheduler_hook)
                scheduler_hook(prev->bt_cookie, next->bt_cookie);
-       bmk_cpu_switch(&prev->bt_tcb, &next->bt_tcb);
+       bmk_platform_cpu_sched_switch(&prev->bt_tcb, &next->bt_tcb);
 }
 
 struct bmk_thread *