Skip to content

Commit 6af1d2d

Browse files
Yu-Shiang LinYu-Shiang Lin
Yu-Shiang Lin
authored and
Yu-Shiang Lin
committed
QEMU 2.4.0
0 parents  commit 6af1d2d

File tree

15,734 files changed

+4119360
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

15,734 files changed

+4119360
-0
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
sftp-config.json
2+
*.o
3+
*.ko
4+
*.[oa]
5+
qcu-device/tags

README

Whitespace-only changes.

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# qCUDA
2+
3+
In start qemu vm's command, add "device virtio-hm-pci".
4+
5+
6+
qcu-device:
7+
QEMU Hypervisior with virtio device. Using in host.
8+
9+
qcu-driver:
10+
virtio device driver. Using in guest.
11+
12+
qcu-library:
13+
cuda API. Using in guest.
14+
Note: before using this library, you should add "--enable-cuda" when compiler hypervisior. At Host side, it is using nvidia official driver.
15+
16+
test:
17+
sample code for write, read and cuda.
18+

qcu-device/.exrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"VIM settings to match QEMU coding style. They are activated by adding the
2+
"following settings (without the " symbol) as last two lines in $HOME/.vimrc:
3+
"set secure
4+
"set exrc
5+
set expandtab
6+
set shiftwidth=4
7+
set smarttab

qcu-device/.mailmap

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This mailmap just translates the weird addresses from the original import into git
2+
# into proper addresses so that they are counted properly in git shortlog output.
3+
#
4+
Andrzej Zaborowski <[email protected]> balrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>
5+
Anthony Liguori <[email protected]> aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
6+
Anthony Liguori <[email protected]> Anthony Liguori <[email protected]>
7+
Aurelien Jarno <[email protected]> aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
8+
Blue Swirl <[email protected]> blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>
9+
Edgar E. Iglesias <[email protected]> edgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162>
10+
Fabrice Bellard <[email protected]> bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>
11+
Jocelyn Mayer <[email protected]> j_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>
12+
Paul Brook <[email protected]> pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>
13+
Thiemo Seufer <[email protected]> ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
14+
malc <[email protected]> malc <malc@c046a42c-6fe2-441c-8c8c-71466251a162>
15+
# There is also a:
16+
# (no author) <(no author)@c046a42c-6fe2-441c-8c8c-71466251a162>
17+
# for the cvs2svn initialization commit e63c3dc74bf.

qcu-device/.travis.yml

