Changeset 8387


Ignore:
Timestamp:
Feb 1, 2008, 4:13:18 AM (17 years ago)
Author:
Gary Byers
Message:

Some win64 conditionalization; hope it doesn't break anything.

Location:
trunk/source/lisp-kernel
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/Threads.h

    r7828 r8387  
    1717#include <stdlib.h>
    1818#include <unistd.h>
     19#ifndef WINDOWS
    1920#include <sys/mman.h>
     21#endif
    2022#include <stdio.h>
     23#ifndef WINDOWS
    2124#include <pthread.h>
     25#endif
    2226#include <errno.h>
    2327#include <limits.h>
     28
    2429#undef USE_MACH_SEMAPHORES
    25 #undef USE_POSIX_SEMAPHORES
     30#define USE_POSIX_SEMAPHORES
     31#undef USE_WINDOWS_SEMAPHORES
     32
    2633#ifdef DARWIN
    2734#define USE_MACH_SEMAPHORES 1
    28 #endif
    29 #ifndef USE_MACH_SEMAPHORES
    30 #define USE_POSIX_SEMAPHORES
     35#undef  USE_POSIX_SEMAPHORES
     36#endif
     37#ifdef WINDOWS
     38#define USE_WINDOWS_SEMPAHORES 1
     39#undef USE_POSIX_SEMAPHORES
     40#endif
     41
     42#ifdef USE_POSIX_SEMAPHORES
    3143#include <semaphore.h>
    3244#endif
     45
     46
    3347#ifdef USE_MACH_SEMAPHORES
    3448/* We have to use Mach semaphores, even if we're otherwise
     
    7084#define TCR_FROM_TSD(tsd) ((TCR *)((natural)(tsd)-TCR_BIAS))
    7185
     86#ifdef USE_WINDOWS_SEMAPHORES
     87
     88typedef void *sem_t;
     89
     90#endif
    7291#ifdef USE_POSIX_SEMAPHORES
    7392typedef sem_t * SEMAPHORE;
  • trunk/source/lisp-kernel/lisp.h

    r6900 r8387  
    3737extern int page_size, log2_page_size;
    3838
    39 static inline unsigned long
    40 _align_to_power_of_2(unsigned long n, unsigned power)
     39static inline natural
     40_align_to_power_of_2(natural n, unsigned power)
    4141{
    42   unsigned long align = (1<<power) -1;
     42  natural align = (1<<power) -1;
    4343
    4444  return (n+align) & ~align;
    4545}
    4646
    47 #define align_to_power_of_2(n,p) _align_to_power_of_2(((unsigned long)(n)),p)
     47#define align_to_power_of_2(n,p) _align_to_power_of_2(((natural)(n)),p)
    4848
    4949static inline unsigned long
     
    7373#define PLATFORM_OS_DARWIN 3
    7474#define PLATFORM_OS_FREEBSD 4
     75#define PLATFORM_OS_WINDOWS 6
    7576
    7677#ifdef LINUX
     
    8889#ifdef SOLARIS
    8990#define PLATFORM_OS PLATFORM_OS_SOLARIS
     91#endif
     92
     93#ifdef WINDOWS
     94#define PLATFORM_OS PLATFORM_OS_WINDOWS
    9095#endif
    9196
  • trunk/source/lisp-kernel/pmcl-kernel.c

    r8246 r8387  
    3131#include <stdio.h>
    3232#include <stdlib.h>
     33#ifndef WINDOWS
    3334#include <sys/mman.h>
     35#endif
    3436#include <fcntl.h>
    3537#include <signal.h>
    3638#include <unistd.h>
    3739#include <errno.h>
     40#ifndef WINDOWS
    3841#include <sys/utsname.h>
     42#endif
    3943
    4044#ifdef LINUX
     
    106110
    107111#include <ctype.h>
     112#ifndef WINDOWS
    108113#include <sys/select.h>
     114#endif
    109115#include "Threads.h"
    110116
     
    141147{
    142148  void * cache_start = (void *) p;
    143   unsigned long ncacheflush = (unsigned long) q - (unsigned long) p;
     149  natural ncacheflush = (natural) q - (natural) p;
    144150
    145151  xMakeDataExecutable(cache_start, ncacheflush); 
     
    149155ensure_stack_limit(size_t stack_size)
    150156{
     157#ifdef WINDOWS
     158#else
    151159  struct rlimit limits;
    152160  rlim_t cur_stack_limit, max_stack_limit;
     
    168176    }
    169177  }
     178#endif
    170179  return stack_size;
    171180}
     
    189198  void *allocate_stack(unsigned);
    190199  void free_stack(void *);
    191   unsigned size = useable+softsize+hardsize;
    192   unsigned overhead;
     200  natural size = useable+softsize+hardsize;
     201  natural overhead;
    193202  BytePtr base, softlimit, hardlimit;
    194203  OSErr err;
     
    16311640
    16321641#ifndef DARWIN
     1642#ifdef WINDOWS
     1643#else
    16331644void *
    16341645xGetSharedLibrary(char *path, int mode)
     
    16361647  return dlopen(path, mode);
    16371648}
     1649#else
    16381650#else
    16391651void *
  • trunk/source/lisp-kernel/win64/Makefile

    r7827 r8387  
    11#
    2 #   Copyright (C) 2005 Clozure Associates
     2#   Copyright (C) 2007 Clozure Associates
    33#   This file is part of OpenMCL. 
    44#
     
    1717VPATH = ../
    1818RM = /bin/rm
    19 CC = x86_64-pc-mingw32-gcc
    20 AS = x86_64-pc-mingw32-as
     19# gcc64, as64: until there's a real win64 gcc, assume that gcc and gas
     20# are installed under these names
     21CC = gcc64
     22AS = as64
    2123M4 = m4
     24LD = ld
    2225ASFLAGS = --64
    2326M4FLAGS = -DWIN64 -DWINDOWS -DX86 -DX8664 -DHAVE_TLS -DEMUTLS
    2427CDEFINES = -DWIN64 -DWINDOWS -D_REENTRANT -DX86 -DX8664 -D_GNU_SOURCE -DHAVE_TLS -DEMUTLS #-DDISABLE_EGC
    25 CDEBUG = -g
     28CDEBUG = -gcoff
    2629COPT = -O2
    2730
     
    4043        $(M4) $(M4FLAGS) -I../ $< | $(AS)  $(ASFLAGS) -o $@
    4144.c.o:
    42         $(CC) -c $< $(CDEFINES) $(CDEBUG) $(COPT) -m64 -o $@
     45        $(CC) -c $< $(CDEFINES) $(CDEBUG) $(COPT) -fno-leading-underscore -m64 -o $@
    4346
    4447SPOBJ = pad.o x86-spjump64.o x86-spentry64.o x86-subprims64.o
Note: See TracChangeset for help on using the changeset viewer.