:: commit 0885bac3aafc741bc68ab9ff71eddb1b5084becc

mintsuki <mintsuki@protonmail.com> — 2021-03-28 14:20

parents: c45407cb62

stivale2: Implement kernel slide tag

diff --git a/stage23/protos/stivale2.c b/stage23/protos/stivale2.c
index ab8ac900..7b791aac 100644
--- a/stage23/protos/stivale2.c
+++ b/stage23/protos/stivale2.c
@@ -140,6 +140,18 @@ void stivale2_load(char *config, char *cmdline, bool pxe, void *efi_system_table
     append_tag(&stivale2_struct, (struct stivale2_tag *)tag);
     }
 
+    //////////////////////////////////////////////
+    // Create kernel slide struct tag
+    //////////////////////////////////////////////
+    {
+    struct stivale2_struct_tag_kernel_slide *tag = ext_mem_alloc(sizeof(struct stivale2_struct_tag_kernel_slide));
+    tag->tag.identifier = STIVALE2_STRUCT_TAG_KERNEL_SLIDE_ID;
+
+    tag->kernel_slide = slide;
+
+    append_tag(&stivale2_struct, (struct stivale2_tag *)tag);
+    }
+
     //////////////////////////////////////////////
     // Create firmware struct tag
     //////////////////////////////////////////////
diff --git a/test/stivale2.c b/test/stivale2.c
index 77b6a103..04711887 100644
--- a/test/stivale2.c
+++ b/test/stivale2.c
@@ -139,6 +139,11 @@ void stivale2_main(struct stivale2_struct *info) {
                 e9_printf("Raw kernel file loaded at: %x", t->kernel_file);
                 break;
             }
+            case STIVALE2_STRUCT_TAG_KERNEL_SLIDE_ID: {
+                struct stivale2_struct_tag_kernel_slide *t = (struct stivale2_struct_tag_kernel_slide *)tag;
+                e9_printf("Kernel slide: %x", t->kernel_slide);
+                break;
+            }
             case STIVALE2_STRUCT_TAG_SMP_ID: {
                 struct stivale2_struct_tag_smp *s = (struct stivale2_struct_tag_smp *)tag;
                 e9_puts("SMP tag:");
tab: 248 wrap: offon