bank32k: Handle high/low stubs
authorAlan Cox <alan@linux.intel.com>
Mon, 20 Aug 2018 23:02:16 +0000 (00:02 +0100)
committerAlan Cox <alan@linux.intel.com>
Mon, 20 Aug 2018 23:02:16 +0000 (00:02 +0100)
In 32K/32K mode we have stubs high and low so program_vectors is needed
if we shrink space too

Kernel/bank32k.c

index a4fca37..17ec099 100644 (file)
@@ -129,9 +129,13 @@ int pagemap_realloc(usize_t code, usize_t size, usize_t stack) {
        if (want == have)
                return 0;
        if (have > want) {
+               /* Make a copy of the high vectors in the new low page */
                pfree[pfptr++] = ptr[1];
                ptr[1] = *ptr;
+               irq = __hard_di();
+               program_vectors(&udata.u_page);
                udata.u_ptab->p_page = udata.u_page;
+               __hard_irqrestore(irq);
                return 0;
        }
        /* If we are adding then just insert the new pages, keeping the common