[MIPS] Add CONFIG_32BIT to kernel_default_arch_macros for MIPS.
Some of the required structure definitons are defined under this macro.

Change-Id: I7a9a986e371381697dcb56bd8ea362856ffa7509
diff --git a/libc/kernel/arch-mips/asm/asmmacro.h b/libc/kernel/arch-mips/asm/asmmacro.h
index e1e9804..c42d45e 100644
--- a/libc/kernel/arch-mips/asm/asmmacro.h
+++ b/libc/kernel/arch-mips/asm/asmmacro.h
@@ -19,5 +19,6 @@
 #ifndef _ASM_ASMMACRO_H
 #define _ASM_ASMMACRO_H
 #include <asm/hazards.h>
-#endif
+#include <asm/asmmacro-32.h>
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
diff --git a/libc/kernel/arch-mips/asm/cpu-features.h b/libc/kernel/arch-mips/asm/cpu-features.h
index b3642c2..50ce572 100644
--- a/libc/kernel/arch-mips/asm/cpu-features.h
+++ b/libc/kernel/arch-mips/asm/cpu-features.h
@@ -161,26 +161,45 @@
 #define cpu_has_userlocal (cpu_data[0].options & MIPS_CPU_ULRI)
 #endif
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#ifndef cpu_has_nofpuex
+#define cpu_has_nofpuex (cpu_data[0].options & MIPS_CPU_NOFPUEX)
+#endif
+#ifndef cpu_has_64bits
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define cpu_has_64bits (cpu_data[0].isa_level & MIPS_CPU_ISA_64BIT)
+#endif
+#ifndef cpu_has_64bit_zero_reg
+#define cpu_has_64bit_zero_reg (cpu_data[0].isa_level & MIPS_CPU_ISA_64BIT)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
+#ifndef cpu_has_64bit_gp_regs
+#define cpu_has_64bit_gp_regs 0
+#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#ifndef cpu_has_64bit_addresses
+#define cpu_has_64bit_addresses 0
+#endif
 #ifndef cpu_has_vint
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define cpu_has_vint 0
 #endif
 #ifndef cpu_has_veic
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define cpu_has_veic 0
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #endif
 #ifndef cpu_has_inclusive_pcaches
 #define cpu_has_inclusive_pcaches (cpu_data[0].options & MIPS_CPU_INCLUSIVE_CACHES)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #ifndef cpu_dcache_line_size
 #define cpu_dcache_line_size() cpu_data[0].dcache.linesz
 #endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #ifndef cpu_icache_line_size
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define cpu_icache_line_size() cpu_data[0].icache.linesz
 #endif
 #ifndef cpu_scache_line_size
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define cpu_scache_line_size() cpu_data[0].scache.linesz
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #endif
 #endif
diff --git a/libc/kernel/arch-mips/asm/elf.h b/libc/kernel/arch-mips/asm/elf.h
index 6ccb622..6f79694 100644
--- a/libc/kernel/arch-mips/asm/elf.h
+++ b/libc/kernel/arch-mips/asm/elf.h
@@ -186,29 +186,33 @@
 typedef double elf_fpreg_t;
 typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define elf_check_arch(hdr)  ({   int __res = 1;   struct elfhdr *__h = (hdr);     if (__h->e_machine != EM_MIPS)   __res = 0;   if (__h->e_ident[EI_CLASS] != ELFCLASS32)   __res = 0;   if ((__h->e_flags & EF_MIPS_ABI2) != 0)   __res = 0;   if (((__h->e_flags & EF_MIPS_ABI) != 0) &&   ((__h->e_flags & EF_MIPS_ABI) != EF_MIPS_ABI_O32))   __res = 0;     __res;  })
