initial commit

This commit is contained in:
2026-04-12 22:20:18 +08:00
commit 190c2edbb2
155 changed files with 36314 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
//BSP板级支持包所需全局变量
unsigned long UART_BASE = 0xbf000000; //UART16550的虚地址
unsigned long CONFREG_TIMER_BASE = 0xbf20f100; //CONFREG计数器的虚地址
unsigned long CONFREG_CLOCKS_PER_SEC = 50000000L; //CONFREG时钟频率
unsigned long CORE_CLOCKS_PER_SEC = 33000000L; //处理器核时钟频率
#define CPSIZE 12
char src[CPSIZE] = "this is src";
char dst[CPSIZE] = "this is dst";
int main(int argc, char** argv)
{
int a = 100;
float b = 3.2564;
double c = 5478.47563;
char *str;
printf("Hello Loongarch32r!\n");
printf("a = %d\n", a);
printf("b = %f\n", b);
printf("c = %lf\n", c);
str = (char *)malloc(6);
strcpy(str, "ABCDE");
printf("String = %s, Address = 0x%x\n", str, str);
memcpy(dst, src, CPSIZE);
printf("%s\n", dst);
return 0;
}