~ubuntu-branches/ubuntu/precise/linux-lowlatency/precise-proposed

« back to all changes in this revision

Viewing changes to ubuntu/ndiswrapper/win2lin_stubs.S

  • Committer: Package Import Robot
  • Author(s): Luke Yelavich, Andy Whitcroft, Chase Douglas, Eugeni Dodonov, Ingo Molnar, Johannes Berg, John Johansen, Kees Cook, Leann Ogasawara, Robert Hooker, Seth Heasley, Tim Gardner, Luke Yelavich, Upstream Kernel Changes
  • Date: 2012-03-09 10:21:12 UTC
  • Revision ID: package-import@ubuntu.com-20120309102112-s1abu8w051stx2rl
Tags: 3.2.0-18.26
[ Andy Whitcroft ]

* [Config] clean up the human consumable package descriptions
* [Config] fix generic flavour description
* [Config] clean up linux-tools package descriptions
  - LP: #593107
* deviations -- note the source of the Hyper-V updates
* SAUCE: ata_piix: defer to the Hyper-V drivers by default
  - LP: #929545
* ubuntu: AUFS -- adapt to the new changelog handling
* ubuntu: AUFS -- sort out the relative header paths
* ubuntu: AUFS -- update to d266b0c5d0693d6383976ee54b9e2c0fa9a3f5b0

[ Chase Douglas ]

* SAUCE: (drop after 3.3) HID: hid-magicmouse: Add pointer and buttonpad
  properties for Magic Trackpad
* SAUCE: Input: synaptics - add second variant of two-button clickpad
* SAUCE: Input: synapticss - Set buttonpad property for all clickpads

[ Eugeni Dodonov ]

* SAUCE: drm/i915: do not enable RC6p on Sandy Bridge
* SAUCE: drm/i915: fix operator precedence when enabling RC6p

[ Ingo Molnar ]

* ubuntu: nx-emu - i386: NX emulation

[ Johannes Berg ]

* SAUCE: iwlwifi: fix key removal
  - LP: #911059

[ John Johansen ]

* Revert "SAUCE: AppArmor: Fix unpack of network tables."
* Revert "SAUCE: AppArmor: Allow dfa backward compatibility with broken
  userspace"
* SAUCE: AppArmor: Add mising end of structure test to caps unpacking
* SAUCE: AppArmor: Fix dropping of allowed operations that are force
  audited
* SAUCE: AppArmor: Fix underflow in xindex calculation
* SAUCE: AppArmor: fix mapping of META_READ to audit and quiet flags
* SAUCE: AppArmor: Fix the error case for chroot relative path name
  lookup
  - LP: #925028
* SAUCE: AppArmor: Retrieve the dentry_path for error reporting when path
  lookup fails
  - LP: #925028
* SAUCE: AppArmor: Minor cleanup of d_namespace_path to consolidate error
  handling
* SAUCE: AppArmor: Update dfa matching routines.
* SAUCE: AppArmor: Move path failure information into aa_get_name and
  rename
* SAUCE: AppArmor: Make chroot relative the default path lookup type
* SAUCE: AppArmor: Add ability to load extended policy
* SAUCE: AppArmor: basic networking rules
* SAUCE: AppArmor: Add profile introspection file to interface
* SAUCE: AppArmor: Add the ability to mediate mount
* SAUCE: AppArmor: Add mount information to apparmorfs

[ Kees Cook ]

* SAUCE: (drop after 3.3) security: create task_free security callback
* SAUCE: (drop after 3.3) security: Yama LSM
* SAUCE: (drop after 3.3) Yama: add PR_SET_PTRACER_ANY
* SAUCE: Yama: add link restrictions
* SAUCE: security: unconditionally chain to Yama LSM
* SAUCE: AppArmor: refactor securityfs to use structures
* SAUCE: AppArmor: add initial "features" directory to securityfs
* SAUCE: AppArmor: add "file" details to securityfs
* SAUCE: AppArmor: export known rlimit names/value mappings in securityfs
* ubuntu: Yama - LSM hooks
* ubuntu: Yama - add ptrace relationship tracking interface
* ubuntu: Yama - unconditionally chain to Yama LSM

[ Leann Ogasawara ]

* Revert "[Config] Enable CONFIG_NVRAM=m"
  - LP: #942193
* Drop ndiswrapper
* Ubuntu-3.2.0-17.26
* Ubuntu-3.2.0-17.27
* Rebase to v3.2.7
* [Config] Enable CONFIG_USB_SERIAL_QUATECH2=m on arm and powerpc
* [Config] Enable CONFIG_USB_SERIAL_QUATECH_USB2=m on arm and powerpc
* [Config] Add CONFIG_NVRAM to config enforcer
  - LP: #942193
