Avoid using pdata for variables in scratch trampoline
This commit is contained in:
parent
9a7e779999
commit
4f3eaf88f9
@ -46,6 +46,8 @@ void scratch_trampoline(void) {
|
|||||||
// Uses SCAR0, 1, 2, 3, and 4 which are mapped at 0x0000 in data space and are
|
// Uses SCAR0, 1, 2, 3, and 4 which are mapped at 0x0000 in data space and are
|
||||||
// 4096 bytes in size.
|
// 4096 bytes in size.
|
||||||
|
|
||||||
|
//TODO: ensure pdata is not used!
|
||||||
|
|
||||||
if ((SCAR0H == 0x00) || (SCAR1H == 0x00) || (SCAR2H == 0x00) || (SCAR3H == 0x00) || (SCAR4H == 0x00)) {
|
if ((SCAR0H == 0x00) || (SCAR1H == 0x00) || (SCAR2H == 0x00) || (SCAR3H == 0x00) || (SCAR4H == 0x00)) {
|
||||||
// Disable scratch RAM mapping
|
// Disable scratch RAM mapping
|
||||||
SCAR0H = 0b11;
|
SCAR0H = 0b11;
|
||||||
@ -54,7 +56,7 @@ void scratch_trampoline(void) {
|
|||||||
SCAR3H = 0b11;
|
SCAR3H = 0b11;
|
||||||
SCAR4H = 0b11;
|
SCAR4H = 0b11;
|
||||||
} else {
|
} else {
|
||||||
int i;
|
int __data i;
|
||||||
// Copy scratch ROM
|
// Copy scratch ROM
|
||||||
for (i = 0; i < ARRAY_SIZE(scratch_rom) && i < ARRAY_SIZE(scratch_ram); i++) {
|
for (i = 0; i < ARRAY_SIZE(scratch_rom) && i < ARRAY_SIZE(scratch_ram); i++) {
|
||||||
scratch_ram[i] = scratch_rom[i];
|
scratch_ram[i] = scratch_rom[i];
|
||||||
|
@ -46,6 +46,8 @@ void scratch_trampoline(void) {
|
|||||||
// Uses SCAR0, 1, 2, 3, and 4 which are mapped at 0x0000 in data space and are
|
// Uses SCAR0, 1, 2, 3, and 4 which are mapped at 0x0000 in data space and are
|
||||||
// 4096 bytes in size.
|
// 4096 bytes in size.
|
||||||
|
|
||||||
|
//TODO: ensure pdata is not used!
|
||||||
|
|
||||||
if ((SCAR0H == 0x00) || (SCAR1H == 0x00) || (SCAR2H == 0x00) || (SCAR3H == 0x00) || (SCAR4H == 0x00)) {
|
if ((SCAR0H == 0x00) || (SCAR1H == 0x00) || (SCAR2H == 0x00) || (SCAR3H == 0x00) || (SCAR4H == 0x00)) {
|
||||||
// Disable scratch RAM mapping
|
// Disable scratch RAM mapping
|
||||||
SCAR0H = 0b11;
|
SCAR0H = 0b11;
|
||||||
@ -54,7 +56,7 @@ void scratch_trampoline(void) {
|
|||||||
SCAR3H = 0b11;
|
SCAR3H = 0b11;
|
||||||
SCAR4H = 0b11;
|
SCAR4H = 0b11;
|
||||||
} else {
|
} else {
|
||||||
int i;
|
int __data i;
|
||||||
// Copy scratch ROM
|
// Copy scratch ROM
|
||||||
for (i = 0; i < ARRAY_SIZE(scratch_rom) && i < ARRAY_SIZE(scratch_ram); i++) {
|
for (i = 0; i < ARRAY_SIZE(scratch_rom) && i < ARRAY_SIZE(scratch_ram); i++) {
|
||||||
scratch_ram[i] = scratch_rom[i];
|
scratch_ram[i] = scratch_rom[i];
|
||||||
|
@ -36,7 +36,7 @@ void scratch_trampoline(void) {
|
|||||||
// Disable scratch RAM mapping
|
// Disable scratch RAM mapping
|
||||||
SCAR0H = 0b11;
|
SCAR0H = 0b11;
|
||||||
} else {
|
} else {
|
||||||
int i;
|
int __data i;
|
||||||
// Copy scratch ROM
|
// Copy scratch ROM
|
||||||
for (i = 0; i < ARRAY_SIZE(scratch_rom) && i < ARRAY_SIZE(scratch_ram); i++) {
|
for (i = 0; i < ARRAY_SIZE(scratch_rom) && i < ARRAY_SIZE(scratch_ram); i++) {
|
||||||
scratch_ram[i] = scratch_rom[i];
|
scratch_ram[i] = scratch_rom[i];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user