Changeset 919b09a62be1e318c5b142de70468c11e8fc980e

Show
Ignore:
Timestamp:
12/17/07 19:03:15 (6 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1197918195 +0000
git-parent:

[c105913d38157700cbb9fbc7f0f6f8a7b18de103]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1197918195 +0000
Message:

umm.. that last commit was junk, I should work on one machine... This compiles on OpenBSD

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Makefile.in

    rc105913 r919b09a  
    11all: 
    22        (cd src && make) 
     3 
     4clean: 
     5        (cd src && make clean) 
  • src/Makefile.in

    rc105913 r919b09a  
    3636noitd:  make-subdirs $(OBJS) 
    3737        $(CC) -o $@ $(OBJS) \ 
     38                $(LDFLAGS) \ 
    3839                -Leventer -leventer \ 
    3940                -Lutils -lnoit_utils \ 
    40                 -Ljlog -ljlog 
     41                -Ljlog -ljlog \ 
     42                $(LIBS) 
    4143 
    4244.c.o: 
     
    4547clean-subdirs: 
    4648        for dir in $(SUBS) ; do \ 
    47                 make -C $$dir clean ; \ 
     49                (cd $$dir && make clean) ; \ 
    4850        done 
    4951 
  • src/eventer/eventer.c

    rb62cf2b r919b09a  
    2828 
    2929int eventer_choose(const char *name) { 
    30   int i; 
    3130  eventer_impl_t choice; 
    3231  for(choice = registered_eventers[0]; choice; choice++) { 
  • src/utils/noit_atomic.h

    r1452e33 r919b09a  
    99#include "noit_config.h" 
    1010 
    11 typedef int32_t noit_atomic_t; 
     11typedef int32_t noit_atomic32_t; 
    1212typedef int64_t noit_atomic64_t; 
    1313 
     
    3030#elif defined(__GNUC__) 
    3131 
    32 typedef u_int32_t noit_atomic32_t 
    33 typedef u_int64_t noit_atomic64_t 
    34  
    3532#if (SIZEOF_VOID_P == 4) 
    3633#define noit_atomic_casptr(a,b,c) noit_atomic_cas32((a),(void *)(b),(void *)(c)) 
     
    4138#endif 
    4239 
     40typedef noit_atomic32_t noit_spinlock_t; 
     41 
    4342static inline noit_atomic32_t 
    44 noit_atomic_cas32(volatile noit_atomic32_t *ptr 
     43noit_atomic_cas32(volatile noit_atomic32_t *ptr, 
    4544                  volatile noit_atomic32_t rpl, 
    4645                  volatile noit_atomic32_t curr) { 
     
    5655#ifdef __x86_64__ 
    5756static inline noit_atomic64_t 
    58 noit_atomic_cas64(volatile noit_atomic64_t *ptr 
     57noit_atomic_cas64(volatile noit_atomic64_t *ptr, 
    5958                  volatile noit_atomic64_t rpl, 
    6059                  volatile noit_atomic64_t curr) { 
     
    6968#else 
    7069static inline noit_atomic64_t 
    71 noit_atomic_cas64(volatile noit_atomic64_t *ptr 
     70noit_atomic_cas64(volatile noit_atomic64_t *ptr, 
    7271                  volatile noit_atomic64_t rpl, 
    7372                  volatile noit_atomic64_t curr) { 
     
    8786#endif 
    8887 
     88static inline void noit_spinlock_lock(volatile noit_spinlock_t *lock) { 
     89  while(noit_atomic_cas32(lock, 1, 0) != 0); 
     90} 
     91static inline void noit_spinlock_unlock(volatile noit_spinlock_t *lock) { 
     92  while(noit_atomic_cas32(lock, 0, 1) != 1); 
     93} 
     94static inline noit_spinlock_trylock(volatile noit_spinlock_t *lock) { 
     95  return (noit_atomic_cas32(lock, 1, 0) == 0); 
     96} 
     97 
    8998#else 
    9099#error Please stub out the atomics section for your platform