* [Config] Enable CONFIG_SCSI_IBMVSCSI=m for powerpc
  - LP: #943090
* [Config] Enable CONFIG_SCSI_IPR=m for powerpc
  - LP: #943090
* provide ipmi udeb
  - LP: #942926
* Rebase to v3.2.9
* Add ibmveth to d-i/modules-powerpc/nic-modules
  - LP: #712188
* [Config] Enable CONFIG_SCSI_IBMVFC=m for powerpc
  - LP: #712188
* Add ibmvfc and ibmvscsic to d-i/modules-powerpc/nic-modules
  - LP: #712188
* Ubuntu-3.2.0-18.28

[ Robert Hooker ]

* SAUCE: drm/i915: Enable RC6 by default on sandybridge.

[ Seth Heasley ]

* SAUCE: ALSA: hda - Add Lynx Point HD Audio Controller DeviceIDs
  - LP: #900119
* SAUCE: ahci: AHCI-mode SATA patch for Intel Lynx Point DeviceIDs
  - LP: #900119
* SAUCE: ata_piix: IDE-mode SATA patch for Intel Lynx Point DeviceIDs
  - LP: #900119
* SAUCE: i2c-i801: Add device IDs for Intel Lynx Point
  - LP: #900119

[ Tim Gardner ]

* dropped hv_mouse
* [Config] CONFIG_X86_NUMACHIP=y
* [Config] updateconfigs after apparmor patches
* [Config] Added hv_netvsc and hv_storvsc to -virtual
  - LP: #942256
* [Config] Enable aufs
  - LP: #943119
* SAUCE: Made kernel irq-threaded by default

[ Luke Yelavich ]

* UBUNTU: Depend on crda (>=1.1.1-1ubuntu2) | wireless-crda as per precise
  mainline packaging

[ Upstream Kernel Changes ]

* Revert "Revert "ath9k_hw: fix interpretation of the rx KeyMiss flag""
* Revert "AppArmor: compatibility patch for v5 interface"
* Revert "AppArmor: compatibility patch for v5 network controll"
* Staging: hv: vmbus: Support building the vmbus driver as part of the
  kernel
* hv: Add Kconfig menu entry
* Drivers: hv: Fix a memory leak
* Drivers: hv: Make the vmbus driver unloadable
* Drivers: hv: Get rid of an unnecessary check in hv.c
* Staging: hv: mousevsc: Make boolean states boolean
* Staging: hv: mousevsc: Inline the code for mousevsc_on_device_add()
* Staging: hv: mousevsc: Inline the code for reportdesc_callback()
* Staging: hv: mousevsc: Cleanup mousevsc_on_channel_callback()
* Staging: hv: mousevsc: Add a new line to a debug string
* Staging: hv: mousevsc: Get rid of unnecessary include files
* Staging: hv: mousevsc: Address some style issues
* Staging: hv: mousevsc: Add a check to prevent memory corruption
* Staging: hv: mousevsc: Use the KBUILD_MODNAME macro
* Staging: hv: storvsc: Use mempools to allocate struct
  storvsc_cmd_request
* Staging: hv: storvsc: Cleanup error handling in the probe function
* Staging: hv: storvsc: Fixup the error when processing SET_WINDOW
  command
* Staging: hv: storvsc: Fix error handling storvsc_host_reset()
* Staging: hv: storvsc: Use the accessor function shost_priv()
* Staging: hv: storvsc: Use the unlocked version queuecommand
* Staging: hv: storvsc: use the macro KBUILD_MODNAME
* Staging: hv: storvsc: Get rid of an unnecessary forward declaration
* Staging: hv: storvsc: Upgrade the vmstor protocol version
* Staging: hv: storvsc: Support hot add of scsi disks
* Staging: hv: storvsc: Support hot-removing of scsi devices
* staging: hv: Use kmemdup rather than duplicating its implementation
* staging: hv: move hv_netvsc out of staging area
* Staging: hv: mousevsc: Properly add the hid device
* Staging: hv: storvsc: Disable clustering
* Staging: hv: storvsc: Cleanup storvsc_device_alloc()
* Staging: hv: storvsc: Fix a bug in storvsc_command_completion()
* Staging: hv: storvsc: Fix a bug in copy_from_bounce_buffer()
* Staging: hv: storvsc: Implement per device memory pools
* Staging: hv: remove hv_mouse driver as it's now in the hid directory
* Staging: hv: update TODO file
* Staging: hv: storvsc: Fix a bug in create_bounce_buffer()
* net/hyperv: Fix long lines in netvsc.c
* net/hyperv: Add support for promiscuous mode setting
* net/hyperv: Fix the stop/wake queue mechanism
* net/hyperv: Remove unnecessary kmap_atomic in netvsc driver
* net/hyperv: Add NETVSP protocol version negotiation
* net/hyperv: Add support for jumbo frame up to 64KB
* net/hyperv: fix possible memory leak in do_set_multicast()
* net/hyperv: rx_bytes should account the ether header size
* net/hyperv: fix the issue that large packets be dropped under bridge
* net/hyperv: Use netif_tx_disable() instead of netif_stop_queue() when
  necessary
