The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/port/thwack.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 typedef struct Thwack           Thwack;
    2 typedef struct Unthwack         Unthwack;
    3 typedef struct ThwBlock         ThwBlock;
    4 typedef struct UnthwBlock       UnthwBlock;
    5 
    6 enum
    7 {
    8         ThwStats        = 8,
    9         ThwMaxBlock     = 1600,         /* max size of compressible block */
   10 
   11         HashLog         = 12,
   12         HashSize        = 1<<HashLog,
   13         HashMask        = HashSize - 1,
   14 
   15         MinMatch        = 3,            /* shortest match possible */
   16 
   17         MaxOff          = 8,
   18         OffBase         = 6,
   19 
   20         MinDecode       = 8,            /* minimum bits to decode a match or lit; >= 8 */
   21 
   22         EWinBlocks      = 22,           /* blocks held in encoder window */
   23         DWinBlocks      = 32,           /* blocks held in decoder window */
   24         CompBlocks      = 10,           /* max blocks used to encode data */
   25 
   26         MaxSeqMask      = 8,            /* number of bits in coding block mask */
   27         MaxSeqStart     = 256           /* max offset of initial coding block */
   28 };
   29 
   30 struct ThwBlock
   31 {
   32         ulong   seq;                    /* sequence number for this data */
   33         uchar   acked;                  /* ok to use this block; the decoder has it */
   34         ushort  begin;                  /* time of first byte in hash */
   35         uchar   *edata;                 /* last byte of valid data */
   36         ushort  maxoff;                 /* time of last valid hash entry */
   37         ushort  *hash;
   38         uchar   *data;
   39 };
   40 
   41 struct Thwack
   42 {
   43         int             slot;           /* next block to use */
   44         ThwBlock        blocks[EWinBlocks];
   45         ushort          hash[EWinBlocks][HashSize];
   46         uchar           data[EWinBlocks][ThwMaxBlock];
   47 };
   48 
   49 struct UnthwBlock
   50 {
   51         ulong   seq;                    /* sequence number for this data */
   52         ushort  maxoff;                 /* valid data in each block */
   53         uchar   *data;
   54 };
   55 
   56 struct Unthwack
   57 {
   58         int             slot;           /* next block to use */
   59         UnthwBlock      blocks[DWinBlocks];
   60         uchar           data[DWinBlocks][ThwMaxBlock];
   61 };
   62 
   63 void    thwackinit(Thwack*);
   64 void    unthwackinit(Unthwack*);
   65 int     thwack(Thwack*, uchar *dst, uchar *src, int nsrc, ulong seq, ulong stats[ThwStats]);
   66 void    thwackack(Thwack*, ulong seq, ulong mask);
   67 int     unthwack(Unthwack*, uchar *dst, int ndst, uchar *src, int nsrc, ulong seq);
   68 ulong   unthwackstate(Unthwack *ut, uchar *mask);

Cache object: 87dfbdd55fec8c0505f2dad99902ed79


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.