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

« back to all changes in this revision

Viewing changes to ubuntu/ndiswrapper/divdi3.c

  • 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
 
/* 64-bit multiplication and division
2
 
   Copyright (C) 1989, 1992-1999, 2000, 2001, 2002, 2003
3
 
   Free Software Foundation, Inc.
4
 
   This file is part of the GNU C Library.
5
 
 
6
 
   The GNU C Library is free software; you can redistribute it and/or
7
 
   modify it under the terms of the GNU Lesser General Public
8
 
   License as published by the Free Software Foundation; either
9
 
   version 2.1 of the License, or (at your option) any later version.
10
 
 
11
 
   The GNU C Library is distributed in the hope that it will be useful,
12
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 
   Lesser General Public License for more details.
15
 
 
16
 
   You should have received a copy of the GNU Lesser General Public
17
 
   License along with the GNU C Library; if not, write to the Free
18
 
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19
 
   02111-1307 USA.  */
20
 
 
21
 
#include <linux/module.h>
22
 
#include <linux/kernel.h>
23
 
 
24
 
#if BITS_PER_LONG != 32
25
 
#error This is for 32-bit targets only
26
 
#endif
27
 
 
28
 
typedef unsigned int UQItype    __attribute__ ((mode (QI)));
29
 
typedef          int SItype     __attribute__ ((mode (SI)));
30
 
typedef unsigned int USItype    __attribute__ ((mode (SI)));
31
 
typedef          int DItype     __attribute__ ((mode (DI)));
32
 
typedef unsigned int UDItype    __attribute__ ((mode (DI)));
33
 
#define Wtype SItype
34
 
#define HWtype SItype
35
 
#define DWtype DItype
36
 
#define UWtype USItype
37
 
#define UHWtype USItype
38
 
#define UDWtype UDItype
39
 
#define W_TYPE_SIZE 32
40
 
 
41
 
#include "longlong.h"
42
 
 
43
 
#if defined(__BIG_ENDIAN)
44
 
struct DWstruct { Wtype high, low;};
45
 
#elif defined(__LITTLE_ENDIAN)
46
 
struct DWstruct { Wtype low, high;};
47
 
#else
48
 
#error Unhandled endianity
49
 
#endif
50
 
typedef union { struct DWstruct s; DWtype ll; } DWunion;
51
 
 
52
 
/* Prototypes of exported functions.  */
53
 
extern DWtype __divdi3 (DWtype u, DWtype v);
54
 
extern DWtype __moddi3 (DWtype u, DWtype v);
55
 
extern UDWtype __udivdi3 (UDWtype u, UDWtype v);
56
 
extern UDWtype __umoddi3 (UDWtype u, UDWtype v);
57
 
 
58
 
static UDWtype
59
 
__udivmoddi4 (UDWtype n, UDWtype d, UDWtype *rp)
60
 