+103
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
language: c
2+
python:
3+
- "2.4"
4+
compiler:
5+
- gcc
6+
- clang
7+
notifications:
8+
irc:
9+
channels:
10+
- "irc.oftc.net#qemu"
11+
on_success: change
12+
on_failure: always
13+
env:
14+
global:
15+
- TEST_CMD=""
16+
- EXTRA_CONFIG=""
17+
# Development packages, EXTRA_PKGS saved for additional builds
18+
- CORE_PKGS="libusb-1.0-0-dev libiscsi-dev librados-dev libncurses5-dev"
19+
- NET_PKGS="libseccomp-dev libgnutls-dev libssh2-1-dev libspice-server-dev libspice-protocol-dev libnss3-dev"
20+
- GUI_PKGS="libgtk-3-dev libvte-2.90-dev libsdl1.2-dev libpng12-dev libpixman-1-dev"
21+
- EXTRA_PKGS=""
22+
matrix:
23+
# Group major targets together with their linux-user counterparts
24+
- TARGETS=alpha-softmmu,alpha-linux-user
25+
- TARGETS=arm-softmmu,arm-linux-user,armeb-linux-user,aarch64-softmmu,aarch64-linux-user
26+
- TARGETS=cris-softmmu,cris-linux-user
27+
- TARGETS=i386-softmmu,i386-linux-user,x86_64-softmmu,x86_64-linux-user
28+
- TARGETS=m68k-softmmu,m68k-linux-user
29+
- TARGETS=microblaze-softmmu,microblazeel-softmmu,microblaze-linux-user,microblazeel-linux-user
30+
- TARGETS=mips-softmmu,mips64-softmmu,mips64el-softmmu,mipsel-softmmu
31+
- TARGETS=mips-linux-user,mips64-linux-user,mips64el-linux-user,mipsel-linux-user,mipsn32-linux-user,mipsn32el-linux-user
32+
- TARGETS=or32-softmmu,or32-linux-user
33+
- TARGETS=ppc-softmmu,ppc64-softmmu,ppcemb-softmmu,ppc-linux-user,ppc64-linux-user,ppc64abi32-linux-user,ppc64le-linux-user
34+
- TARGETS=s390x-softmmu,s390x-linux-user
35+
- TARGETS=sh4-softmmu,sh4eb-softmmu,sh4-linux-user sh4eb-linux-user
36+
- TARGETS=sparc-softmmu,sparc64-softmmu,sparc-linux-user,sparc32plus-linux-user,sparc64-linux-user
37+
- TARGETS=unicore32-softmmu,unicore32-linux-user
38+
# Group remaining softmmu only targets into one build
39+
- TARGETS=lm32-softmmu,moxie-softmmu,tricore-softmmu,xtensa-softmmu,xtensaeb-softmmu
40+
git:
41+
# we want to do this ourselves
42+
submodules: false
43+
before_install:
44+
- wget -O - http://people.linaro.org/~alex.bennee/qemu-submodule-git-seed.tar.xz | tar -xvJ
45+
- git submodule update --init --recursive
46+
- sudo apt-get update -qq
47+
- sudo apt-get install -qq ${CORE_PKGS} ${NET_PKGS} ${GUI_PKGS} ${EXTRA_PKGS}
48+
before_script:
49+
- ./configure --target-list=${TARGETS} --enable-debug-tcg ${EXTRA_CONFIG}
50+
script:
51+
- make -j2 && ${TEST_CMD}
52+
matrix:
53+
# We manually include a number of additional build for non-standard bits
54+
include:
55+
# Make check target (we only do this once)
56+
- env:
57+
- TARGETS=alpha-softmmu,arm-softmmu,aarch64-softmmu,cris-softmmu,
58+
i386-softmmu,x86_64-softmmu,m68k-softmmu,microblaze-softmmu,
59+
microblazeel-softmmu,mips-softmmu,mips64-softmmu,
60+
mips64el-softmmu,mipsel-softmmu,or32-softmmu,ppc-softmmu,
61+
ppc64-softmmu,ppcemb-softmmu,s390x-softmmu,sh4-softmmu,
62+
sh4eb-softmmu,sparc-softmmu,sparc64-softmmu,
63+
unicore32-softmmu,unicore32-linux-user,
64+
lm32-softmmu,moxie-softmmu,tricore-softmmu,xtensa-softmmu,
65+
xtensaeb-softmmu
66+
TEST_CMD="make check"
67+
compiler: gcc
68+
# Debug related options
69+
- env: TARGETS=i386-softmmu,x86_64-softmmu
70+
EXTRA_CONFIG="--enable-debug"
71+
compiler: gcc
72+
- env: TARGETS=i386-softmmu,x86_64-softmmu
73+
EXTRA_CONFIG="--enable-debug --enable-tcg-interpreter"
74+
compiler: gcc
75+
# All the extra -dev packages
76+
- env: TARGETS=i386-softmmu,x86_64-softmmu
77+
EXTRA_PKGS="libaio-dev libcap-ng-dev libattr1-dev libbrlapi-dev uuid-dev libusb-1.0.0-dev"
78+
compiler: gcc
79+
# Currently configure doesn't force --disable-pie
80+
- env: TARGETS=i386-softmmu,x86_64-softmmu
81+
EXTRA_CONFIG="--enable-gprof --enable-gcov --disable-pie"
82+
compiler: gcc
83+
- env: TARGETS=i386-softmmu,x86_64-softmmu
84+
EXTRA_PKGS="sparse"
85+
EXTRA_CONFIG="--enable-sparse"
86+
compiler: gcc
87+
# All the trace backends (apart from dtrace)
88+
- env: TARGETS=i386-softmmu,x86_64-softmmu
89+
EXTRA_CONFIG="--enable-trace-backends=stderr"
90+
compiler: gcc
91+
- env: TARGETS=i386-softmmu,x86_64-softmmu
92+
EXTRA_CONFIG="--enable-trace-backends=simple"
93+
compiler: gcc
94+
- env: TARGETS=i386-softmmu,x86_64-softmmu
95+
EXTRA_CONFIG="--enable-trace-backends=ftrace"
96+
compiler: gcc
97+
- env: TARGETS=i386-softmmu,x86_64-softmmu
98+
EXTRA_PKGS="liblttng-ust-dev liburcu-dev"
99+
EXTRA_CONFIG="--enable-trace-backends=ust"
100+
compiler: gcc
101+
- env: TARGETS=i386-softmmu,x86_64-softmmu
102+
EXTRA_CONFIG="--enable-modules"
103+
compiler: gcc

