squeeze.h 976 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * squeezed file format:
  3. * Sqhdr
  4. * original Exec header
  5. * two Squeeze tables
  6. * squeezed segment
  7. * unsqueezed segment, if any
  8. */
  9. #define SQMAGIC (ulong)0xFEEF0F1E
  10. typedef struct Sqhdr Sqhdr;
  11. struct Sqhdr {
  12. uchar magic[4]; /* SQMAGIC */
  13. uchar text[4]; /* squeezed length of text (excluding tables) */
  14. uchar data[4]; /* squeezed length of data (excluding tables) */
  15. uchar asis[4]; /* length of unsqueezed segment */
  16. uchar toptxt[4]; /* value for 0 encoding in text */
  17. uchar topdat[4]; /* value for 0 encoding in data */
  18. uchar sum[4]; /* simple checksum of unsqueezed data */
  19. uchar flags[4];
  20. };
  21. #define SQHDRLEN (8*4)
  22. /*
  23. * certain power instruction types are rearranged by sqz
  24. * so as to move the variable part of the instruction word to the
  25. * low order bits. note that the mapping is its own inverse.
  26. */
  27. #define QREMAP(X)\
  28. switch((X)>>26){\
  29. case 19: case 31: case 59: case 63:\
  30. (X) = (((X) & 0xFC00F801) | (((X)>>15)&0x7FE) | (((X)&0x7FE)<<15));\
  31. }