+#define ELF_CLASS ELFCLASS32
 #ifdef __MIPSEB__
 #define ELF_DATA ELFDATA2MSB
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #elif __MIPSEL__
 #define ELF_DATA ELFDATA2LSB
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #endif
 #define ELF_ARCH EM_MIPS
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #endif
 struct mips_abi;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SET_PERSONALITY(ex, ibcs2)  do {   if (ibcs2)   set_personality(PER_SVR4);   set_personality(PER_LINUX);     current->thread.abi = &mips_abi;  } while (0)
 struct task_struct;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define ELF_CORE_COPY_REGS(elf_regs, regs)   elf_dump_regs((elf_greg_t *)&(elf_regs), regs);
 #define ELF_CORE_COPY_TASK_REGS(tsk, elf_regs) dump_task_regs(tsk, elf_regs)
 #define ELF_CORE_COPY_FPREGS(tsk, elf_fpregs)   dump_task_fpu(tsk, elf_fpregs)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define USE_ELF_CORE_DUMP
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define ELF_EXEC_PAGESIZE PAGE_SIZE
 #define ELF_HWCAP (0)
 #define ELF_PLATFORM (NULL)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define ELF_PLAT_INIT(_r, load_addr) do {   _r->regs[1] = _r->regs[2] = _r->regs[3] = _r->regs[4] = 0;   _r->regs[5] = _r->regs[6] = _r->regs[7] = _r->regs[8] = 0;   _r->regs[9] = _r->regs[10] = _r->regs[11] = _r->regs[12] = 0;   _r->regs[13] = _r->regs[14] = _r->regs[15] = _r->regs[16] = 0;   _r->regs[17] = _r->regs[18] = _r->regs[19] = _r->regs[20] = 0;   _r->regs[21] = _r->regs[22] = _r->regs[23] = _r->regs[24] = 0;   _r->regs[25] = _r->regs[26] = _r->regs[27] = _r->regs[28] = 0;   _r->regs[30] = _r->regs[31] = 0;  } while (0)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #ifndef ELF_ET_DYN_BASE
 #define ELF_ET_DYN_BASE (TASK_SIZE / 3 * 2)
 #endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/arch-mips/asm/fcntl.h b/libc/kernel/arch-mips/asm/fcntl.h
index 2686340..73de4ad 100644
--- a/libc/kernel/arch-mips/asm/fcntl.h
+++ b/libc/kernel/arch-mips/asm/fcntl.h
@@ -43,6 +43,18 @@
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define F_SETLKW64 35
 #endif
+struct flock {
+ short l_type;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ short l_whence;
+ off_t l_start;
+ off_t l_len;
+ long l_sysid;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __kernel_pid_t l_pid;
+ long pad[4];
+};
+#define HAVE_ARCH_STRUCT_FLOCK
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #include <asm-generic/fcntl.h>
 #endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/arch-mips/asm/mach-generic/spaces.h b/libc/kernel/arch-mips/asm/mach-generic/spaces.h
index cbda237..0ec1f57 100644
--- a/libc/kernel/arch-mips/asm/mach-generic/spaces.h
+++ b/libc/kernel/arch-mips/asm/mach-generic/spaces.h
@@ -23,8 +23,19 @@
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define PHYS_OFFSET _AC(0, UL)
 #endif
-#ifndef PAGE_OFFSET
-#define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
+#define CAC_BASE _AC(0x80000000, UL)
+#define IO_BASE _AC(0xa0000000, UL)
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define UNCAC_BASE _AC(0xa0000000, UL)
+#ifndef MAP_BASE
+#define MAP_BASE _AC(0xc0000000, UL)
+#endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#ifndef HIGHMEM_START
+#define HIGHMEM_START _AC(0x20000000, UL)
+#endif
+#ifndef PAGE_OFFSET
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PAGE_OFFSET (CAC_BASE + PHYS_OFFSET)
 #endif
 #endif
diff --git a/libc/kernel/arch-mips/asm/module.h b/libc/kernel/arch-mips/asm/module.h
index 45808e9..dd24290 100644
--- a/libc/kernel/arch-mips/asm/module.h
+++ b/libc/kernel/arch-mips/asm/module.h
@@ -49,8 +49,20 @@
  Elf64_Byte r_type;
  Elf64_Sxword r_addend;
 } Elf64_Mips_Rela;