{
61
 
  DWunion ww;
62
 
  DWunion nn, dd;
63
 
  DWunion rr;
64
 
  UWtype d0, d1, n0, n1, n2;
65
 
  UWtype q0, q1;
66
 
  UWtype b, bm;
67
 
 
68
 
  nn.ll = n;
69
 
  dd.ll = d;
70
 
 
71
 
  d0 = dd.s.low;
72
 
  d1 = dd.s.high;
73
 
  n0 = nn.s.low;
74
 
  n1 = nn.s.high;
75
 
 
76
 
#if !UDIV_NEEDS_NORMALIZATION
77
 
  if (d1 == 0)
78
 
    {
79
 
      if (d0 > n1)
80
 
        {
81
 
          /* 0q = nn / 0D */
82
 
 
83
 
          udiv_qrnnd (q0, n0, n1, n0, d0);
84
 
          q1 = 0;
85
 
 
86
 
          /* Remainder in n0.  */
87
 
        }
88
 
      else
89
 
        {
90
 
          /* qq = NN / 0d */
91
 
 
92
 
          if (d0 == 0)
93
 
            d0 = 1 / d0;        /* Divide intentionally by zero.  */
94
 
 
95
 
          udiv_qrnnd (q1, n1, 0, n1, d0);
96
 
          udiv_qrnnd (q0, n0, n1, n0, d0);
97
 
 
98
 
          /* Remainder in n0.  */
99
 
        }
100
 
 
101
 
      if (rp != 0)
102
 
        {
103
 
          rr.s.low = n0;
104
 
          rr.s.high = 0;
105
 
          *rp = rr.ll;
106
 
        }
107
 
    }
108
 
 
109
 
#else /* UDIV_NEEDS_NORMALIZATION */
110
 
 
111
 
  if (d1 == 0)
112
 
    {
113
 
      if (d0 > n1)
114
 
        {
115
 
          /* 0q = nn / 0D */
116
 
 
117
 
          count_leading_zeros (bm, d0);
118
 
 
119
 
          if (bm != 0)
120
 
            {
121
 
              /* Normalize, i.e. make the most significant bit of the
122
 
                 denominator set.  */
123
 
 
124
 
              d0 = d0 << bm;
125
 
              n1 = (n1 << bm) | (n0 >> (W_TYPE_SIZE - bm));
126
 
              n0 = n0 << bm;
127
 
            }
128
 
 
129
 
          udiv_qrnnd (q0, n0, n1, n0, d0);
130
 
          q1 = 0;
131
 
 
132
 
          /* Remainder in n0 >> bm.  */
133
 
        }
134
 
      else
135
 
        {
136
 
          /* qq = NN / 0d */
137
 
 
138
 
          if (d0 == 0)
139
 
            d0 = 1 / d0;        /* Divide intentionally by zero.  */
140
 
 
141
 
          count_leading_zeros (bm, d0);
142
 
 
143
 
          if (bm == 0)
144
 
            {
145
 
              /* From (n1 >= d0) /\ (the most significant bit of d0 is set),
146
 
                 conclude (the most significant bit of n1 is set) /\ (the
147
 
                 leading quotient digit q1 = 1).
148
 
 
149
 
                 This special case is necessary, not an optimization.
150
 
                 (Shifts counts of W_TYPE_SIZE are undefined.)  */
151
 
 
152
 
              n1 -= d0;
153
 
              q1 = 1;
154
 
            }
155
 
          else
156
 
            {
157
 
              /* Normalize.  */
158
 
 
159
 
              b = W_TYPE_SIZE - bm;
160
 
 
161
 
              d0 = d0 << bm;
162
 
              n2 = n1 >> b;
163
 
              n1 = (n1 << bm) | (n0 >> b);
164
 
              n0 = n0 << bm;
165
 
 
166
 
              udiv_qrnnd (q1, n1, n2, n1, d0);
167
 
            }
168
 
 
169
 
          /* n1 != d0...  */
170
 
 
171
 
          udiv_qrnnd (q0, n0, n1, n0, d0);
172
 
 
173
 
          /* Remainder in n0 >> bm.  */
174
 
        }
175
 
 
176
 
      if (rp != 0)
177
 
        {
178
 
          rr.s.low = n0 >> bm;
179
 
          rr.s.high = 0;
180
 
          *rp = rr.ll;
181
 
        }
182
 
    }
183
 
#endif /* UDIV_NEEDS_NORMALIZATION */
184
 
 
185
 
  else
186
 
    {
187
 
      if (d1 > n1)
188
 
        {
189
 
          /* 00 = nn / DD */
190
 
 
191
 
          q0 = 0;
192
 
          q1 = 0;
193
 
 
194
 
          /* Remainder in n1n0.  */
195
 
          if (rp != 0)
196
 
            {
197
 
              rr.s.low = n0;
198
 
              rr.s.high = n1;
199
 
              *rp = rr.ll;
200
 
            }
201
 
        }
202
 
      else
203
 
        {
204
 
          /* 0q = NN / dd */
205
 
 
206
 
          count_leading_zeros (bm, d1);
207
 
          if (bm == 0)
208
 
            {
209
 
              /* From (n1 >= d1) /\ (the most significant bit of d1 is set),
210
 
                 conclude (the most significant bit of n1 is set) /\ (the
211
 
                 quotient digit q0 = 0 or 1).
212
 
 
213
 
                 This special case is necessary, not an optimization.  */
214
 
 
215
 
              /* The condition on the next line takes advantage of that
216
 
                 n1 >= d1 (true due to program flow).  */
217
 
              if (n1 > d1 || n0 >= d0)
218
 
                {
219
 
                  q0 = 1;
220
 
                  sub_ddmmss (n1, n0, n1, n0, d1, d0);
221
 
                }
222
 
              else
223
 
                q0 = 0;
224
 
 
225
 
              q1 = 0;
226
 
 
227
 
              if (rp != 0)
228
 
                {
229
 
                  rr.s.low = n0;
230
 
                  rr.s.high = n1;
231
 
                  *rp = rr.ll;
232
 
                }
233
 
            }
234
 
          else
235
 
            {
236
 
              UWtype m1, m0;
237
 
              /* Normalize.  */
238
 
 
239
 
              b = W_TYPE_SIZE - bm;
240
 
 
241
 
              d1 = (d1 << bm) | (d0 >> b);
242
 
              d0 = d0 << bm;
243
 
              n2 = n1 >> b;
244
 
              n1 = (n1 << bm) | (n0 >> b);
245
 
              n0 = n0 << bm;
246
 
 
247
 
              udiv_qrnnd (q0, n1, n2, n1, d1);
248
 
              umul_ppmm (m1, m0, q0, d0);
249
 
 
250
 
              if (m1 > n1 || (m1 == n1 && m0 > n0))
251
 
                {
252
 
                  q0--;
253
 
                  sub_ddmmss (m1, m0, m1, m0, d1, d0);
254
 
                }
255
 
 
256
 
              q1 = 0;
257
 
 
258
 
              /* Remainder in (n1n0 - m1m0) >> bm.  */
259
 
              if (rp != 0)
260
 
                {
261
 
                  sub_ddmmss (n1, n0, n1, n0, m1, m0);
262
 
                  rr.s.low = (n1 << b) | (n0 >> bm);
263
 
                  rr.s.high = n1 >> bm;
264
 
                  *rp = rr.ll;
265
 
                }
266
 
            }
267
 
        }
268
 
    }
269
 
 
270
 
  ww.s.low = q0;
271
 
  ww.s.high = q1;
272
 
  return ww.ll;
273
 
}
274
 
 
275
 
