排他制御デモ追加。

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_firmware@269 b871894f-2f95-9b40-918c-086798483c85
This commit is contained in:
nakasima 2009-02-09 10:00:36 +00:00
parent 8a92549793
commit b838a20f35
10 changed files with 176 additions and 22 deletions

View File

@ -22,6 +22,7 @@ include $(CTRBROM_ROOT)/build/buildtools/commondefs
SUBDIRS = \
thread \
exclusive \
#----------------------------------------------------------------------------

View File

@ -0,0 +1,52 @@
#! make -f
#----------------------------------------------------------------------------
# Project: CtrBrom - firmware - exclusive
# File: Makefile
#
# Copyright 2009 Nintendo. All rights reserved.
#
# These coded instructions, statements, and computer programs contain
# proprietary information of Nintendo of America Inc. and/or Nintendo
# Company Ltd., and are protected by Federal copyright law. They may
# not be disclosed to third parties or copied or duplicated in any form,
# in whole or in part, without the prior written consent of Nintendo.
#
# $Date:: $
# $Rev$
# $Author$
#----------------------------------------------------------------------------
#BROM_DEF_LINK_SCATLD = TRUE
BROM_TARGET = FIRM
BROM_MEDIA = NAND
SUBDIRS =
#----------------------------------------------------------------------------
TARGET_BIN = exclusive11.dasm
SRCS = \
main.c \
#LCFILE = # using default
include $(CTRBROM_ROOT)/build/buildtools/commondefs
SRCDIR += $(BROM_ROOT)/build/tests/exclusive/ARM11
INSTALL_DIR = ..
INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN_BASENAME).axf
#----------------------------------------------------------------------------
do-build: $(TARGETS)
include $(CTRBROM_ROOT)/build/buildtools/modulerules
#===== End of Makefile =====

View File

@ -0,0 +1,54 @@
#! make -f
#----------------------------------------------------------------------------
# Project: CtrBrom - firmware - exclusive
# File: Makefile
#
# Copyright 2009 Nintendo. All rights reserved.
#
# These coded instructions, statements, and computer programs contain
# proprietary information of Nintendo of America Inc. and/or Nintendo
# Company Ltd., and are protected by Federal copyright law. They may
# not be disclosed to third parties or copied or duplicated in any form,
# in whole or in part, without the prior written consent of Nintendo.
#
# $Date:: $
# $Rev$
# $Author$
#----------------------------------------------------------------------------
#BROM_DEF_LINK_SCATLD = TRUE
BROM_TARGET = FIRM
BROM_MEDIA = NAND
BROM_PROC = ARM9
SUBDIRS =
#----------------------------------------------------------------------------
TARGET_BIN = exclusive9.dasm
SRCS = \
main.c \
#LCFILE = # using default
include $(CTRBROM_ROOT)/build/buildtools/commondefs
SRCDIR = $(BROM_ROOT)/build/tests/exclusive/ARM9
INSTALL_DIR = ..
INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN_BASENAME).axf
#----------------------------------------------------------------------------
do-build: $(TARGETS)
include $(CTRBROM_ROOT)/build/buildtools/modulerules
#===== End of Makefile =====

View File

@ -0,0 +1,33 @@
#! make -f
#----------------------------------------------------------------------------
# Project: CtrBrom - firmware_tests
# File: Makefile
#
# Copyright 2009 Nintendo. All rights reserved.
#
# These coded instructions, statements, and computer programs contain
# proprietary information of Nintendo of America Inc. and/or Nintendo
# Company Ltd., and are protected by Federal copyright law. They may
# not be disclosed to third parties or copied or duplicated in any form,
# in whole or in part, without the prior written consent of Nintendo.
#
# $Date:: $
# $Rev$
# $Author$
#----------------------------------------------------------------------------
include $(CTRBROM_ROOT)/build/buildtools/commondefs
#----------------------------------------------------------------------------
SUBDIRS = \
ARM11 \
ARM9 \
#----------------------------------------------------------------------------
include $(CTRBROM_ROOT)/build/buildtools/modulerules
#===== End of Makefile =====

View File