+#define Elf_Shdr Elf32_Shdr
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define Elf_Sym Elf32_Sym
+#define Elf_Ehdr Elf32_Ehdr
+#define Elf_Addr Elf32_Addr
+#define Elf_Mips_Rel Elf32_Rel
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define Elf_Mips_Rela Elf32_Rela
+#define ELF_MIPS_R_SYM(rel) ELF32_R_SYM(rel.r_info)
+#define ELF_MIPS_R_TYPE(rel) ELF32_R_TYPE(rel.r_info)
 #error MODULE_PROC_FAMILY undefined for your processor configuration
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define MODULE_KERNEL_TYPE "32BIT "
 #define MODULE_KERNEL_SMTC ""
 #define MODULE_ARCH_VERMAGIC   MODULE_PROC_FAMILY MODULE_KERNEL_TYPE MODULE_KERNEL_SMTC
 #endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/arch-mips/asm/msgbuf.h b/libc/kernel/arch-mips/asm/msgbuf.h
index 31a1887..d81da73 100644
--- a/libc/kernel/arch-mips/asm/msgbuf.h
+++ b/libc/kernel/arch-mips/asm/msgbuf.h
@@ -21,18 +21,21 @@
 struct msqid64_ds {
  struct ipc64_perm msg_perm;
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ unsigned long __unused1;
  __kernel_time_t msg_stime;
+ unsigned long __unused2;
  __kernel_time_t msg_rtime;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ unsigned long __unused3;
  __kernel_time_t msg_ctime;
  unsigned long msg_cbytes;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
  unsigned long msg_qnum;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
  unsigned long msg_qbytes;
  __kernel_pid_t msg_lspid;
  __kernel_pid_t msg_lrpid;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
  unsigned long __unused4;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
  unsigned long __unused5;
 };
 #endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/arch-mips/asm/pgalloc.h b/libc/kernel/arch-mips/asm/pgalloc.h
index e3ef3b8..0f16346 100644
--- a/libc/kernel/arch-mips/asm/pgalloc.h
+++ b/libc/kernel/arch-mips/asm/pgalloc.h
@@ -24,6 +24,8 @@
 #include <linux/sched.h>
 #define pmd_pgtable(pmd) pmd_page(pmd)
 #define __pte_free_tlb(tlb,pte)  do {   pgtable_page_dtor(pte);   tlb_remove_page((tlb), pte);  } while (0)
-#define check_pgt_cache() do { } while (0)
+#define pmd_free(mm, x) do { } while (0)
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __pmd_free_tlb(tlb, x) do { } while (0)
+#define check_pgt_cache() do { } while (0)
 #endif
diff --git a/libc/kernel/arch-mips/asm/pgtable.h b/libc/kernel/arch-mips/asm/pgtable.h
index ceb4343..46a5ba1 100644
--- a/libc/kernel/arch-mips/asm/pgtable.h
+++ b/libc/kernel/arch-mips/asm/pgtable.h
@@ -18,61 +18,62 @@
  ****************************************************************************/
 #ifndef _ASM_PGTABLE_H
 #define _ASM_PGTABLE_H
+#include <asm/pgtable-32.h>
 #include <asm/io.h>
-#include <asm/pgtable-bits.h>
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#include <asm/pgtable-bits.h>
 struct mm_struct;
 struct vm_area_struct;
 #define PAGE_NONE __pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_NONCOHERENT)
-#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE |   _page_cachable_default)
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE |   _page_cachable_default)
 #define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_READ |   _page_cachable_default)
 #define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_READ |   _page_cachable_default)
 #define PAGE_KERNEL __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE |   _PAGE_GLOBAL | _page_cachable_default)
-#define PAGE_USERIO __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE |   _page_cachable_default)
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PAGE_USERIO __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE |   _page_cachable_default)
 #define PAGE_KERNEL_UNCACHED __pgprot(_PAGE_PRESENT | __READABLE |   __WRITEABLE | _PAGE_GLOBAL | _CACHE_UNCACHED)
 #define __P000 __pgprot(0)
 #define __P001 __pgprot(0)
