~n-muench/ubuntu/precise/open-vm-tools/open-vm-tools.raring-precise.backport

« back to all changes in this revision

Viewing changes to lib/misc/utilMem.c

  • Committer: Package Import Robot
  • Author(s): Nate Muench
  • Date: 2012-01-23 16:09:45 UTC
  • mfrom: (1.4.6) (2.4.26 sid)
  • Revision ID: package-import@ubuntu.com-20120123160945-b6s0r1vkcovucpf3
Tags: 2011.12.20-562307-0ubuntu1
* Merge latest upstream git tag. Fixes building on Precise
  (LP: #898289, LP: #905612)

* Items merged from Debian unstable:
  - debian/control:
    + open-vm-tools recommends open-vm-dkms. (LP: #598933)
    + open-vm-tools now suggests open-vm-toolbox. (LP: #604998)
  (From 2011.08.21-471295-1 release)
  - Updating maintainer and uploaders fields.
  - Removing vcs fields.
  - Removing references to Daniel's old email address.
  - Updating years in copyright file.
  - Updating to standards version 3.9.2.
  - Updating to debhelper version 8.
  - Switching to source format 3.0 (quilt).
  - Removing manual chrpath setting.
  - Removing exclusion from plugins from debhelper shlibs.
  - Rediffing kvers.patch.
  (From 2011.09.23-491607-1 release)
  - Marking binary architecture-dependend packages as linux and kfreebsd
  only.
  - Removing liburiparser-dev from build-depends as upstream dropped
  unity support.
  - Building with libproc-dev on amd64 again.
  - Dropping disabling of dnet support.
  (From 2011.09.23-491607-2 release)
  - Adding doxygen to build-depends for api documentation.
  - Adding libcunit1-dev to build-depends for test suites.
  - Minimizing rules file.
  - Adding open-vm-tools-dev package, containing only the api
    documentation for now.
  (From 2011.09.23-491607-3 release)
  - Sorting overrides in rules alphabetically.
  - Compacting copyright file.
  - Adding udev rule to set timeout for vmware scsi devices
  (From 2011.12.20-562307-1 release)
  - Adding patch to correct typo in upstreams dkms configuration

* Remaining Changes:
  - Remove Stable part of version numbering.
  - debian folder:
    + Re-added open-vm-dkms.postinst & open-vm-dkms.prerm.
      * Allows dkms modules to compile upon installation.
  - debian/control:
    + Re-add open-vm-source and make into a transitional package
      for open-vm-toolbox.
    + Return dependancies that were moved to open-vm-tools back to
      open-vm-toolbox.
  - debian/rules and debian/open-vm-toolbox.lintian-overrides:
    + Make vmware-user-suid-wrapper suid-root
  - debian/rules:
    + Added CFLAGS field with -Wno-deprecated-declarations
      * Will suppress issues with glib 2.31 or later.
    + Add line to copy vmware-xdg-detect-de into place.
    + Install vmware-user.desktop through toolbox package.
  - debian/open-vm-tools.init:
    + Re-add 'modprobe [-r] vmblock'.
    + Add 'modprobe [-r] vmxnet'.
      * Incase it's not loaded during boot.
    + Remove and re-add pcnet32 module
      * Will be done before (remove) and after (readd) vmxnet module
        is added.
      * If vmxnet doesn't exist (aka modules fail to build), pcnet32 can be
        still used for network connectivity.
      * Workaround until a better fix can be done.
  - Re-add gnome-session to debian/local/xautostart.conf
  - Manpages removed (from debian/manpages):
    + vmmemctl.9
    + vmxnet3.9
    + Remove references to manpages that have been removed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
236
236
 
237
237
   return (char *) memcpy(copy, s, size);
238
238
}
 
239
 
 
240
void *
 
241
Util_Memcpy(void *dest,
 
242
            const void *src,
 
243
            size_t count)
 
244
{
 
245
   uintptr_t align = ((uintptr_t)dest | (uintptr_t)src | count);
 
246
 
 
247
#if defined __GNUC__
 
248
 
 
249
   #if defined(__x86_64__)
 
250
 
 
251
      size_t dummy0;
 
252
      void *dummy1;
 
253
      void *dummy2;
 
254
 
 
255
      if ((align & 7) == 0) {
 
256
         __asm__ __volatile__("\t"
 
257
                               "cld"            "\n\t"
 
258
                               "rep ; movsq"    "\n"
 
259
                               : "=c" (dummy0), "=D" (dummy1), "=S" (dummy2)
 
260
                               : "0" (count >> 3), "1" (dest), "2" (src)
 
261
                               : "memory", "cc"
 
262
            );
 
263
         return dest;
 
264
      } else if ((align & 3) == 0) {
 
265
         __asm__ __volatile__("\t"
 
266
                               "cld"            "\n\t"
 
267
                               "rep ; movsd"    "\n"
 
268
                               : "=c" (dummy0), "=D" (dummy1), "=S" (dummy2)
 
269
                               : "0" (count >> 2), "1" (dest), "2" (src)
 
270
                               : "memory", "cc"
 
271
            );
 
272
         return dest;
 
273
      }
 
274
 
 
275
   #elif defined(__i386__)
 
276
 
 
277
      size_t dummy0;
 
278
      void *dummy1;
 
279
      void *dummy2;
 
280
 
 
281
      if ((align & 3) == 0) {
 
282
         __asm__ __volatile__("\t"
 
283
                               "cld"            "\n\t"
 
284
                               "rep ; movsd"    "\n"
 
285
                               : "=c" (dummy0), "=D" (dummy1), "=S" (dummy2)
 
286
                               : "0" (count >> 2), "1" (dest), "2" (src)
 
287
                               : "memory", "cc"
 
288
            );
 
289
         return dest;
 
290
      }
 
291
 
 
292
   #endif
 
293
  
 
294
#elif defined _MSC_VER
 
295
 
 
296
   #if defined(__x86_64__)
 
297
 
 
298
      if ((align & 7) == 0) {
 
299
         __movsq((uint64 *)dest, (uint64 *)src, count >> 3);
 
300
         return dest;
 
301
      } else if ((align & 3) == 0) {
 
302
         __movsd((unsigned long *)dest, (unsigned long *)src, count >> 2);
 
303
         return dest;
 
304
      }
 
305
 
 
306
   #elif defined(__i386__)
 
307
 
 
308
      if ((((uintptr_t)dest | (uintptr_t)src | count) & 3) == 0) {
 
309
         __movsd((unsigned long *)dest, (unsigned long *)src, count >> 2);
 
310
         return dest;
 
311
      }
 
312
 
 
313
   #endif
 
314
 
 
315
 
 
316
#endif
 
317
 
 
318
   memcpy(dest, src, count);
 
319
   return dest;
 
320
}
 
321
            
 
322