Windows 32-bit fio fixes
authorBruce Cran <BCran@fusionio.com>
Fri, 8 Jun 2012 06:12:20 +0000 (08:12 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 8 Jun 2012 06:12:20 +0000 (08:12 +0200)
Fix no-op shift in shmget by casting to 64-bit.
Generate a new Product GUID for fio 2.0.8.
Add the 32-bit MinGW-w64 compiler executable name in Makefile.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Makefile
os/windows/install.wxs
os/windows/posix.c

index f72bf8e..6a41710 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -61,6 +61,7 @@ ifneq (,$(findstring CYGWIN,$(UNAME)))
   LIBS  += -lpthread -lpsapi -lws2_32
   CFLAGS += -DPSAPI_VERSION=1 -Ios/windows/posix/include -Wno-format
   CC     = x86_64-w64-mingw32-gcc
+  #CC    = i686-w64-mingw32-gcc
 endif
 
 OBJS = $(SOURCE:.c=.o)
index 5bea45c..f8da8fc 100755 (executable)
@@ -7,7 +7,7 @@
                <?define ProgramDirectory = ProgramFiles64Folder ?>\r
        <?endif?>\r
 \r
-       <Product Id="CCE88492-8C5A-4EAF-8B82-E22A90CEC47B"\r
+       <Product Id="2BA394F9-0D9E-4597-BB9D-6B18097D64BB"\r
          Codepage="1252" Language="1033"\r
          Manufacturer="fio" Name="fio"\r
          UpgradeCode="2338A332-5511-43cf-b9BD-5C60496CCFCC" Version="2.0.8">\r
index 9ef369e..41bcb2d 100755 (executable)
@@ -393,7 +393,9 @@ HANDLE fileMappings[1024];
 int shmget(key_t key, size_t size, int shmflg)
 {
        int mapid = -1;
-       HANDLE hMapping = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, (PAGE_EXECUTE_READWRITE | SEC_RESERVE), size >> 32, size & 0xFFFFFFFF, NULL);
+       uint32_t size_low = size & 0xFFFFFFFF;
+       uint32_t size_high = ((uint64_t)size) >> 32;
+       HANDLE hMapping = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, (PAGE_EXECUTE_READWRITE | SEC_RESERVE), size_high, size_low, NULL);
        if (hMapping != NULL) {
                fileMappings[nFileMappings] = hMapping;
                mapid = nFileMappings;