-#define __P010 __pgprot(0)
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __P010 __pgprot(0)
 #define __P011 __pgprot(0)
 #define __P100 __pgprot(0)
 #define __P101 __pgprot(0)
-#define __P110 __pgprot(0)
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __P110 __pgprot(0)
 #define __P111 __pgprot(0)
 #define __S000 __pgprot(0)
 #define __S001 __pgprot(0)
-#define __S010 __pgprot(0)
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __S010 __pgprot(0)
 #define __S011 __pgprot(0)
 #define __S100 __pgprot(0)
 #define __S101 __pgprot(0)
-#define __S110 __pgprot(0)
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __S110 __pgprot(0)
 #define __S111 __pgprot(0)
 #define ZERO_PAGE(vaddr)   (virt_to_page((void *)(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask))))
 #define pmd_phys(pmd) virt_to_phys((void *)pmd_val(pmd))
-#define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT))
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define pmd_page(pmd) (pfn_to_page(pmd_phys(pmd) >> PAGE_SHIFT))
 #define pmd_page_vaddr(pmd) pmd_val(pmd)
 #define pte_none(pte) (!(pte_val(pte) & ~_PAGE_GLOBAL))
 #define pte_present(pte) (pte_val(pte) & _PAGE_PRESENT)
-#define set_pte_at(mm, addr, ptep, pteval) set_pte(ptep, pteval)
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define set_pte_at(mm, addr, ptep, pteval) set_pte(ptep, pteval)
 #define set_pmd(pmdptr, pmdval) do { *(pmdptr) = (pmdval); } while(0)
 #define PGD_T_LOG2 (__builtin_ffs(sizeof(pgd_t)) - 1)
 #define PMD_T_LOG2 (__builtin_ffs(sizeof(pmd_t)) - 1)
-#define PTE_T_LOG2 (__builtin_ffs(sizeof(pte_t)) - 1)
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PTE_T_LOG2 (__builtin_ffs(sizeof(pte_t)) - 1)
 #define pgprot_noncached pgprot_noncached
 #define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
 #define kern_addr_valid(addr) (1)
-#define io_remap_pfn_range(vma, vaddr, pfn, size, prot)   remap_pfn_range(vma, vaddr, pfn, size, prot)
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define io_remap_pfn_range(vma, vaddr, pfn, size, prot)   remap_pfn_range(vma, vaddr, pfn, size, prot)
 #include <asm-generic/pgtable.h>
 #define HAVE_ARCH_UNMAPPED_AREA
 #define pgtable_cache_init() do { } while (0)
-#endif
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#endif
diff --git a/libc/kernel/arch-mips/asm/processor.h b/libc/kernel/arch-mips/asm/processor.h
index 3563121..fe9ee76 100644
--- a/libc/kernel/arch-mips/asm/processor.h
+++ b/libc/kernel/arch-mips/asm/processor.h
@@ -29,61 +29,65 @@
 #include <asm/prefetch.h>
 #include <asm/system.h>
 #define current_text_addr() ({ __label__ _l; _l: &&_l;})
