~ubuntu-branches/ubuntu/hardy/kvm/hardy-backports

« back to all changes in this revision

Viewing changes to kernel/external-module-compat.h

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2008-02-26 13:10:57 UTC
  • mfrom: (1.1.18 upstream)
  • Revision ID: james.westby@ubuntu.com-20080226131057-s67x6l89mtjw1x9b
Tags: 1:62+dfsg-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
#include <linux/compiler.h>
11
11
#include <linux/version.h>
12
12
#include <linux/string.h>
13
 
#include "include/linux/kvm.h"
14
 
#include "include/linux/kvm_para.h"
 
13
#include <linux/kvm.h>
 
14
#include <linux/kvm_para.h>
15
15
#include <linux/cpu.h>
16
16
#include <asm/processor.h>
17
17
#include <linux/hrtimer.h>
348
348
#endif
349
349
 
350
350
#ifndef CONFIG_PREEMPT_NOTIFIERS
 
351
/*
 
352
 * Include sched|preempt.h before defining CONFIG_PREEMPT_NOTIFIERS to avoid
 
353
 * a miscompile.
 
354
 */
 
355
#include <linux/sched.h>
 
356
#include <linux/preempt.h>
 
357
#define CONFIG_PREEMPT_NOTIFIERS
 
358
#define CONFIG_PREEMPT_NOTIFIERS_COMPAT
351
359
 
352
360
struct preempt_notifier;
353
361
 
556
564
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
557
565
 
558
566
#define mmdrop(x) do { (void)(x); } while (0)
 
567
#define mmget(x) do { (void)(x); } while (0)
 
568
 
 
569
#else
 
570
 
 
571
#define mmget(x) do { atomic_inc(x); } while (0)
559
572
 
560
573
#endif
561
574
 
580
593
#define EFER_LMA            (1<<_EFER_LMA)
581
594
#endif
582
595
 
 
596
/* pagefault_enable(), page_fault_disable() - 2.6.20 */
 
597
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
 
598
 
 
599
#define pagefault_enable()  do {} while (0)
 
600
#define pagefault_disable() do {} while (0)
 
601
 
 
602
#endif
 
603
 
583
604
/* vm ops ->fault() was introduced in 2.6.23. */
584
605
#include <linux/mm.h>
585
606
 
638
659
 
639
660
#endif
640
661
#endif
 
662
 
 
663
/* simple vfs attribute getter signature has changed to add a return code */
 
664
 
 
665
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
 
666
 
 
667
#define MAKE_SIMPLE_ATTRIBUTE_GETTER(x)       \
 
668
        static u64 x(void *v)                 \
 
669
        {                                     \
 
670
                u64 ret = 0;                  \
 
671
                                              \
 
672
                __##x(v, &ret);               \
 
673
                return ret;                   \
 
674
        }
 
675
 
 
676
#else
 
677
 
 
678
#define MAKE_SIMPLE_ATTRIBUTE_GETTER(x)       \
 
679
        static int x(void *v, u64 *val)       \
 
680
        {                                     \
 
681
                return __##x(v, val);         \
 
682
        }
 
683
 
 
684
#endif
 
685
 
 
686
/* set_kset_name() is gone in 2.6.25 */
 
687
 
 
688
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
 
689
 
 
690
#define set_kset_name(x) .name = x
 
691
 
 
692
#endif
 
693
 
 
694
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
 
695
#ifndef FASTCALL
 
696
#define FASTCALL(x)     x
 
697
#define fastcall
 
698
#endif
 
699
#endif
 
700
 
 
701
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
 
702
 
 
703
#define kvm_tsc_khz 2000000
 
704
 
 
705
#else
 
706
 
 
707
#define kvm_tsc_khz tsc_khz
 
708
 
 
709
#endif
 
710
 
 
711
struct kvm_desc_struct {
 
712
        union {
 
713
                struct { unsigned int a, b; };
 
714
                struct {
 
715
                        u16 limit0;
 
716
                        u16 base0;
 
717
                        unsigned base1: 8, type: 4, s: 1, dpl: 2, p: 1;
 
718
                        unsigned limit: 4, avl: 1, l: 1, d: 1, g: 1, base2: 8;
 
719
                };
 
720
 
 
721
        };
 
722
} __attribute__((packed));
 
723
 
 
724
struct kvm_ldttss_desc64 {
 
725
        u16 limit0;
 
726
        u16 base0;
 
727
        unsigned base1 : 8, type : 5, dpl : 2, p : 1;
 
728
        unsigned limit1 : 4, zero0 : 3, g : 1, base2 : 8;
 
729
        u32 base3;
 
730
        u32 zero1;
 
731
} __attribute__((packed));