]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/vm/WKdm_new.h
2 * Copyright (c) 2000-2013 Apple Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
29 /* direct-mapped partial matching compressor with simple 22/10 split
31 * Compresses buffers using a dictionary based match and partial match
32 * (high bits only or full match) scheme.
34 * Paul Wilson -- wilson@cs.utexas.edu
35 * Scott F. Kaplan -- sfkaplan@cs.utexas.edu
39 /* compressed output format, in memory order
40 * 1. a four-word HEADER containing four one-word values:
41 * i. a one-word code saying what algorithm compressed the data
42 * ii. an integer WORD offset into the page saying
43 * where the queue position area starts
44 * iii. an integer WORD offset into the page saying where
45 * the low-bits area starts
46 * iv. an integer WORD offset into the page saying where the
49 * 2. a 64-word TAGS AREA holding one two-bit tag for each word in
50 * the original (1024-word) page, packed 16 per word
52 * 3. a variable-sized FULL WORDS AREA (always word aligned and an
53 * integral number of words) holding full-word patterns that
54 * were not in the dictionary when encoded (i.e., dictionary misses)
56 * 4. a variable-sized QUEUE POSITIONS AREA (always word aligned and
57 * an integral number of words) holding four-bit queue positions,
58 * packed eight per word.
60 * 5. a variable-sized LOW BITS AREA (always word aligned and an
61 * integral number of words) holding ten-bit low-bit patterns
62 * (from partial matches), packed three per word.
69 #include <mach/vm_param.h>
72 #define WKdm_SCRATCH_BUF_SIZE_INTERNAL PAGE_SIZE
74 typedef unsigned int WK_word
;
76 #if defined(__arm64__)
79 WKdm_decompress_4k(const WK_word
* src_buf
,
84 WKdm_compress_4k(const WK_word
* src_buf
,
90 WKdm_decompress_16k(WK_word
* src_buf
,
95 WKdm_compress_16k(WK_word
* src_buf
,
102 WKdm_decompress_new(WK_word
* src_buf
,
107 WKdm_compress_new(const WK_word
* src_buf
,