-#define NUM_FPU_REGS 32
+#define TASK_SIZE 0x7fff8000UL
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define STACK_TOP TASK_SIZE
+#define TASK_UNMAPPED_BASE ((TASK_SIZE / 3) & ~(PAGE_SIZE))
+#define NUM_FPU_REGS 32
 typedef __u64 fpureg_t;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 struct mips_fpu_struct {
  fpureg_t fpr[NUM_FPU_REGS];
  unsigned int fcr31;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 };
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define NUM_DSP_REGS 6
 typedef __u32 dspreg_t;
 struct mips_dsp_state {
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
  dspreg_t dspr[NUM_DSP_REGS];
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
  unsigned int dspcontrol;
 };
 #define INIT_CPUMASK {   {0,}  }
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 typedef struct {
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
  unsigned long seg;
 } mm_segment_t;
 #define ARCH_MIN_TASKALIGN 8
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 struct mips_abi;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 struct thread_struct {
  unsigned long reg16;
  unsigned long reg17, reg18, reg19, reg20, reg21, reg22, reg23;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
  unsigned long reg29, reg30, reg31;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
  unsigned long cp0_status;
  struct mips_fpu_struct fpu;
  struct mips_dsp_state dsp;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
  unsigned long cp0_badvaddr;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
  unsigned long cp0_baduaddr;
  unsigned long error_code;
  unsigned long trap_no;
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
  unsigned long irix_trampoline;
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
  unsigned long irix_oldctx;
  struct mips_abi *abi;
 };
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define FPAFF_INIT
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define INIT_THREAD {       .reg16 = 0,   .reg17 = 0,   .reg18 = 0,   .reg19 = 0,   .reg20 = 0,   .reg21 = 0,   .reg22 = 0,   .reg23 = 0,   .reg29 = 0,   .reg30 = 0,   .reg31 = 0,       .cp0_status = 0,       .fpu = {   .fpr = {0,},   .fcr31 = 0,   },       FPAFF_INIT       .dsp = {   .dspr = {0, },   .dspcontrol = 0,   },       .cp0_badvaddr = 0,   .cp0_baduaddr = 0,   .error_code = 0,   .trap_no = 0,   .irix_trampoline = 0,   .irix_oldctx = 0,  }
 struct task_struct;
 #define release_thread(thread) do { } while(0)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define prepare_to_copy(tsk) do { } while (0)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define __KSTK_TOS(tsk) ((unsigned long)task_stack_page(tsk) + THREAD_SIZE - 32)
 #define task_pt_regs(tsk) ((struct pt_regs *)__KSTK_TOS(tsk) - 1)
 #define KSTK_EIP(tsk) (task_pt_regs(tsk)->cp0_epc)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define KSTK_ESP(tsk) (task_pt_regs(tsk)->regs[29])
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define KSTK_STATUS(tsk) (task_pt_regs(tsk)->cp0_status)
 #define cpu_relax() barrier()
 #define return_address() ({__asm__ __volatile__("":::"$31");__builtin_return_address(0);})
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/arch-mips/asm/ptrace.h b/libc/kernel/arch-mips/asm/ptrace.h
index 2b71e70..43cfcf1 100644
--- a/libc/kernel/arch-mips/asm/ptrace.h
+++ b/libc/kernel/arch-mips/asm/ptrace.h
@@ -33,29 +33,31 @@
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define ACX 78
 struct pt_regs {
+ unsigned long pad0[6];
  unsigned long regs[32];
- unsigned long cp0_status;
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ unsigned long cp0_status;
  unsigned long hi;
  unsigned long lo;
  unsigned long cp0_badvaddr;
- unsigned long cp0_cause;
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ unsigned long cp0_cause;
  unsigned long cp0_epc;
 } __attribute__ ((aligned (8)));
 #define PTRACE_GETREGS 12
-#define PTRACE_SETREGS 13
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PTRACE_SETREGS 13
 #define PTRACE_GETFPREGS 14
 #define PTRACE_SETFPREGS 15
 #define PTRACE_OLDSETOPTIONS 21
-#define PTRACE_GET_THREAD_AREA 25
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PTRACE_GET_THREAD_AREA 25
 #define PTRACE_SET_THREAD_AREA 26
 #define PTRACE_PEEKTEXT_3264 0xc0
 #define PTRACE_PEEKDATA_3264 0xc1
-#define PTRACE_POKETEXT_3264 0xc2
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define PTRACE_POKETEXT_3264 0xc2
 #define PTRACE_POKEDATA_3264 0xc3
 #define PTRACE_GET_THREAD_AREA_3264 0xc4
 #endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/arch-mips/asm/reg.h b/libc/kernel/arch-mips/asm/reg.h
index 9174e27..1b8e8ee 100644
--- a/libc/kernel/arch-mips/asm/reg.h
+++ b/libc/kernel/arch-mips/asm/reg.h
@@ -18,57 +18,54 @@
  ****************************************************************************/
 #ifndef __ASM_MIPS_REG_H
 #define __ASM_MIPS_REG_H