* net/hyperv: Fix the page buffer when an RNDIS message goes beyond page
  boundary
* HID: Move the hid-hyperv driver out of staging
* HID: hv_mouse: Properly add the hid device
* HID: hyperv: Properly disconnect the input device
* Staging: hv: storvsc: Cleanup some comments
* Staging: hv: storvsc: Cleanup storvsc_probe()
* Staging: hv: storvsc: Cleanup storvsc_queuecommand()
* Staging: hv: storvsc: Introduce defines for srb status codes
* Staging: hv: storvsc: Cleanup storvsc_host_reset_handler()
* Staging: hv: storvsc: Move and cleanup storvsc_remove()
* Staging: hv: storvsc: Add a comment to explain life-cycle management
* Staging: hv: storvsc: Get rid of the on_io_completion in
  hv_storvsc_request
* Staging: hv: storvsc: Rename the context field in hv_storvsc_request
* Staging: hv: storvsc: Miscellaneous cleanup of storvsc driver
* Staging: hv: storvsc: Cleanup the code for generating protocol version
* Staging: hv: storvsc: Cleanup some protocol related constants
* Staging: hv: storvsc: Get rid of some unused defines
* Staging: hv: storvsc: Consolidate the request structure
* Staging: hv: storvsc: Consolidate all the wire protocol definitions
* Staging: hv: storvsc: Move the storage driver out of the staging area
* x86: Make flat_init_apic_ldr() available
* x86: Add x86_init platform override to fix up NUMA core numbering
* x86: Add NumaChip support
* x86/numachip: Drop unnecessary conflict with EDAC
* Input: bcm5974 - set BUTTONPAD property
* Ubuntu: Rebase to v3.2.8
* ACPI / PM: Do not save/restore NVS on Asus K54C/K54HR
  - LP: #898503
* Add low latency source

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *  Copyright (C) 2005 Karl Vogel, Giridhar Pemmasani
3
 
 *
4
 
 *  This program is free software; you can redistribute it and/or modify
5
 
 *  it under the terms of the GNU General Public License as published by
6
 
 *  the Free Software Foundation; either version 2 of the License, or
7
 
 *  (at your option) any later version.
8
 
 *
9
 
 *  This program is distributed in the hope that it will be useful,
10
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
 
 *  GNU General Public License for more details.
13
 
 *
14
 
 */
15
 
 
16
 
#include <linux/linkage.h>
17
 
 
18
 
#ifdef CONFIG_X86_64
19
 
 
20
 
/*
21
 
# Windows <---> Linux register usage conversion when calling functions
22
 
# V = Volatile
23
 
# NV = Non Volatile (needs to be saved)
24
 
#
25
 
#         Win                     Lin
26
 
# ---------------------------------------
27
 
# Rax    Return           V       Return          V
28
 
# Rbx                     NV                      NV
29
 
# Rcx     Arg1            V       Arg4            V
30
 
# Rdx     Arg2            V       Arg3            V
31
 
# Rsi                     NV      Arg2            V
32
 
# Rdi                     NV      Arg1            V
33
 
# Rsp                     NV                      NV
34
 
# Rbp                     NV                      NV
35
 
# R8      Arg3            V       Arg5            V
36
 
# R9      Arg4            V       Arg6            V
37
 
# R10                     V                       V
38
 
# R11                     V                       V
39
 
# R12                     NV                      NV
40
 
# R13                     NV                      NV
41
 
# R14                     NV                      NV
42
 
# R15                     NV                      NV
43
 
#
44
 
# In addition, Linux uses %rax to indicate number of SSE registers used
45
 
# when variadic functions are called. Since there is no way to obtain this
46
 
# from Windows, for now, we just assume this is 0 (hence %rax is cleared).
47
 
#
48
 
# Windows pushes arguments 5 and higher onto stack in case of integer
49
 
# variables and 4 and higher in case of floating point variabes (passed
50
 
# in SSE registers).
51
 
 
52
 
In a windows function, the stackframe/registers look like this:
53
 
 
54
 
# 0x0048 ....
55
 
# 0x0040 arg8
56
 
# 0x0038 arg7
57
 
# 0x0030 arg6
58
 
# 0x0028 arg5
59
 
# 0x0020 shadow/spill space for arg4
60
 
# 0x0018 shadow/spill space for arg3
61
 
# 0x0010 shadow/spill space for arg2
62
 
# 0x0008 shadow/spill space for arg1
63
 
# 0x0000 ret
64
 
 
65
 
# register spill space is same irrespective of number of arguments - even
66
 
# if Windows function takes less than 4 arguments, 32 bytes above return
67
 
# address is reserved for the function
68
 
 
69
 
In Linux it should look like:
70
 
 
71
 
# 0x0018 ....
72
 
# 0x0010 arg8
73
 
# 0x0008 arg7
74
 
# 0x0000 ret
75
 
 
76
 
*/
77
 
 
78
 
