Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Merge branch 'devel'
[palacios.git] / kitten / include / lwk / smp.h
1 #ifndef __LINUX_SMP_H
2 #define __LINUX_SMP_H
3
4 /*
5  *      Generic SMP support
6  *              Alan Cox. <alan@redhat.com>
7  */
8
9 #include <lwk/kernel.h>
10 #include <lwk/compiler.h>
11 #include <arch/smp.h>
12
13 /*
14  * main cross-CPU interfaces, handles INIT, TLB flush, STOP, etc.
15  * (defined in asm header):
16  */ 
17
18 /*
19  * stops all CPUs but the current one:
20  */
21 extern void smp_send_stop(void);
22
23 /*
24  * sends a 'reschedule' event to another CPU:
25  */
26 extern void smp_send_reschedule(int cpu);
27
28
29 /*
30  * Prepare machine for booting other CPUs.
31  */
32 extern void smp_prepare_cpus(unsigned int max_cpus);
33
34 /*
35  * Bring a CPU up
36  */
37 extern int __cpu_up(unsigned int cpunum);
38
39 /*
40  * Final polishing of CPUs
41  */
42 extern void smp_cpus_done(unsigned int max_cpus);
43
44 /*
45  * Call a function on all other processors
46  */
47 int smp_call_function(void(*func)(void *info), void *info, int retry, int wait);
48
49 /*
50  * Call a function on all processors
51  */
52 int on_each_cpu(void (*func) (void *info), void *info, int retry, int wait);
53
54 #define MSG_ALL_BUT_SELF        0x8000  /* Assume <32768 CPU's */
55 #define MSG_ALL                 0x8001
56
57 #define MSG_INVALIDATE_TLB      0x0001  /* Remote processor TLB invalidate */
58 #define MSG_STOP_CPU            0x0002  /* Sent to shut down slave CPU's
59                                          * when rebooting
60                                          */
61 #define MSG_RESCHEDULE          0x0003  /* Reschedule request from master CPU*/
62 #define MSG_CALL_FUNCTION       0x0004  /* Call function on all other CPUs */
63
64 /*
65  * Mark the boot cpu "online" so that it can call console drivers in
66  * printk() and can access its per-cpu storage.
67  */
68 void smp_prepare_boot_cpu(void);
69
70 #define smp_processor_id() raw_smp_processor_id()
71 #define get_cpu()               smp_processor_id()
72 #define put_cpu()               do { } while (0)
73 #define put_cpu_no_resched()    do { } while (0)
74
75 /**
76  * Returns the current CPU's logical ID.
77  */
78 #define this_cpu smp_processor_id()
79
80 void __init arch_boot_cpu(unsigned int cpu);
81 void __init cpu_init(void);
82
83 #endif /* _LWK_SMP_H */