-#ifdef WANT_COMPAT_REG_H
 #define EF_R0 6
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define EF_R1 7
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define EF_R2 8
 #define EF_R3 9
 #define EF_R4 10
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define EF_R5 11
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define EF_R6 12
 #define EF_R7 13
 #define EF_R8 14
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define EF_R9 15
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define EF_R10 16
 #define EF_R11 17
 #define EF_R12 18
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define EF_R13 19
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define EF_R14 20
 #define EF_R15 21
 #define EF_R16 22
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define EF_R17 23
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define EF_R18 24
 #define EF_R19 25
 #define EF_R20 26
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define EF_R21 27
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define EF_R22 28
 #define EF_R23 29
 #define EF_R24 30
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define EF_R25 31
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define EF_R26 32
 #define EF_R27 33
 #define EF_R28 34
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define EF_R29 35
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define EF_R30 36
 #define EF_R31 37
 #define EF_LO 38
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define EF_HI 39
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define EF_CP0_EPC 40
 #define EF_CP0_BADVADDR 41
 #define EF_CP0_STATUS 42
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define EF_CP0_CAUSE 43
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define EF_UNUSED0 44
 #define EF_SIZE 180
 #endif
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
-#endif
diff --git a/libc/kernel/arch-mips/asm/resource.h b/libc/kernel/arch-mips/asm/resource.h
index e841072..1374d7d 100644
--- a/libc/kernel/arch-mips/asm/resource.h
+++ b/libc/kernel/arch-mips/asm/resource.h
@@ -24,6 +24,7 @@
 #define RLIMIT_RSS 7  
 #define RLIMIT_NPROC 8  
 #define RLIMIT_MEMLOCK 9  
-#include <asm-generic/resource.h>
+#define RLIM_INFINITY 0x7fffffffUL
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#include <asm-generic/resource.h>
 #endif
diff --git a/libc/kernel/arch-mips/asm/siginfo.h b/libc/kernel/arch-mips/asm/siginfo.h
index f3e508a..8fdbf77 100644
--- a/libc/kernel/arch-mips/asm/siginfo.h
+++ b/libc/kernel/arch-mips/asm/siginfo.h
@@ -24,73 +24,75 @@
 #define HAVE_ARCH_SIGINFO_T
 #define HAVE_ARCH_COPY_SIGINFO
 struct siginfo;