@ -1,6 +1,6 @@
#! make -f
#----------------------------------------------------------------------------
# Project: CtrBrom - build
# Project: CtrBrom - firmware_tests
# File: Makefile
#
# Copyright 2009 Nintendo. All rights reserved.

View File

@ -22,6 +22,7 @@ include $(CTRBROM_ROOT)/build/buildtools/commondefs
SUBDIRS = \
thread \
exclusive \
vfp \
ifeq ($(BROM_PLATFORM),NE1EMU)

View File

@ -25,7 +25,7 @@ SUBDIRS =
#----------------------------------------------------------------------------
TARGET_BIN = thread11.dasm
TARGET_BIN = exclusive11.dasm
SRCS = \
main.c \
@ -34,7 +34,7 @@ SRCS = \
include $(CTRBROM_ROOT)/build/buildtools/commondefs
SRCDIR = . $(ROOT)/bootrom/build/bootrom/thread/ARM11 \
SRCDIR = . $(ROOT)/bootrom/build/bootrom/exclusive/ARM11 \
INSTALL_DIR = ..
INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN_BASENAME).axf

View File

@ -1,8 +1,8 @@
/*---------------------------------------------------------------------------*
Project: TwlBrom - thread
Project: TwlBrom - exclusive
File: main.c
Copyright 2008 Nintendo. All rights reserved.
Copyright 2009 Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo
@ -24,15 +24,20 @@ void BromMain( void )
osPrintf( "ARM11: start\n" );
osInitThread();
while (1)
while ( 1 )
{
u32 pmon = osGetPerfMonitor(OS_MONITOR_1);
OSTick tick = osGetTick();
osSleep(1000);
tick = osGetTick() - tick;
pmon = osGetPerfMonitor(OS_MONITOR_1) - pmon;
osTPrintf( "sleep tick = %llu msec\n", OS_TICK_TO_MSEC(tick) );
osTPrintf( "sleep pmon = %llu msec\n", OS_PMON_TO_MSEC(pmon) );
if ( osTryLockByte(1, (OSLockByte *)HW_CARD_LOCK_BUF, NULL) == OS_LOCK_SUCCESS )
{
osTPrintf( "SpinLock is succeed.\n" );
osSleep(1000 - 100 * i_osGetCpuID());
osUnlockByte(1, (OSLockByte *)HW_CARD_LOCK_BUF, NULL);
osSleep(1000 - 100 * i_osGetCpuID());
}
else
{
osTPrintf( "SpinLock is failed.\n" );
osSleep(1000 - 100 * i_osGetCpuID());
}
}
}

View File

@ -27,7 +27,7 @@ SUBDIRS =
#----------------------------------------------------------------------------
TARGET_BIN = thread9.dasm
TARGET_BIN = exclusive9.dasm
SRCS = \
main.c \
@ -36,7 +36,7 @@ SRCS = \
include $(CTRBROM_ROOT)/build/buildtools/commondefs
SRCDIR = . $(ROOT)/bootrom/build/bootrom/thread/ARM9 \
SRCDIR = . $(ROOT)/bootrom/build/bootrom/exclusive/ARM9 \
INSTALL_DIR = ..
INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN_BASENAME).axf

View File

@ -1,8 +1,8 @@
/*---------------------------------------------------------------------------*
Project: TwlBrom - thread
Project: TwlBrom - exclusive
File: main.c
Copyright 2008 Nintendo. All rights reserved.
Copyright 2009 Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo
@ -24,12 +24,20 @@ void BromSpMain( void )
osPrintf( "ARM9: start\n" );
osInitThread();
while (1)
while ( 1 )
{
OSTick tick = osGetTick();
osSleep(1000);
tick = osGetTick() - tick;
osTPrintf( "sleep tick = %llu msec\n", OS_TICK_TO_MSEC(tick) );
if ( osTryLockByte(1, (OSLockByte *)HW_CARD_LOCK_BUF, NULL) == OS_LOCK_SUCCESS )
{
osTPrintf( "SpinLock is succeed.\n" );
osSleep(800);
osUnlockByte(1, (OSLockByte *)HW_CARD_LOCK_BUF, NULL);
osSleep(800);
}
else
{
osTPrintf( "SpinLock is failed.\n" );
osSleep(800);
}
}
}