qcu-device/CODING_STYLE

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
QEMU Coding Style
2+
=================
3+
4+
Please use the script checkpatch.pl in the scripts directory to check
5+
patches before submitting.
6+
7+
1. Whitespace
8+
9+
Of course, the most important aspect in any coding style is whitespace.
10+
Crusty old coders who have trouble spotting the glasses on their noses
11+
can tell the difference between a tab and eight spaces from a distance
12+
of approximately fifteen parsecs. Many a flamewar have been fought and
13+
lost on this issue.
14+
15+
QEMU indents are four spaces. Tabs are never used, except in Makefiles
16+
where they have been irreversibly coded into the syntax.
17+
Spaces of course are superior to tabs because:
18+
19+
- You have just one way to specify whitespace, not two. Ambiguity breeds
20+
mistakes.
21+
- The confusion surrounding 'use tabs to indent, spaces to justify' is gone.
22+
- Tab indents push your code to the right, making your screen seriously
23+
unbalanced.
24+
- Tabs will be rendered incorrectly on editors who are misconfigured not
25+
to use tab stops of eight positions.
26+
- Tabs are rendered badly in patches, causing off-by-one errors in almost
27+
every line.
28+
- It is the QEMU coding style.
29+
30+
Do not leave whitespace dangling off the ends of lines.
31+
32+
2. Line width
33+
34+
Lines are 80 characters; not longer.
35+
36+
Rationale:
37+
- Some people like to tile their 24" screens with a 6x4 matrix of 80x24
38+
xterms and use vi in all of them. The best way to punish them is to
39+
let them keep doing it.
40+
- Code and especially patches is much more readable if limited to a sane
41+
line length. Eighty is traditional.
42+
- It is the QEMU coding style.
43+
44+
3. Naming
45+
46+
Variables are lower_case_with_underscores; easy to type and read. Structured
47+
type names are in CamelCase; harder to type but standing out. Enum type
48+
names and function type names should also be in CamelCase. Scalar type
49+
names are lower_case_with_underscores_ending_with_a_t, like the POSIX
50+
uint64_t and family. Note that this last convention contradicts POSIX
51+
and is therefore likely to be changed.
52+
53+
When wrapping standard library functions, use the prefix qemu_ to alert
54+
readers that they are seeing a wrapped version; otherwise avoid this prefix.
55+
56+
4. Block structure
57+
58+
Every indented statement is braced; even if the block contains just one
59+
statement. The opening brace is on the line that contains the control
60+
flow statement that introduces the new block; the closing brace is on the
61+
same line as the else keyword, or on a line by itself if there is no else
62+
keyword. Example:
63+
64+
if (a == 5) {
65+
printf("a was 5.\n");
66+
} else if (a == 6) {
67+
printf("a was 6.\n");
68+
} else {
69+
printf("a was something else entirely.\n");
70+
}
71+
72+
Note that 'else if' is considered a single statement; otherwise a long if/
73+
else if/else if/.../else sequence would need an indent for every else
74+
statement.
75+
76+
An exception is the opening brace for a function; for reasons of tradition
77+
and clarity it comes on a line by itself:
78+
79+
void a_function(void)
80+
{
81+
do_something();
82+
}
83+
84+
Rationale: a consistent (except for functions...) bracing style reduces
85+
ambiguity and avoids needless churn when lines are added or removed.
86+
Furthermore, it is the QEMU coding style.
87+
88+
5. Declarations
89+
90+
Mixed declarations (interleaving statements and declarations within blocks)
91+
are not allowed; declarations should be at the beginning of blocks. In other
92+
words, the code should not generate warnings if using GCC's
93+
-Wdeclaration-after-statement option.
94+
95+
6. Conditional statements
96+
97+
When comparing a variable for (in)equality with a constant, list the
98+
constant on the right, as in:
99+
100+
if (a == 1) {
101+
/* Reads like: "If a equals 1" */
102+
do_something();
103+
}
104+
105+
Rationale: Yoda conditions (as in 'if (1 == a)') are awkward to read.
106+
Besides, good compilers already warn users when '==' is mis-typed as '=',
107+
even when the constant is on the right.

0 commit comments

Comments
 (0)