~ubuntu-branches/ubuntu/karmic/virtualbox-ose/karmic-updates

« back to all changes in this revision

Viewing changes to src/VBox/Additions/x11/x11include/xorg-server-1.6.0/prim_x86_gcc.h

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-09-14 18:25:07 UTC
  • mfrom: (0.4.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090914182507-c98g07mq16hjmn6d
Tags: 3.0.6-dfsg-1ubuntu1
* Merge from debian unstable (LP: #429697), remaining changes:
  - Enable DKMS support on virtualbox host and guest modules (LP: #267097)
    - Drop virtualbox-ose{-guest,}-modules-* package templates
    - Recommend *-source instead of *-modules packages
    - Replace error messages related to missing/mismatched
      kernel module accordingly
  - Autoload kernel module
    - LOAD_VBOXDRV_MODULE=1 in virtualbox-ose.default
  - Disable update action
    - patches/u01-disable-update-action.dpatch
  - Virtualbox should go in Accessories, not in System tools (LP: #288590)
    - virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add apport hook
    - virtualbox-ose.files/source_virtualbox-ose.py
    - virtualbox-ose.install
  - Add launchpad integration
    - control
    - lpi-bug.xpm
    - patches/u02-lp-integration.dpatch
  - virtualbox, virtualbox-* (names of the upstream proprietary packages)
    conflict with virtualbox-ose (LP: #379878)
* Make debug package depend on normal or guest utils package
* Drop patches/22-pulseaudio-stubs.dpatch (applied upstream)
* Rename Ubuntu specific patches to uXX-*.dpatch
* Fix lintian warnings in maintainer scripts

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/****************************************************************************
2
 
*
3
 
* Inline helpers for x86emu
4
 
*
5
 
* Copyright (C) 2008 Bart Trojanowski, Symbio Technologies, LLC
6
 
*
7
 
*  ========================================================================
8
 
*
9
 
*  Permission to use, copy, modify, distribute, and sell this software and
10
 
*  its documentation for any purpose is hereby granted without fee,
11
 
*  provided that the above copyright notice appear in all copies and that
12
 
*  both that copyright notice and this permission notice appear in
13
 
*  supporting documentation, and that the name of the authors not be used
14
 
*  in advertising or publicity pertaining to distribution of the software
15
 
*  without specific, written prior permission.  The authors makes no
16
 
*  representations about the suitability of this software for any purpose.
17
 
*  It is provided "as is" without express or implied warranty.
18
 
*
19
 
*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
20
 
*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
21
 
*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
22
 
*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
23
 
*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
24
 
*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
25
 
*  PERFORMANCE OF THIS SOFTWARE.
26
 
*
27
 
*  ========================================================================
28
 
*
29
 
* Language:     GNU C
30
 
* Environment:  GCC on i386 or x86-64
31
 
* Developer:    Bart Trojanowski
32
 
*
33
 
* Description:  This file defines a few x86 macros that can be used by the
34
 
*               emulator to execute native instructions.
35
 
*
36
 
*               For PIC vs non-PIC code refer to:
37
 
*               http://sam.zoy.org/blog/2007-04-13-shlib-with-non-pic-code-have-inline-assembly-and-pic-mix-well
38
 
*
39
 
****************************************************************************/
40
 
#ifndef __X86EMU_PRIM_X86_GCC_H
41
 
#define __X86EMU_PRIM_X86_GCC_H
42
 
 
43
 
#include "x86emu/types.h"
44
 
 
45
 
#if !defined(__GNUC__) || !(defined (__i386__) || defined(__i386) || defined(__AMD64__) || defined(__amd64__))
46
 
#error This file is intended to be used by gcc on i386 or x86-64 system
47
 
#endif
48
 
 
49
 
#if defined(__PIC__) && defined(__i386__)
50
 
 
51
 
#define X86EMU_HAS_HW_CPUID 1
52
 
static inline void hw_cpuid (u32 *a, u32 *b, u32 *c, u32 *d)
53
 
{
54
 
    __asm__ __volatile__ ("pushl %%ebx      \n\t"
55
 
                          "cpuid            \n\t"
56
 
                          "movl %%ebx, %1   \n\t"
57
 
                          "popl %%ebx       \n\t"
58
 
                          : "=a" (*a), "=r" (*b),
59
 
                            "=c" (*c), "=d" (*d)
60
 
                          : "a" (*a), "c" (*c)
61
 
                          : "cc");
62
 
}
63
 
 
64
 
#else // ! (__PIC__ && __i386__)
65
 
 
66
 
#define x86EMU_HAS_HW_CPUID 1
67
 
static inline void hw_cpuid (u32 *a, u32 *b, u32 *c, u32 *d)
68
 
{
69
 
    __asm__ __volatile__ ("cpuid"
70
 
                          : "=a" (*a), "=b" (*b),
71
 
                            "=c" (*c), "=d" (*d)
72
 
                          : "a" (*a), "c" (*c)
73
 
                          : "cc");
74
 
}
75
 
 
76
 
#endif // __PIC__ && __i386__
77
 
 
78
 
 
79
 
#endif // __X86EMU_PRIM_X86_GCC_H