diff options
author | kmacy <kmacy@FreeBSD.org> | 2008-10-21 06:38:05 +0000 |
---|---|---|
committer | kmacy <kmacy@FreeBSD.org> | 2008-10-21 06:38:05 +0000 |
commit | 63a2525f2b46846287c1133bd42738f26f279276 (patch) | |
tree | 631a14cea2c5051a5c5a646e214b8c02ac1cf22f /sys/i386/include/xen | |
parent | 24084253f7160708d87ace3845a2eb471a992944 (diff) | |
download | FreeBSD-src-63a2525f2b46846287c1133bd42738f26f279276.zip FreeBSD-src-63a2525f2b46846287c1133bd42738f26f279276.tar.gz |
Header cleanups and addition of IPI declarations for xen
Diffstat (limited to 'sys/i386/include/xen')
-rw-r--r-- | sys/i386/include/xen/evtchn.h | 17 | ||||
-rw-r--r-- | sys/i386/include/xen/xen-os.h | 23 | ||||
-rw-r--r-- | sys/i386/include/xen/xen_intr.h | 13 | ||||
-rw-r--r-- | sys/i386/include/xen/xenfunc.h | 2 |
4 files changed, 23 insertions, 32 deletions
diff --git a/sys/i386/include/xen/evtchn.h b/sys/i386/include/xen/evtchn.h index 92ee578..f86a8ab 100644 --- a/sys/i386/include/xen/evtchn.h +++ b/sys/i386/include/xen/evtchn.h @@ -37,13 +37,24 @@ void mask_evtchn(int port); void unmask_evtchn(int port); - +#ifdef SMP +void rebind_evtchn_to_cpu(int port, unsigned int cpu); +#else +#define rebind_evtchn_to_cpu(port, cpu) ((void)0) +#endif + +static inline +int test_and_set_evtchn_mask(int port) +{ + shared_info_t *s = HYPERVISOR_shared_info; + return synch_test_and_set_bit(port, s->evtchn_mask); +} static inline void clear_evtchn(int port) { - shared_info_t *s = HYPERVISOR_shared_info; - synch_clear_bit(port, &s->evtchn_pending[0]); + shared_info_t *s = HYPERVISOR_shared_info; + synch_clear_bit(port, &s->evtchn_pending[0]); } static inline void diff --git a/sys/i386/include/xen/xen-os.h b/sys/i386/include/xen/xen-os.h index 92ba5e7..3ea0556 100644 --- a/sys/i386/include/xen/xen-os.h +++ b/sys/i386/include/xen/xen-os.h @@ -98,12 +98,6 @@ void printk(const char *fmt, ...); /* some function prototypes */ void trap_init(void); -extern int preemptable; -#define preempt_disable() (preemptable = 0) -#define preempt_enable() (preemptable = 1) -#define preempt_enable_no_resched() (preemptable = 1) - - /* * STI/CLI equivalents. These basically set and clear the virtual * event_enable flag in teh shared_info structure. Note that when @@ -115,10 +109,8 @@ extern int preemptable; #define __cli() \ do { \ vcpu_info_t *_vcpu; \ - preempt_disable(); \ _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ _vcpu->evtchn_upcall_mask = 1; \ - preempt_enable_no_resched(); \ barrier(); \ } while (0) @@ -126,36 +118,23 @@ do { \ do { \ vcpu_info_t *_vcpu; \ barrier(); \ - preempt_disable(); \ _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ _vcpu->evtchn_upcall_mask = 0; \ barrier(); /* unmask then check (avoid races) */ \ if ( unlikely(_vcpu->evtchn_upcall_pending) ) \ force_evtchn_callback(); \ - preempt_enable(); \ -} while (0) - - -#define __save_flags(x) \ -do { \ - vcpu_info_t *vcpu; \ - vcpu = HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ - (x) = _vcpu->evtchn_upcall_mask; \ } while (0) #define __restore_flags(x) \ do { \ vcpu_info_t *_vcpu; \ barrier(); \ - preempt_disable(); \ _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \ if ((_vcpu->evtchn_upcall_mask = (x)) == 0) { \ barrier(); /* unmask then check (avoid races) */ \ if ( unlikely(_vcpu->evtchn_upcall_pending) ) \ force_evtchn_callback(); \ - preempt_enable(); \ - } else \ - preempt_enable_no_resched(); \ + } \ } while (0) /* diff --git a/sys/i386/include/xen/xen_intr.h b/sys/i386/include/xen/xen_intr.h index de2d3c9..8ee4a45 100644 --- a/sys/i386/include/xen/xen_intr.h +++ b/sys/i386/include/xen/xen_intr.h @@ -32,7 +32,6 @@ /* Dynamic binding of event channels and VIRQ sources to Linux IRQ space. */ extern void unbind_from_irq(int irq); -extern void bind_evtchn_to_cpu(unsigned int chn, unsigned int cpu); extern int bind_caller_port_to_irqhandler(unsigned int caller_port, const char *devname, driver_intr_t handler, void *arg, unsigned long irqflags, void **cookiep); @@ -41,8 +40,12 @@ extern int bind_listening_port_to_irqhandler(unsigned int remote_domain, void **cookiep); extern int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu, const char *devname, driver_filter_t filter, driver_intr_t handler, unsigned long irqflags); -extern int bind_ipi_to_irqhandler(unsigned int ipi, unsigned int cpu, const char *devname, - driver_intr_t handler, unsigned long irqflags); +extern int bind_ipi_to_irqhandler(unsigned int ipi, + unsigned int cpu, + const char *devname, + driver_intr_t handler, + unsigned long irqflags); + extern int bind_interdomain_evtchn_to_irqhandler(unsigned int remote_domain, unsigned int remote_port, const char *devname, @@ -65,7 +68,7 @@ extern void enable_irq(unsigned int); extern void irq_suspend(void); extern void irq_resume(void); -extern void idle_block(void); - +extern void idle_block(void); +extern int ap_cpu_initclocks(int cpu); #endif /* _XEN_INTR_H_ */ diff --git a/sys/i386/include/xen/xenfunc.h b/sys/i386/include/xen/xenfunc.h index 533b10c..e1a707d 100644 --- a/sys/i386/include/xen/xenfunc.h +++ b/sys/i386/include/xen/xenfunc.h @@ -67,8 +67,6 @@ void _xen_machphys_update(vm_paddr_t, vm_paddr_t, char *file, int line); void xen_update_descriptor(union descriptor *, union descriptor *); -void ap_cpu_initclocks(void); - extern struct mtx balloon_lock; #if 0 #define balloon_lock(__flags) mtx_lock_irqsave(&balloon_lock, __flags) |