-#include <asm-generic/siginfo.h>
+#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#include <asm-generic/siginfo.h>
 typedef struct siginfo {
  int si_signo;
  int si_code;
- int si_errno;
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ int si_errno;
  int __pad0[SI_MAX_SIZE / sizeof(int) - SI_PAD_SIZE - 3];
  union {
  int _pad[SI_PAD_SIZE];
- struct {
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct {
  pid_t _pid;
  __ARCH_SI_UID_T _uid;
  } _kill;
- struct {
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct {
  timer_t _tid;
  int _overrun;
  char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
- sigval_t _sigval;
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ sigval_t _sigval;
  int _sys_private;
  } _timer;
  struct {
- pid_t _pid;
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ pid_t _pid;
  __ARCH_SI_UID_T _uid;
  sigval_t _sigval;
  } _rt;
- struct {
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ struct {
  pid_t _pid;
  __ARCH_SI_UID_T _uid;
  int _status;
- clock_t _utime;
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ clock_t _utime;
  clock_t _stime;
  } _sigchld;
  struct {
- pid_t _pid;
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ pid_t _pid;
  clock_t _utime;
  int _status;
  clock_t _stime;
- } _irix_sigchld;
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ } _irix_sigchld;
  struct {
  void __user *_addr;
 #ifdef __ARCH_SI_TRAPNO
- int _trapno;
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ int _trapno;
 #endif
  } _sigfault;
  struct {
- __ARCH_SI_BAND_T _band;
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+ __ARCH_SI_BAND_T _band;
  int _fd;
  } _sigpoll;
  } _sifields;
-} siginfo_t;
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+} siginfo_t;
 #undef SI_ASYNCIO
 #undef SI_TIMER
 #undef SI_MESGQ
-#define SI_ASYNCIO -2  
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define SI_ASYNCIO -2  
 #define SI_TIMER __SI_CODE(__SI_TIMER, -3)  
 #define SI_MESGQ __SI_CODE(__SI_MESGQ, -4)  
 #endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/arch-mips/asm/string.h b/libc/kernel/arch-mips/asm/string.h
index 856f61b..6f375a3 100644
--- a/libc/kernel/arch-mips/asm/string.h
+++ b/libc/kernel/arch-mips/asm/string.h
@@ -18,8 +18,16 @@
  ****************************************************************************/
 #ifndef _ASM_STRING_H
 #define _ASM_STRING_H
+#ifndef IN_STRING_C
+#define __HAVE_ARCH_STRCPY
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __HAVE_ARCH_STRNCPY
+#define __HAVE_ARCH_STRCMP
+#endif
+#define __HAVE_ARCH_STRNCMP
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define __HAVE_ARCH_MEMSET
 #define __HAVE_ARCH_MEMCPY
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define __HAVE_ARCH_MEMMOVE
 #endif
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
diff --git a/libc/kernel/arch-mips/asm/uaccess.h b/libc/kernel/arch-mips/asm/uaccess.h
index 3703af3..96025d3 100644
--- a/libc/kernel/arch-mips/asm/uaccess.h
+++ b/libc/kernel/arch-mips/asm/uaccess.h
@@ -23,35 +23,45 @@
 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #include <linux/thread_info.h>
 #include <asm-generic/uaccess.h>
+#define __UA_LIMIT 0x80000000UL
+#define __UA_ADDR ".word"
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __UA_LA "la"
+#define __UA_ADDU "addu"
+#define __UA_t0 "$8"
+#define __UA_t1 "$9"
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define KERNEL_DS ((mm_segment_t) { 0UL })
 #define USER_DS ((mm_segment_t) { __UA_LIMIT })
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define VERIFY_READ 0
 #define VERIFY_WRITE 1
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define get_ds() (KERNEL_DS)
 #define get_fs() (current_thread_info()->addr_limit)
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define set_fs(x) (current_thread_info()->addr_limit = (x))
 #define segment_eq(a, b) ((a).seg == (b).seg)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define __ua_size(size)   ((__builtin_constant_p(size) && (signed long) (size) > 0) ? 0 : (size))
 #define __access_mask get_fs().seg
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define __access_ok(addr, size, mask)   (((signed long)((mask) & ((addr) | ((addr) + (size)) | __ua_size(size)))) == 0)
 #define access_ok(type, addr, size)   likely(__access_ok((unsigned long)(addr), (size), __access_mask))
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define put_user(x,ptr)   __put_user_check((x), (ptr), sizeof(*(ptr)))
 #define get_user(x,ptr)   __get_user_check((x), (ptr), sizeof(*(ptr)))
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define __put_user(x,ptr)   __put_user_nocheck((x), (ptr), sizeof(*(ptr)))
 #define __get_user(x,ptr)   __get_user_nocheck((x), (ptr), sizeof(*(ptr)))
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 struct __large_struct { unsigned long buf[100]; };
 #define __m(x) (*(struct __large_struct __user *)(x))
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __GET_USER_DW(val, ptr) __get_user_asm_ll32(val, ptr)
 #define __get_user_common(val, size, ptr)  do {   switch (size) {   case 1: __get_user_asm(val, "lb", ptr); break;   case 2: __get_user_asm(val, "lh", ptr); break;   case 4: __get_user_asm(val, "lw", ptr); break;   case 8: __GET_USER_DW(val, ptr); break;   default: __get_user_unknown(); break;   }  } while (0)
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define __get_user_nocheck(x, ptr, size)  ({   long __gu_err;     __get_user_common((x), size, ptr);   __gu_err;  })
 #define __get_user_check(x, ptr, size)  ({   long __gu_err = -EFAULT;   const __typeof__(*(ptr)) __user * __gu_ptr = (ptr);     if (likely(access_ok(VERIFY_READ, __gu_ptr, size)))   __get_user_common((x), size, __gu_ptr);     __gu_err;  })
 #define __get_user_asm(val, insn, addr)  {   long __gu_tmp;     __asm__ __volatile__(   "1:	" insn "	%1, %3				\n"   "2:							\n"   "	.section .fixup,\"ax\"				\n"   "3:	li	%0, %4					\n"   "	j	2b					\n"   "	.previous					\n"   "	.section __ex_table,\"a\"			\n"   "	"__UA_ADDR "\t1b, 3b				\n"   "	.previous					\n"   : "=r" (__gu_err), "=r" (__gu_tmp)   : "0" (0), "o" (__m(addr)), "i" (-EFAULT));     (val) = (__typeof__(*(addr))) __gu_tmp;  }
-/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
 #define __get_user_asm_ll32(val, addr)  {   union {   unsigned long long l;   __typeof__(*(addr)) t;   } __gu_tmp;     __asm__ __volatile__(   "1:	lw	%1, (%3)				\n"   "2:	lw	%D1, 4(%3)				\n"   "3:	.section	.fixup,\"ax\"			\n"   "4:	li	%0, %4					\n"   "	move	%1, $0					\n"   "	move	%D1, $0					\n"   "	j	3b					\n"   "	.previous					\n"   "	.section	__ex_table,\"a\"		\n"   "	" __UA_ADDR "	1b, 4b				\n"   "	" __UA_ADDR "	2b, 4b				\n"   "	.previous					\n"   : "=r" (__gu_err), "=&r" (__gu_tmp.l)   : "0" (0), "r" (addr), "i" (-EFAULT));     (val) = __gu_tmp.t;  }
+/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#define __PUT_USER_DW(ptr) __put_user_asm_ll32(ptr)
 #define __put_user_nocheck(x, ptr, size)  ({   __typeof__(*(ptr)) __pu_val;   long __pu_err = 0;     __pu_val = (x);   switch (size) {   case 1: __put_user_asm("sb", ptr); break;   case 2: __put_user_asm("sh", ptr); break;   case 4: __put_user_asm("sw", ptr); break;   case 8: __PUT_USER_DW(ptr); break;   default: __put_user_unknown(); break;   }   __pu_err;  })
 #define __put_user_check(x, ptr, size)  ({   __typeof__(*(ptr)) __user *__pu_addr = (ptr);   __typeof__(*(ptr)) __pu_val = (x);   long __pu_err = -EFAULT;     if (likely(access_ok(VERIFY_WRITE, __pu_addr, size))) {   switch (size) {   case 1: __put_user_asm("sb", __pu_addr); break;   case 2: __put_user_asm("sh", __pu_addr); break;   case 4: __put_user_asm("sw", __pu_addr); break;   case 8: __PUT_USER_DW(__pu_addr); break;   default: __put_user_unknown(); break;   }   }   __pu_err;  })
 #define __put_user_asm(insn, ptr)  {   __asm__ __volatile__(   "1:	" insn "	%z2, %3		# __put_user_asm\n"   "2:							\n"   "	.section	.fixup,\"ax\"			\n"   "3:	li	%0, %4					\n"   "	j	2b					\n"   "	.previous					\n"   "	.section	__ex_table,\"a\"		\n"   "	" __UA_ADDR "	1b, 3b				\n"   "	.previous					\n"   : "=r" (__pu_err)   : "0" (0), "Jr" (__pu_val), "o" (__m(ptr)),   "i" (-EFAULT));  }
diff --git a/libc/kernel/tools/defaults.py b/libc/kernel/tools/defaults.py
index 86a14fd..7eeffb4 100644
--- a/libc/kernel/tools/defaults.py
+++ b/libc/kernel/tools/defaults.py
@@ -45,6 +45,7 @@
 kernel_default_arch_macros = {
     "arm": {},
     "x86": {"__i386__": "1", "CONFIG_X86_32": "1"},
+    "mips": {"CONFIG_32BIT":"1"},
     }
 
 # Replace tokens in the output according to this mapping