#
79
 
# setup for Windows to Linux function call
80
 
#
81
 
 
82
 
        .text
83
 
 
84
 
.macro win2lin_prolog
85
 
        push    %rsi
86
 
        push    %rdi
87
 
.endm
88
 
 
89
 
.macro win2lin_epilog
90
 
        pop     %rdi
91
 
        pop     %rsi
92
 
.endm
93
 
 
94
 
# when Windows function calls Linux function, the function address is in %r10
95
 
 
96
 
.macro call_lin_func
97
 
        xor     %rax, %rax      # rax indicates number of SSE regs
98
 
        call    *%r10
99
 
.endm
100
 
 
101
 
# before prolog, 0(%rsp) is return address, 8(%rsp) would be arg1
102
 
# (but it is in register) and so on, so n'th arg would be at n*8(%rsp)
103
 
# for n > 4. But in prolog, we push 2 registers that are non-volaile in
104
 
# Windows, but volatile in Linux. So after prolog, args are at (n+2)*8(%rsp)
105
 
 
106
 
#define win2lin_win_arg(n) (n+2)*8(%rsp)
107
 
 
108
 
#define win2lin_arg1 mov %rcx, %rdi
109
 
#define win2lin_arg2 mov %rdx, %rsi
110
 
#define win2lin_arg3 mov %r8, %rdx
111
 
#define win2lin_arg4 mov %r9, %rcx
112
 
#define win2lin_arg5 mov win2lin_win_arg(5), %r8
113
 
#define win2lin_arg6 mov win2lin_win_arg(6), %r9
114
 
 
115
 
        .type   win2lin0, @function
116
 
win2lin0:
117
 
        win2lin_prolog
118
 
        call_lin_func
119
 
        win2lin_epilog
120
 
        ret
121
 
        .size   win2lin0, .-win2lin0
122
 
 
123
 
        .type   win2lin1, @function
124
 
win2lin1:
125
 
        win2lin_prolog
126
 
        win2lin_arg1
127
 
        call_lin_func
128
 
        win2lin_epilog
129
 
        ret
130
 
        .size   win2lin1, .-win2lin1
131
 
 
132
 
        .type   win2lin2, @function
133
 
win2lin2:
134
 
        win2lin_prolog
135
 
        win2lin_arg1
136
 
        win2lin_arg2
137
 
        call_lin_func
138
 
        win2lin_epilog
139
 
        ret
140
 
        .size   win2lin2, .-win2lin2
141
 
 
142
 
        .type   win2lin3, @function
143
 
win2lin3:
144
 
        win2lin_prolog
145
 
        win2lin_arg1
146
 
        win2lin_arg2
147
 
        win2lin_arg3
148
 
        call_lin_func
149
 
        win2lin_epilog
150
 
        ret
151
 
        .size   win2lin3, .-win2lin3
152
 
 
153
 
        .type   win2lin4, @function
154
 
win2lin4:
155
 
        win2lin_prolog
156
 
        win2lin_arg1
157
 
        win2lin_arg2
158
 
        win2lin_arg3
159
 
        win2lin_arg4
160
 
        call_lin_func
161
 
        win2lin_epilog
162
 
        ret
163
 
        .size   win2lin4, .-win2lin4
164
 
 
165
 
        .type   win2lin5, @function
166
 
win2lin5:
167
 
        win2lin_prolog
168
 
        win2lin_arg1
169
 
        win2lin_arg2
170
 
        win2lin_arg3
171
 
        win2lin_arg4
172
 
        win2lin_arg5
173
 
        call_lin_func
174
 
        win2lin_epilog
175
 
        ret
