X-Git-Url: https://git.wh0rd.org/?p=ICEs.git;a=blobdiff_plain;f=318007%2Fbuf0buf.i.1;fp=318007%2Fbuf0buf.i.1;h=7ed48b5673da2cb4551a880f63d750f74e6da936;hp=0000000000000000000000000000000000000000;hb=81f80d8c1c9898ae1c26534a3287a47220390f5c;hpb=45516216fc552c838e650d868214d867027a64f6 diff --git a/318007/buf0buf.i.1 b/318007/buf0buf.i.1 new file mode 100644 index 0000000..7ed48b5 --- /dev/null +++ b/318007/buf0buf.i.1 @@ -0,0 +1,46 @@ +typedef unsigned long int ulint; +typedef long int lint; +typedef struct rw_lock_struct rw_lock_t; +struct rw_lock_struct { + volatile lint lock_word; + volatile ulint reader_count; + volatile ulint writer; +}; +static inline ulint rw_lock_x_lock_func_nowait(rw_lock_t * lock, + const char *file_name, + ulint line) +{ + if (lock->reader_count == 0) { + if (__sync_lock_test_and_set(&(lock->writer), 351) == 350) { + retry_x_lock:if (__sync_sub_and_fetch(&(lock->lock_word), 0x00100000) + == 0) { + if (__sync_fetch_and_add + (&(lock->lock_word), 0x00100000) == 0) + goto retry_x_lock; + } + } + } +} + +typedef struct mtr_struct mtr_t; +typedef struct buf_block_struct buf_block_t; +typedef unsigned char buf_frame_t; +struct buf_block_struct { + rw_lock_t lock; + struct { + } awe_LRU_free_mapped; +}; +buf_frame_t *buf_page_get_gen(ulint space, ulint offset, ulint rw_latch, + buf_frame_t * guess, ulint mode, const char *file, + ulint line, mtr_t * mtr) +{ + buf_block_t *block; + ulint success; + if (mode == 12) { + if (rw_latch == 1) { + success = + rw_lock_x_lock_func_nowait(&(block->lock), file, + line); + } + } +}