Fix rebase
This commit is contained in:
28
arm9/source/alignedseqmemcpy.h
Normal file
28
arm9/source/alignedseqmemcpy.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* This file is part of Luma3DS
|
||||
* Copyright (C) 2016-2019 Aurora Wright, TuxSH
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Additional Terms 7.b and 7.c of GPLv3 apply to this file:
|
||||
* * Requiring preservation of specified reasonable legal notices or
|
||||
* author attributions in that material or in the Appropriate Legal
|
||||
* Notices displayed by works containing it.
|
||||
* * Prohibiting misrepresentation of the origin of that material,
|
||||
* or requiring that modified versions of such material be marked in
|
||||
* reasonable ways as different from the original version.
|
||||
*/
|
||||
#include "types.h"
|
||||
|
||||
void *alignedseqmemcpy(void *dst, const void *src, u32 len);
|
||||
65
arm9/source/alignedseqmemcpy.s
Normal file
65
arm9/source/alignedseqmemcpy.s
Normal file
@@ -0,0 +1,65 @@
|
||||
@ This file is part of Luma3DS
|
||||
@ Copyright (C) 2016-2019 Aurora Wright, TuxSH
|
||||
@
|
||||
@ This program is free software: you can redistribute it and/or modify
|
||||
@ it under the terms of the GNU General Public License as published by
|
||||
@ the Free Software Foundation, either version 3 of the License, or
|
||||
@ (at your option) any later version.
|
||||
@
|
||||
@ This program is distributed in the hope that it will be useful,
|
||||
@ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
@ GNU General Public License for more details.
|
||||
@
|
||||
@ You should have received a copy of the GNU General Public License
|
||||
@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
@
|
||||
@ Additional Terms 7.b and 7.c of GPLv3 apply to this file:
|
||||
@ * Requiring preservation of specified reasonable legal notices or
|
||||
@ author attributions in that material or in the Appropriate Legal
|
||||
@ Notices displayed by works containing it.
|
||||
@ * Prohibiting misrepresentation of the origin of that material,
|
||||
@ or requiring that modified versions of such material be marked in
|
||||
@ reasonable ways as different from the original version.
|
||||
|
||||
.section .text.alignedseqmemcpy, "ax", %progbits
|
||||
.arm
|
||||
@ Align on cache line boundaries & make sure the loops don't cross them.
|
||||
.align 5
|
||||
.global alignedseqmemcpy
|
||||
.type alignedseqmemcpy, %function
|
||||
alignedseqmemcpy:
|
||||
@ src=r1 and dst=r0 are expected to be 4-byte-aligned
|
||||
push {r4-r10, lr}
|
||||
|
||||
lsrs r12, r2, #5
|
||||
sub r2, r2, r12, lsl #5
|
||||
beq 2f
|
||||
|
||||
1:
|
||||
ldmia r1!, {r3-r10}
|
||||
stmia r0!, {r3-r10}
|
||||
subs r12, #1
|
||||
bne 1b
|
||||
|
||||
2:
|
||||
lsrs r12, r2, #2
|
||||
sub r2, r2, r12, lsl #2
|
||||
beq 4f
|
||||
|
||||
3:
|
||||
ldr r3, [r1], #4
|
||||
str r3, [r0], #4
|
||||
subs r12, #1
|
||||
bne 3b
|
||||
|
||||
4:
|
||||
tst r2, #2
|
||||
ldrneh r3, [r1], #2
|
||||
strneh r3, [r0], #2
|
||||
|
||||
tst r2, #1
|
||||
ldrneb r3, [r1], #1
|
||||
strneb r3, [r0], #1
|
||||
|
||||
pop {r4-r10, pc}
|
||||
@@ -74,18 +74,10 @@ void __attribute__((noreturn)) arm9ExceptionHandlerMain(u32 *registerDump, u32 t
|
||||
//Copy header (actually optimized by the compiler)
|
||||
*(ExceptionDumpHeader *)FINAL_BUFFER = dumpHeader;
|
||||
|
||||
<<<<<<< HEAD:exceptions/arm9/source/mainHandler.c
|
||||
if(ARESCREENSINITIALIZED) I2C_writeReg(I2C_DEV_MCU, 0x22, 1 << 0); //Shutdown LCD
|
||||
|
||||
((void (*)())0xFFFF0830)(); //Ensure that all memory transfers have completed and that the data cache has been flushed
|
||||
|
||||
I2C_writeReg(I2C_DEV_MCU, 0x20, 1 << 2); //Reboot
|
||||
=======
|
||||
if(ARESCREENSINITIALIZED) i2cWriteRegisterNoWait(I2C_DEV_MCU, 0x22, 1 << 0); //Shutdown LCD
|
||||
|
||||
((void (*)())0xFFFF0830)(); //Ensure that all memory transfers have completed and that the data cache has been flushed
|
||||
|
||||
i2cWriteRegisterNoWait(I2C_DEV_MCU, 0x20, 1 << 2); //Reboot
|
||||
>>>>>>> Do the same for arm9 exceptions:source/arm9_exception_handlers.c
|
||||
while(true);
|
||||
}
|
||||
|
||||
@@ -29,20 +29,4 @@
|
||||
extern const u32 arm9ExceptionHandlerAddressTable[6];
|
||||
extern u32 arm9ExceptionHandlerSvcBreakAddress;
|
||||
|
||||
<<<<<<< HEAD:exceptions/arm9/source/types.h
|
||||
//Common data types
|
||||
typedef uint8_t u8;
|
||||
typedef uint16_t u16;
|
||||
typedef uint32_t u32;
|
||||
typedef uint64_t u64;
|
||||
typedef volatile u8 vu8;
|
||||
typedef volatile u16 vu16;
|
||||
typedef volatile u32 vu32;
|
||||
typedef volatile u64 vu64;
|
||||
|
||||
#define PDN_GPU_CNT (*(vu32 *)0x10141200)
|
||||
|
||||
#define ARESCREENSINITIALIZED ((PDN_GPU_CNT & 0xFF) != 1)
|
||||
=======
|
||||
u32 safecpy(void *dst, const void *src, u32 len);
|
||||
>>>>>>> Do the same for arm9 exceptions:source/arm9_exception_handlers.h
|
||||
|
||||
@@ -180,11 +180,7 @@ bool I2C_readRegBuf(I2cDevice devId, u8 regAddr, u8 *out, u32 size)
|
||||
return true;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
bool I2C_writeRegBuf(I2cDevice devId, u8 regAddr, const u8 *in, u32 size)
|
||||
=======
|
||||
bool i2cWriteRegisterNoWait(u8 dev_id, u8 reg, u8 data)
|
||||
>>>>>>> Do the same for arm9 exceptions
|
||||
{
|
||||
const u8 busId = i2cDevTable[devId].busId;
|
||||
I2cRegs *const regs = i2cGetBusRegsBase(busId);
|
||||
@@ -204,7 +200,6 @@ bool i2cWriteRegisterNoWait(u8 dev_id, u8 reg, u8 data)
|
||||
}
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
regs->REG_I2C_DATA = *in;
|
||||
regs->REG_I2C_CNT = I2C_ENABLE | I2C_IRQ_ENABLE | I2C_DIRE_WRITE | I2C_STOP;
|
||||
i2cWaitBusy(regs);
|
||||
@@ -223,15 +218,6 @@ u8 I2C_readReg(I2cDevice devId, u8 regAddr)
|
||||
if(!I2C_readRegBuf(devId, regAddr, &data, 1)) return 0xFF;
|
||||
return data;
|
||||
}
|
||||
=======
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool i2cWriteRegister(u8 dev_id, u8 reg, u8 data)
|
||||
{
|
||||
bool ret = i2cWriteRegisterNoWait(dev_id, reg, data);
|
||||
wait(3ULL);
|
||||
>>>>>>> Do the same for arm9 exceptions
|
||||
|
||||
bool I2C_writeReg(I2cDevice devId, u8 regAddr, u8 data)
|
||||
{
|
||||
|
||||
@@ -90,7 +90,6 @@ bool I2C_writeRegBuf(I2cDevice devId, u8 regAddr, const u8 *in, u32 size);
|
||||
*/
|
||||
u8 I2C_readReg(I2cDevice devId, u8 regAddr);
|
||||
|
||||
<<<<<<< HEAD
|
||||
/**
|
||||
* @brief Writes a byte to a I2C register.
|
||||
*
|
||||
@@ -101,8 +100,3 @@ u8 I2C_readReg(I2cDevice devId, u8 regAddr);
|
||||
* @return Returns true on success and false on failure.
|
||||
*/
|
||||
bool I2C_writeReg(I2cDevice devId, u8 regAddr, u8 data);
|
||||
=======
|
||||
u8 i2cReadRegister(u8 dev_id, u8 reg);
|
||||
bool i2cWriteRegister(u8 dev_id, u8 reg, u8 data);
|
||||
bool i2cWriteRegisterNoWait(u8 dev_id, u8 reg, u8 data);
|
||||
>>>>>>> Do the same for arm9 exceptions
|
||||
|
||||
Reference in New Issue
Block a user