Skip to content

Instantly share code, notes, and snippets.

View rlibby's full-sized avatar

Ryan Libby rlibby

  • Seattle, Washington, United States
View GitHub Profile
#include <stdint.h>
/* Example atomic operation. */
#define atomic_load_8(p) (*(volatile uint8_t *)(p))
#define atomic_load_16(p) (*(volatile uint16_t *)(p))
#define atomic_load_32(p) (*(volatile uint32_t *)(p))
#define atomic_load_64(p) (*(volatile uint64_t *)(p))
/* An expression that is either 0 or a compile-time error. */
#define __atomic_size_check(s) \
diff --git a/sys/mips/mips/busdma_machdep.c b/sys/mips/mips/busdma_machdep.c
index 73c884fc1cb6..ecc71e549753 100644
--- a/sys/mips/mips/busdma_machdep.c
+++ b/sys/mips/mips/busdma_machdep.c
@@ -252,7 +252,7 @@ busdma_init(void *dummy)
mips_dcache_max_linesize, /* minimum_alignment */
busdma_bufalloc_alloc_uncacheable,
busdma_bufalloc_free_uncacheable,
- 0); /* uma_zcreate_flags */
+ UMA_ZONE_OFFPAGE); /* uma_zcreate_flags */
#define bzero(buf, len) __builtin_memset((buf), 0, (len))
#define MAXMEMDOM 1
#define PQ_INACTIVE 0
#define PQ_COUNT 4
void vm_page_startup(void);
extern int vm_ndomains;
struct vm_pagequeue {
const char *pq_name;
@rlibby
rlibby / squashfs4.2-cygwin.patch
Created April 19, 2011 03:42
Patches squashfs4.2/squashfs-tools to compile cleanly under Cygwin. Based on this: http://comsul.blogspot.com/2008/12/squashfs-on-cygwin.html
diff -u original/squashfs4.2/squashfs-tools/mksquashfs.c patched/squashfs4.2/squashfs-tools/mksquashfs.c
--- original/squashfs4.2/squashfs-tools/mksquashfs.c 2011-02-28 14:24:09.000000000 -0800
+++ patched/squashfs4.2/squashfs-tools/mksquashfs.c 2011-04-18 19:42:17.042515000 -0700
@@ -51,10 +51,12 @@
#include <sys/wait.h>
#ifndef linux
+#ifndef __CYGWIN__
#define __BYTE_ORDER BYTE_ORDER
#define __BIG_ENDIAN BIG_ENDIAN