Add memset
This commit is contained in:
parent
9f12a47cfc
commit
6ccc0f0538
@ -33,7 +33,6 @@
|
|||||||
#include "crypto.h"
|
#include "crypto.h"
|
||||||
#include "fmt.h"
|
#include "fmt.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "i2c.h"
|
|
||||||
|
|
||||||
extern CfgData configData;
|
extern CfgData configData;
|
||||||
extern ConfigurationStatus needConfig;
|
extern ConfigurationStatus needConfig;
|
||||||
@ -64,16 +63,12 @@ void main(int argc, char **argv)
|
|||||||
for(; i < 41; i++)
|
for(; i < 41; i++)
|
||||||
launchedPath[i] = 0;
|
launchedPath[i] = 0;
|
||||||
|
|
||||||
for(u32 i = 0; i < 8; i++)
|
memset(launchedFirmTidLow, 0, 16);
|
||||||
launchedFirmTidLow[i] = 0;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 2: //Firmlaunch
|
case 2: //Firmlaunch
|
||||||
{
|
{
|
||||||
|
|
||||||
i2cWriteRegister(I2C_DEV_MCU, 0x20, 1 << 0);
|
|
||||||
while(true);
|
|
||||||
u32 i;
|
u32 i;
|
||||||
u16 *p = (u16 *)argv[0];
|
u16 *p = (u16 *)argv[0];
|
||||||
for(i = 0; i < 40 && launchedPath[i] != 0; i++)
|
for(i = 0; i < 40 && launchedPath[i] != 0; i++)
|
||||||
|
@ -36,6 +36,15 @@ void memcpy(void *dest, const void *src, u32 size)
|
|||||||
destc[i] = srcc[i];
|
destc[i] = srcc[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *memset(void *dest, u32 value, u32 size)
|
||||||
|
{
|
||||||
|
u8 *destc = (u8 *)dest;
|
||||||
|
|
||||||
|
for(u32 i = 0; i < size; i++) destc[i] = (u8)value;
|
||||||
|
|
||||||
|
return dest;
|
||||||
|
}
|
||||||
|
|
||||||
void memset32(void *dest, u32 filler, u32 size)
|
void memset32(void *dest, u32 filler, u32 size)
|
||||||
{
|
{
|
||||||
u32 *dest32 = (u32 *)dest;
|
u32 *dest32 = (u32 *)dest;
|
||||||
@ -80,4 +89,4 @@ u8 *memsearch(u8 *startPos, const void *pattern, u32 size, u32 patternSize)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
void memcpy(void *dest, const void *src, u32 size);
|
void memcpy(void *dest, const void *src, u32 size);
|
||||||
|
void *memset(void *dest, u32 value, u32 size) __attribute__((used));
|
||||||
void memset32(void *dest, u32 filler, u32 size);
|
void memset32(void *dest, u32 filler, u32 size);
|
||||||
int memcmp(const void *buf1, const void *buf2, u32 size);
|
int memcmp(const void *buf1, const void *buf2, u32 size);
|
||||||
u8 *memsearch(u8 *startPos, const void *pattern, u32 size, u32 patternSize);
|
u8 *memsearch(u8 *startPos, const void *pattern, u32 size, u32 patternSize);
|
||||||
|
Reference in New Issue
Block a user