DWtype
276
 
__divdi3 (DWtype u, DWtype v)
277
 
{
278
 
  Wtype c = 0;
279
 
  DWtype w;
280
 
 
281
 
  if (u < 0)
282
 
    {
283
 
      c = ~c;
284
 
      u = -u;
285
 
    }
286
 
  if (v < 0)
287
 
    {
288
 
      c = ~c;
289
 
      v = -v;
290
 
    }
291
 
  w = __udivmoddi4 (u, v, NULL);
292
 
  if (c)
293
 
    w = -w;
294
 
  return w;
295
 
}
296
 
 
297
 
DWtype
298
 
__moddi3 (DWtype u, DWtype v)
299
 
{
300
 
  Wtype c = 0;
301
 
  DWtype w;
302
 
 
303
 
  if (u < 0)
304
 
    {
305
 
      c = ~c;
306
 
      u = -u;
307
 
    }
308
 
  if (v < 0)
309
 
    v = -v;
310
 
  __udivmoddi4 (u, v, &w);
311
 
  if (c)
312
 
    w = -w;
313
 
  return w;
314
 
}
315
 
 
316
 
UDWtype
317
 
__udivdi3 (UDWtype u, UDWtype v)
318
 
{
319
 
  return __udivmoddi4 (u, v, NULL);
320
 
}
321
 
 
322
 
UDWtype
323
 
__umoddi3 (UDWtype u, UDWtype v)
324
 
{
325
 
  UDWtype w;
326
 
 
327
 
  __udivmoddi4 (u, v, &w);
328
 
  return w;
329
 
}