suspend-1.0_p20200514.patch 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. diff -Nupr suspend~/s2ram-x86.h suspend/s2ram-x86.h
  2. --- suspend~/s2ram-x86.h 2012-09-15 22:23:44.000000000 +0200
  3. +++ suspend/s2ram-x86.h 2020-05-14 19:04:21.979507630 +0200
  4. @@ -18,9 +18,9 @@
  5. /* Item size */
  6. #define ITEMSZ 1024
  7. -char bios_version[ITEMSZ], sys_vendor[ITEMSZ], sys_product[ITEMSZ], sys_version[ITEMSZ];
  8. +extern char bios_version[ITEMSZ], sys_vendor[ITEMSZ], sys_product[ITEMSZ], sys_version[ITEMSZ];
  9. -int flags, force, fb_nosuspend, no_kms_flag;
  10. +extern int flags, force, fb_nosuspend, no_kms_flag;
  11. #define HACKS_LONG_OPTS \
  12. {\
  13. diff -Nupr suspend~/s2ram-x86.c suspend/s2ram-x86.c
  14. --- suspend~/s2ram-x86.c 2012-09-15 22:23:44.000000000 +0200
  15. +++ suspend/s2ram-x86.c 2020-05-14 19:33:34.683394349 +0200
  16. @@ -38,6 +38,10 @@ static int vbe_mode = -1, dmi_scanned;
  17. #define S2RAM_NOFB 126
  18. #define S2RAM_UNKNOWN 127
  19. +/* extern in s2ram-{{arch}}.h */
  20. +char bios_version[ITEMSZ], sys_vendor[ITEMSZ], sys_product[ITEMSZ], sys_version[ITEMSZ];
  21. +int flags, force, fb_nosuspend, no_kms_flag;
  22. +
  23. void identify_machine(void)
  24. {
  25. if (!dmi_scanned) {
  26. diff -Nupr suspend~/load.c suspend/load.c
  27. --- suspend~/load.c 2020-05-14 18:54:12.683547000 +0200
  28. +++ suspend/load.c 2020-05-14 19:15:39.056797202 +0200
  29. @@ -549,7 +549,7 @@ static int decrypt_key(struct image_head
  30. memcpy(key, res, KEY_SIZE);
  31. memcpy(ivec, res + KEY_SIZE, CIPHER_BLOCK);
  32. } else {
  33. - fprintf(stderr,"The main key has invalid length %i, need %i\n", s, KEY_SIZE + CIPHER_BLOCK);
  34. + fprintf(stderr,"The main key has invalid length %zu, need %i\n", s, KEY_SIZE + CIPHER_BLOCK);
  35. ret = -ENODATA;
  36. }
  37. gcry_free(res);
  38. diff -Nupr suspend~/vbetool/vbetool.c suspend/vbetool/vbetool.c
  39. --- suspend~/vbetool/vbetool.c 2012-09-15 22:23:44.000000000 +0200
  40. +++ suspend/vbetool/vbetool.c 2020-05-14 19:14:21.587468876 +0200
  41. @@ -320,7 +320,7 @@ char *__save_state(int *psize)
  42. memset(&r, 0, sizeof(r));
  43. - fprintf(stderr, "Allocated buffer at %p (base is 0x%x)\n", buffer,
  44. + fprintf(stderr, "Allocated buffer at %p (base is 0x%zx)\n", buffer,
  45. LRMI_base_addr());
  46. r.eax = 0x4f04;
  47. diff -Nupr suspend~/vbetool/vbetool.c suspend/vbetool/vbetool.c
  48. --- suspend~/vbetool/vbetool.c 2020-05-14 20:16:16.880562075 +0200
  49. +++ suspend/vbetool/vbetool.c 2020-05-14 20:50:20.563096451 +0200
  50. @@ -243,9 +243,9 @@ void restore_state_from(char *data)
  51. r.eax = 0x4f04;
  52. r.ecx = 0xf; /* all states */
  53. r.edx = 2; /* restore state */
  54. - r.es = (unsigned int) (data - LRMI_base_addr()) >> 4;
  55. - r.ebx = (unsigned int) (data - LRMI_base_addr()) & 0xf;
  56. - r.ds = 0x0040;
  57. + r.es = (unsigned short) (((data - (char*) LRMI_base_addr()) >> 4) & 0xffff);
  58. + r.ebx = (unsigned int) ((data - (char*) LRMI_base_addr()) & 0xf);
  59. + r.ds = 0x0040;
  60. if (!LRMI_int(0x10, &r)) {
  61. fprintf(stderr,
  62. @@ -327,9 +327,9 @@ char *__save_state(int *psize)
  63. r.ecx = 0xf; /* all states */
  64. r.edx = 1; /* save state */
  65. - r.es = (unsigned int) (buffer - LRMI_base_addr()) >> 4;
  66. - r.ebx = (unsigned int) (buffer - LRMI_base_addr()) & 0xf;
  67. - r.ds = 0x0040;
  68. + r.es = (unsigned short) (((buffer - (char*) LRMI_base_addr()) >> 4) & 0xffff);
  69. + r.ebx = (unsigned int) ((buffer - (char*) LRMI_base_addr()) & 0xf);
  70. + r.ds = 0x0040;
  71. fprintf(stderr, "ES: 0x%04X EBX: 0x%04X\n", r.es, r.ebx);
  72. @@ -525,8 +525,8 @@ int do_get_panel_id(int just_dimensions)
  73. .ebx = 0x0001
  74. };
  75. struct panel_id *id = LRMI_alloc_real(sizeof(struct panel_id));
  76. - r.es = (unsigned short)(((int)(id-LRMI_base_addr()) >> 4) & 0xffff);
  77. - r.edi = (unsigned long)(id-LRMI_base_addr()) & 0xf;
  78. + r.es = (unsigned short) (((id - LRMI_base_addr()) >> 4) & 0xffff);
  79. + r.edi = (unsigned long) ((id - LRMI_base_addr()) & 0xf);
  80. if(sizeof(struct panel_id) != 32)
  81. return fprintf(stderr, "oops: panel_id, sizeof struct panel_id != 32, it's %ld...\n", sizeof(struct panel_id)), 7;