brcm.patch 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  1. diff -Nur linux-2.6.39.4.orig/arch/mips/Kconfig linux-2.6.39.4/arch/mips/Kconfig
  2. --- linux-2.6.39.4.orig/arch/mips/Kconfig 2011-08-03 21:43:28.000000000 +0200
  3. +++ linux-2.6.39.4/arch/mips/Kconfig 2012-06-02 20:35:49.000000000 +0200
  4. @@ -103,6 +103,12 @@
  5. select GENERIC_GPIO
  6. select SYS_HAS_EARLY_PRINTK
  7. select CFE
  8. + select SYS_SUPPORTS_ZBOOT_UART16550
  9. + select HAVE_KERNEL_GZIP
  10. + select HAVE_KERNEL_BZIP2
  11. + select HAVE_KERNEL_LZMA
  12. + select HAVE_KERNEL_XZ
  13. + select HAVE_KERNEL_LZO
  14. help
  15. Support for BCM47XX based boards
  16. diff -Nur linux-2.6.39.4.orig/arch/mips/Makefile linux-2.6.39.4/arch/mips/Makefile
  17. --- linux-2.6.39.4.orig/arch/mips/Makefile 2011-08-03 21:43:28.000000000 +0200
  18. +++ linux-2.6.39.4/arch/mips/Makefile 2012-06-02 20:35:49.000000000 +0200
  19. @@ -76,6 +76,7 @@
  20. all-$(CONFIG_BOOT_ELF32) := $(vmlinux-32)
  21. all-$(CONFIG_BOOT_ELF64) := $(vmlinux-64)
  22. all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlinuz
  23. +all-$(CONFIG_BCM47XX) += vmlinuz.elf
  24. #
  25. # GCC uses -G 0 -mabicalls -fpic as default. We don't want PIC in the kernel
  26. @@ -276,7 +277,7 @@
  27. $(Q)$(MAKE) $(build)=arch/mips/boot VMLINUX=$(vmlinux-32) arch/mips/boot/$@
  28. # boot/compressed
  29. -vmlinuz vmlinuz.bin vmlinuz.ecoff vmlinuz.srec: $(vmlinux-32) FORCE
  30. +vmlinuz vmlinuz.bin vmlinuz.ecoff vmlinuz.srec vmlinuz.elf: $(vmlinux-32) FORCE
  31. $(Q)$(MAKE) $(build)=arch/mips/boot/compressed \
  32. VMLINUX_LOAD_ADDRESS=$(load-y) 32bit-bfd=$(32bit-bfd) $@
  33. @@ -313,6 +314,7 @@
  34. echo ' vmlinuz.ecoff - ECOFF zboot image'
  35. echo ' vmlinuz.bin - Raw binary zboot image'
  36. echo ' vmlinuz.srec - SREC zboot image'
  37. + echo ' vmlinuz.elf - ELF self-relocating zboot image'
  38. echo
  39. echo ' These will be default as appropriate for a configured platform.'
  40. endef
  41. diff -Nur linux-2.6.39.4.orig/arch/mips/bcm47xx/Makefile linux-2.6.39.4/arch/mips/bcm47xx/Makefile
  42. --- linux-2.6.39.4.orig/arch/mips/bcm47xx/Makefile 2011-08-03 21:43:28.000000000 +0200
  43. +++ linux-2.6.39.4/arch/mips/bcm47xx/Makefile 2012-06-02 20:35:49.000000000 +0200
  44. @@ -3,4 +3,4 @@
  45. # under Linux.
  46. #
  47. -obj-y := gpio.o irq.o nvram.o prom.o serial.o setup.o time.o wgt634u.o
  48. +obj-y := gpio.o irq.o nvram.o prom.o serial.o setup.o time.o platform.o
  49. diff -Nur linux-2.6.39.4.orig/arch/mips/bcm47xx/platform.c linux-2.6.39.4/arch/mips/bcm47xx/platform.c
  50. --- linux-2.6.39.4.orig/arch/mips/bcm47xx/platform.c 1970-01-01 01:00:00.000000000 +0100
  51. +++ linux-2.6.39.4/arch/mips/bcm47xx/platform.c 2012-06-02 20:35:49.000000000 +0200
  52. @@ -0,0 +1,146 @@
  53. +/*
  54. + * This file is subject to the terms and conditions of the GNU General Public
  55. + * License. See the file "COPYING" in the main directory of this archive
  56. + * for more details.
  57. + *
  58. + * Copyright (C) 2010, 2011 Waldemar Brodkorb <wbx@openadk.org>
  59. + * Copyright © 2007, 2011 Thorsten Glaser <tg@freewrt.org>
  60. + */
  61. +
  62. +#include <linux/platform_device.h>
  63. +#include <linux/module.h>
  64. +#include <linux/mtd/physmap.h>
  65. +#include <linux/ssb/ssb.h>
  66. +
  67. +#include <asm/mach-bcm47xx/bcm47xx.h>
  68. +#include <asm/mach-bcm47xx/nvram.h>
  69. +
  70. +#define CFGFS_FLASH_SIZE (128 * 1024)
  71. +
  72. +static struct mtd_partition bcm47xx_partitions[] = {
  73. +#define SLOT_CFE 0
  74. + {
  75. + .name = "cfe",
  76. + .offset = 0,
  77. + .size = BCM47XX_OVERRIDE_CFESIZE,
  78. + .mask_flags = MTD_WRITEABLE /* force read-only */
  79. + },
  80. +#define SLOT_LINUX 1
  81. + {
  82. + .name = "linux",
  83. + .offset = 0,
  84. + .size = 0,
  85. + },
  86. +#define SLOT_ROOTFS 2
  87. + {
  88. + .name = "rootfs",
  89. + .offset = 0,
  90. + .size = 0,
  91. + },
  92. +#define SLOT_CFGFS 3
  93. + {
  94. + .name = "cfgfs",
  95. + .offset = 0,
  96. + .size = 0,
  97. + },
  98. +#define SLOT_NVRAM 4
  99. + {
  100. + .name = "nvram",
  101. + .offset = 0,
  102. + .size = 0,
  103. + },
  104. +};
  105. +
  106. +static struct physmap_flash_data bcm47xx_flash_data = {
  107. + .parts = bcm47xx_partitions,
  108. + .nr_parts = ARRAY_SIZE(bcm47xx_partitions)
  109. +};
  110. +
  111. +static struct resource bcm47xx_flash_resource = {
  112. + .flags = IORESOURCE_MEM,
  113. +};
  114. +
  115. +static struct platform_device bcm47xx_flash = {
  116. + .name = "physmap-flash",
  117. + .id = 0,
  118. + .dev = { .platform_data = &bcm47xx_flash_data, },
  119. + .resource = &bcm47xx_flash_resource,
  120. + .num_resources = 1,
  121. +};
  122. +
  123. +static struct platform_device *bcm47xx_devices[] __initdata = {
  124. + &bcm47xx_flash,
  125. +};
  126. +
  127. +struct bcm47xx_trx_header {
  128. +#define BCM47XX_TRX_MAGIC 0x30524448
  129. + u32 magic;
  130. + u32 len;
  131. + u32 crc32;
  132. + u32 flag_version;
  133. + u32 offsets[3];
  134. +};
  135. +
  136. +#define UPTODOWN(slot, psize) do { \
  137. + posn -= psize; left -= psize; \
  138. + bcm47xx_partitions[slot].offset = posn; \
  139. + bcm47xx_partitions[slot].size = psize; \
  140. +} while (/* CONSTCOND */ 0)
  141. +
  142. +static int __init bcm47xx_register_devices(void)
  143. +{
  144. + u32 flash_size;
  145. + size_t left, posn;
  146. + struct ssb_mipscore *mcore = &ssb_bcm47xx.mipscore;
  147. + struct bcm47xx_trx_header *trx_hdr;
  148. +
  149. + trx_hdr = (void *)KSEG1ADDR(mcore->flash_window + BCM47XX_OVERRIDE_CFESIZE);
  150. +
  151. + /* devices might have 2, 4 or 8 MB flash size */
  152. +#ifdef BCM47XX_OVERRIDE_FLASHSIZE
  153. + flash_size = BCM47XX_OVERRIDE_FLASHSIZE;
  154. + mcore->flash_window_size = flash_size;
  155. +#define BCM47XX_OVERRODE_FLASHSIZE " (overridden)"
  156. +#else
  157. + flash_size = mcore->flash_window_size;
  158. +#define BCM47XX_OVERRODE_FLASHSIZE ""
  159. +#endif
  160. + printk(KERN_INFO "FLASH SIZE%s: %x\n", BCM47XX_OVERRODE_FLASHSIZE,
  161. + flash_size);
  162. +
  163. + left = flash_size - BCM47XX_OVERRIDE_CFESIZE;
  164. + posn = flash_size;
  165. + UPTODOWN(SLOT_NVRAM, BCM47XX_OVERRIDE_NVRAMSIZE);
  166. + UPTODOWN(SLOT_CFGFS, CFGFS_FLASH_SIZE);
  167. + bcm47xx_partitions[SLOT_LINUX].offset = BCM47XX_OVERRIDE_CFESIZE;
  168. + bcm47xx_partitions[SLOT_LINUX].size = left;
  169. +
  170. + if (trx_hdr->magic == BCM47XX_TRX_MAGIC) {
  171. + bcm47xx_partitions[SLOT_ROOTFS].offset =
  172. + bcm47xx_partitions[SLOT_LINUX].offset +
  173. + trx_hdr->offsets[1];
  174. + bcm47xx_partitions[SLOT_ROOTFS].size =
  175. + bcm47xx_partitions[SLOT_LINUX].size -
  176. + trx_hdr->offsets[1];
  177. + } else
  178. + printk("bcm47xx/platform: no TRX header found\n");
  179. +
  180. + printk(KERN_INFO "=== Flash map dump ===\n");
  181. + for (posn = 0; posn < bcm47xx_flash_data.nr_parts; ++posn)
  182. + printk(KERN_INFO " #%u %08X @%08X '%s'\n",
  183. + (unsigned int)posn,
  184. + (unsigned int)bcm47xx_partitions[posn].size,
  185. + (unsigned int)bcm47xx_partitions[posn].offset,
  186. + bcm47xx_partitions[posn].name);
  187. + printk(KERN_INFO "=== Hope this works, have a nice day\n");
  188. +
  189. + bcm47xx_flash_data.width = mcore->flash_buswidth;
  190. + bcm47xx_flash_resource.start = mcore->flash_window;
  191. + bcm47xx_flash_resource.end = mcore->flash_window
  192. + + mcore->flash_window_size
  193. + - 1;
  194. + return platform_add_devices(bcm47xx_devices,
  195. + ARRAY_SIZE(bcm47xx_devices));
  196. +}
  197. +
  198. +device_initcall(bcm47xx_register_devices);
  199. diff -Nur linux-2.6.39.4.orig/arch/mips/boot/compressed/Makefile linux-2.6.39.4/arch/mips/boot/compressed/Makefile
  200. --- linux-2.6.39.4.orig/arch/mips/boot/compressed/Makefile 2011-08-03 21:43:28.000000000 +0200
  201. +++ linux-2.6.39.4/arch/mips/boot/compressed/Makefile 2012-06-02 20:37:43.000000000 +0200
  202. @@ -44,6 +44,7 @@
  203. tool_$(CONFIG_KERNEL_BZIP2) = bzip2
  204. tool_$(CONFIG_KERNEL_LZMA) = lzma
  205. tool_$(CONFIG_KERNEL_LZO) = lzo
  206. +tool_$(CONFIG_KERNEL_XZ) = xzkern
  207. targets += vmlinux.bin.z
  208. $(obj)/vmlinux.bin.z: $(obj)/vmlinux.bin FORCE
  209. @@ -58,8 +59,13 @@
  210. # Calculate the load address of the compressed kernel image
  211. hostprogs-y := calc_vmlinuz_load_addr
  212. +ifdef CONFIG_BCM47XX
  213. +# XXX just after CFE, just pray the address is static
  214. +VMLINUZ_LOAD_ADDRESS = 0xffffffff80900000
  215. +else
  216. VMLINUZ_LOAD_ADDRESS = $(shell $(obj)/calc_vmlinuz_load_addr \
  217. $(obj)/vmlinux.bin $(VMLINUX_LOAD_ADDRESS))
  218. +endif
  219. vmlinuzobjs-y += $(obj)/piggy.o
  220. @@ -105,4 +111,12 @@
  221. vmlinuz.srec: vmlinuz
  222. $(call cmd,objcopy)
  223. -clean-files := $(objtree)/vmlinuz $(objtree)/vmlinuz.{32,ecoff,bin,srec}
  224. +AFLAGS_selfreloc.o := -DVMLINUZ_LOAD_ADDRESS=$(VMLINUZ_LOAD_ADDRESS)
  225. +CPPFLAGS_selfreloc.lds := $(KBUILD_CFLAGS)
  226. +
  227. +arch/mips/boot/compressed/selfreloc.o: arch/mips/boot/compressed/selfreloc.S vmlinuz.bin FORCE
  228. +
  229. +vmlinuz.elf: arch/mips/boot/compressed/selfreloc.o arch/mips/boot/compressed/selfreloc.lds FORCE
  230. + $(LD) $(LDFLAGS) -T arch/mips/boot/compressed/selfreloc.lds arch/mips/boot/compressed/selfreloc.o -o $@
  231. +
  232. +clean-files := $(objtree)/vmlinuz $(objtree)/vmlinuz.{32,ecoff,bin,srec,elf} $(objtree)/arch/mips/boot/compressed/selfreloc.{o,lds}
  233. diff -Nur linux-2.6.39.4.orig/arch/mips/boot/compressed/decompress.c linux-2.6.39.4/arch/mips/boot/compressed/decompress.c
  234. --- linux-2.6.39.4.orig/arch/mips/boot/compressed/decompress.c 2011-08-03 21:43:28.000000000 +0200
  235. +++ linux-2.6.39.4/arch/mips/boot/compressed/decompress.c 2012-06-02 20:39:09.000000000 +0200
  236. @@ -43,7 +43,7 @@
  237. /* activate the code for pre-boot environment */
  238. #define STATIC static
  239. -#ifdef CONFIG_KERNEL_GZIP
  240. +#if defined(CONFIG_KERNEL_GZIP) || defined(CONFIG_KERNEL_XZ)
  241. void *memcpy(void *dest, const void *src, size_t n)
  242. {
  243. int i;
  244. @@ -54,6 +54,8 @@
  245. d[i] = s[i];
  246. return dest;
  247. }
  248. +#endif
  249. +#ifdef CONFIG_KERNEL_GZIP
  250. #include "../../../../lib/decompress_inflate.c"
  251. #endif
  252. @@ -78,6 +80,10 @@
  253. #include "../../../../lib/decompress_unlzo.c"
  254. #endif
  255. +#ifdef CONFIG_KERNEL_XZ
  256. +#include "../../../../lib/decompress_unxz.c"
  257. +#endif
  258. +
  259. void decompress_kernel(unsigned long boot_heap_start)
  260. {
  261. unsigned long zimage_start, zimage_size;
  262. diff -Nur linux-2.6.39.4.orig/arch/mips/boot/compressed/selfreloc.S linux-2.6.39.4/arch/mips/boot/compressed/selfreloc.S
  263. --- linux-2.6.39.4.orig/arch/mips/boot/compressed/selfreloc.S 1970-01-01 01:00:00.000000000 +0100
  264. +++ linux-2.6.39.4/arch/mips/boot/compressed/selfreloc.S 2012-06-02 20:35:49.000000000 +0200
  265. @@ -0,0 +1,54 @@
  266. +/*-
  267. + * written 2011 by Thorsten Glaser <tg@freewrt.org> based on
  268. + * arch/mips/boot/compressed/head.S
  269. + */
  270. +
  271. +#include <asm/asm.h>
  272. +#include <asm/regdef.h>
  273. +
  274. + .set noreorder
  275. + .cprestore
  276. +
  277. + .text
  278. + LEAF(selfreloc_start)
  279. +selfreloc_start:
  280. + /* Save boot rom start args */
  281. + move s0, a0
  282. + move s1, a1
  283. + move s2, a2
  284. + move s3, a3
  285. +
  286. + /* Copy code to the correct place */
  287. + PTR_LI a0, VMLINUZ_LOAD_ADDRESS
  288. + PTR_LA a1, imgbeg
  289. + PTR_LA a2, imgend
  290. +1: lw t0, 0(a1)
  291. + sw t0, 0(a0)
  292. + add a1, 4
  293. + add a0, 4
  294. + blt a1, a2, 1b
  295. + nop
  296. +
  297. + /* Restore boot rom start args */
  298. + move a0, s0
  299. + move a1, s1
  300. + move a2, s2
  301. + move a3, s3
  302. +
  303. + /* Jump to the code at its new location */
  304. + PTR_LI k0, VMLINUZ_LOAD_ADDRESS
  305. + jr k0
  306. + nop
  307. +
  308. + /* Just in case we come back… */
  309. +3:
  310. + b 3b
  311. + nop
  312. + END(selfreloc_start)
  313. +
  314. + .globl imgbeg
  315. + .p2align 2
  316. +imgbeg: .incbin "vmlinuz.bin"
  317. + .globl imgend
  318. + .p2align 2
  319. +imgend:
  320. diff -Nur linux-2.6.39.4.orig/arch/mips/boot/compressed/selfreloc.lds.S linux-2.6.39.4/arch/mips/boot/compressed/selfreloc.lds.S
  321. --- linux-2.6.39.4.orig/arch/mips/boot/compressed/selfreloc.lds.S 1970-01-01 01:00:00.000000000 +0100
  322. +++ linux-2.6.39.4/arch/mips/boot/compressed/selfreloc.lds.S 2012-06-02 20:35:49.000000000 +0200
  323. @@ -0,0 +1,39 @@
  324. +/*-
  325. + * written 2010 by Thorsten Glaser <tg@debian.org> based on
  326. + * arch/mips/kernel/vmlinux.lds and arch/mips/boot/compressed/ld.script
  327. + */
  328. +
  329. +#include <asm/asm-offsets.h>
  330. +#include <asm/page.h>
  331. +#include <asm-generic/vmlinux.lds.h>
  332. +
  333. +#undef mips
  334. +#define mips mips
  335. +OUTPUT_ARCH(mips)
  336. +ENTRY(selfreloc_start)
  337. +PHDRS {
  338. + text PT_LOAD FLAGS(7); /* RWX */
  339. +}
  340. +SECTIONS
  341. +{
  342. + . = VMLINUX_LOAD_ADDRESS;
  343. + .text : {
  344. + *(.text)
  345. + *(.text.*)
  346. + *(.rodata)
  347. + *(.rodata.*)
  348. + *(.data)
  349. + *(.data.*)
  350. + *(.bss)
  351. + *(.bss.*)
  352. + } :text
  353. + /DISCARD/ : {
  354. + *(.MIPS.options)
  355. + *(.options)
  356. + *(.pdr)
  357. + *(.reginfo)
  358. + *(.comment)
  359. + *(.note)
  360. + *(.gnu.attributes)
  361. + }
  362. +}
  363. diff -Nur linux-2.6.39.4.orig/arch/mips/boot/compressed/uart-16550.c linux-2.6.39.4/arch/mips/boot/compressed/uart-16550.c
  364. --- linux-2.6.39.4.orig/arch/mips/boot/compressed/uart-16550.c 2011-08-03 21:43:28.000000000 +0200
  365. +++ linux-2.6.39.4/arch/mips/boot/compressed/uart-16550.c 2012-06-02 20:35:49.000000000 +0200
  366. @@ -18,6 +18,11 @@
  367. #define PORT(offset) (CKSEG1ADDR(AR7_REGS_UART0) + (4 * offset))
  368. #endif
  369. +#ifdef CONFIG_BCM47XX
  370. +#define UART_BASE 0x18000300
  371. +#define PORT(offset) (CKSEG1ADDR(UART_BASE) + (offset))
  372. +#endif
  373. +
  374. #ifndef PORT
  375. #error please define the serial port address for your own machine
  376. #endif
  377. diff -Nur linux-2.6.39.4.orig/drivers/ssb/driver_mipscore.c linux-2.6.39.4/drivers/ssb/driver_mipscore.c
  378. --- linux-2.6.39.4.orig/drivers/ssb/driver_mipscore.c 2011-08-03 21:43:28.000000000 +0200
  379. +++ linux-2.6.39.4/drivers/ssb/driver_mipscore.c 2012-06-02 20:35:49.000000000 +0200
  380. @@ -190,10 +190,11 @@
  381. {
  382. struct ssb_bus *bus = mcore->dev->bus;
  383. + printk("Check for vendor with value: %d", bus->chipco.dev->id.vendor);
  384. mcore->flash_buswidth = 2;
  385. if (bus->chipco.dev) {
  386. mcore->flash_window = 0x1c000000;
  387. - mcore->flash_window_size = 0x02000000;
  388. + mcore->flash_window_size = 0x00800000;
  389. if ((ssb_read32(bus->chipco.dev, SSB_CHIPCO_FLASH_CFG)
  390. & SSB_CHIPCO_CFG_DS16) == 0)
  391. mcore->flash_buswidth = 1;
  392. diff -Nur linux-2.6.39.4.orig/init/Kconfig linux-2.6.39.4/init/Kconfig
  393. --- linux-2.6.39.4.orig/init/Kconfig 2011-08-03 21:43:28.000000000 +0200
  394. +++ linux-2.6.39.4/init/Kconfig 2012-06-02 20:36:11.000000000 +0200
  395. @@ -156,6 +156,7 @@
  396. config KERNEL_GZIP
  397. bool "Gzip"
  398. depends on HAVE_KERNEL_GZIP
  399. + select DECOMPRESS_GZIP
  400. help
  401. The old and tried gzip compression. It provides a good balance
  402. between compression ratio and decompression speed.
  403. @@ -163,6 +164,7 @@
  404. config KERNEL_BZIP2
  405. bool "Bzip2"
  406. depends on HAVE_KERNEL_BZIP2
  407. + select DECOMPRESS_BZIP2
  408. help
  409. Its compression ratio and speed is intermediate.
  410. Decompression speed is slowest among the three. The kernel
  411. @@ -173,6 +175,7 @@
  412. config KERNEL_LZMA
  413. bool "LZMA"
  414. depends on HAVE_KERNEL_LZMA
  415. + select DECOMPRESS_LZMA
  416. help
  417. The most recent compression algorithm.
  418. Its ratio is best, decompression speed is between the other
  419. @@ -182,6 +185,7 @@
  420. config KERNEL_XZ
  421. bool "XZ"
  422. depends on HAVE_KERNEL_XZ
  423. + select DECOMPRESS_XZ
  424. help
  425. XZ uses the LZMA2 algorithm and instruction set specific
  426. BCJ filters which can improve compression ratio of executable
  427. @@ -197,6 +201,7 @@
  428. config KERNEL_LZO
  429. bool "LZO"
  430. depends on HAVE_KERNEL_LZO
  431. + select DECOMPRESS_LZO
  432. help
  433. Its compression ratio is the poorest among the 4. The kernel
  434. size is about 10% bigger than gzip; however its speed
  435. diff -Nur linux-2.6.39.4.orig/lib/xz/xz_stream.h linux-2.6.39.4/lib/xz/xz_stream.h
  436. --- linux-2.6.39.4.orig/lib/xz/xz_stream.h 2011-08-03 21:43:28.000000000 +0200
  437. +++ linux-2.6.39.4/lib/xz/xz_stream.h 2012-06-02 20:40:18.000000000 +0200
  438. @@ -40,7 +40,12 @@
  439. * compressed size of the file to less than 256 MiB and may also weaken
  440. * error detection slightly.
  441. */
  442. +
  443. +#ifdef __mips__
  444. +typedef uint32_t vli_type;
  445. +#else
  446. typedef uint64_t vli_type;
  447. +#endif
  448. #define VLI_MAX ((vli_type)-1 / 2)
  449. #define VLI_UNKNOWN ((vli_type)-1)