176
 
        .size   win2lin5, .-win2lin5
177
 
 
178
 
        .type   win2lin6, @function
179
 
win2lin6:
180
 
        win2lin_prolog
181
 
        win2lin_arg1
182
 
        win2lin_arg2
183
 
        win2lin_arg3
184
 
        win2lin_arg4
185
 
        win2lin_arg5
186
 
        win2lin_arg6
187
 
        call_lin_func
188
 
        win2lin_epilog
189
 
        ret
190
 
        .size   win2lin6, .-win2lin6
191
 
 
192
 
# Allocate stack frame for Linux arguments before calling function.
193
 
# First 6 args are passed through registers, so we need space for 7 and above.
194
 
# The arguments should have been copied onto stack already.
195
 
 
196
 
.macro call_lin_func_args n
197
 
        sub $(\n-6)*8, %rsp
198
 
        call_lin_func
199
 
        add $(\n-6)*8, %rsp
200
 
        .endm
201
 
 
202
 
# m is index of Linux arg required, n is total number of args to function
203
 
# After stack frame is allocated, Linux arg 7 should be at 0(%rsp),
204
 
# arg 8 should be at 1*8(%rsp) and so on. So Linux arg m should be at (m-7)*8
205
 
# Stack frame starts at -(n-6)*8(%rsp), so before stack frame is allocated
206
 
# Linux arg m should be at (6-n+m-7)*8(%rsp)
207
 
 
208
 
#define win2lin_lin_arg(m,n) (m-1-n)*8(%rsp)
209
 
 
210
 
        .type   win2lin7, @function
211
 
win2lin7:
212
 
        win2lin_prolog
213
 
 
214
 
        win2lin_arg1
215
 
        win2lin_arg2
216
 
        win2lin_arg3
217
 
        win2lin_arg4
218
 
        win2lin_arg5
219
 
        win2lin_arg6
220
 
 
221
 
        # copy windows argument 7 onto stack for Linux function
222
 
        mov     win2lin_win_arg(7), %r11
223
 
        mov     %r11, win2lin_lin_arg(7,7)
224
 
 
225
 
        call_lin_func_args(7)
226
 
        win2lin_epilog
227
 
        ret
228
 
        .size   win2lin7, .-win2lin7
229
 
 
230
 
        .type   win2lin8, @function
231
 
win2lin8:
232
 
        win2lin_prolog
233
 
 
234
 
        win2lin_arg1
235
 
        win2lin_arg2
236
 
        win2lin_arg3
237
 
        win2lin_arg4
238
 
        win2lin_arg5
239
 
        win2lin_arg6
240
 
 
241
 
        # copy windows arguments 7 and 8 onto stack for Linux function
242
 
        mov     win2lin_win_arg(7), %r11
243
 
        mov     %r11, win2lin_lin_arg(7,8)
244
 
        mov     win2lin_win_arg(8), %r11
245
 
        mov     %r11, win2lin_lin_arg(8,8)
246
 
 
247
 
        call_lin_func_args(8)
248
 
        win2lin_epilog
249
 
        ret
250
 
        .size   win2lin8, .-win2lin8
251
 
 
252
 
        .type   win2lin9, @function
253
 
win2lin9:
254
 
win2lin10:
255
 
win2lin11:
256
 
win2lin12:
257
 
        win2lin_prolog
258
 
 
259
 
        # since we destroy rsi and rdi here, first copy windows
260
 
        # arguments 7 through 12 onto stack for Linux function
261
 
        mov     %rcx, %r11              # save rcx
262
 
        lea     win2lin_win_arg(7), %rsi        # source (windows arg 7 and up)
263
 
        lea     win2lin_lin_arg(7,12), %rdi     # = destination
264
 
        mov     $6, %rcx                        # 6 arguments
265
 
        rep
266
 
        movsq
267
 
        mov     %r11, %rcx              # restore rcx
268
 
 
269
 
        win2lin_arg1
270
 
        win2lin_arg2
271
 
        win2lin_arg3
272
 
        win2lin_arg4
273
 
        win2lin_arg5
274
 
        win2lin_arg6
275
 
 
276
 
        call_lin_func_args(12)
277
 
        win2lin_epilog
278
 
        ret
279
 
        .size   win2lin9, .-win2lin9
280
 
 
281
 
#define win2lin(name, argc)                     \
282
 
ENTRY(win2lin_ ## name ## _ ## argc)            \
283
 
        lea     name(%rip), %r10 ;              \
284
 
        jmp     win2lin ## argc
285
 
 
286
 
#include "win2lin_stubs.h"
287
 
 
288
 
#endif // CONFIG_X86_64