排他制御デモ追加。

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 = \ SUBDIRS = \
thread \ 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 #! make -f
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# Project: CtrBrom - build # Project: CtrBrom - firmware_tests
# File: Makefile # File: Makefile
# #
# Copyright 2009 Nintendo. All rights reserved. # Copyright 2009 Nintendo. All rights reserved.

View File

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

View File

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

View File

@ -1,8 +1,8 @@
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
Project: TwlBrom - thread Project: TwlBrom - exclusive
File: main.c File: main.c
Copyright 2008 Nintendo. All rights reserved. Copyright 2009 Nintendo. All rights reserved.
These coded instructions, statements, and computer programs contain These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo proprietary information of Nintendo of America Inc. and/or Nintendo
@ -24,15 +24,20 @@ void BromMain( void )
osPrintf( "ARM11: start\n" ); osPrintf( "ARM11: start\n" );
osInitThread(); osInitThread();
while (1) while ( 1 )
{ {
u32 pmon = osGetPerfMonitor(OS_MONITOR_1); if ( osTryLockByte(1, (OSLockByte *)HW_CARD_LOCK_BUF, NULL) == OS_LOCK_SUCCESS )
OSTick tick = osGetTick(); {
osSleep(1000); osTPrintf( "SpinLock is succeed.\n" );
tick = osGetTick() - tick; osSleep(1000 - 100 * i_osGetCpuID());
pmon = osGetPerfMonitor(OS_MONITOR_1) - pmon; osUnlockByte(1, (OSLockByte *)HW_CARD_LOCK_BUF, NULL);
osTPrintf( "sleep tick = %llu msec\n", OS_TICK_TO_MSEC(tick) ); osSleep(1000 - 100 * i_osGetCpuID());
osTPrintf( "sleep pmon = %llu msec\n", OS_PMON_TO_MSEC(pmon) ); }
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 = \ SRCS = \
main.c \ main.c \
@ -36,7 +36,7 @@ SRCS = \
include $(CTRBROM_ROOT)/build/buildtools/commondefs include $(CTRBROM_ROOT)/build/buildtools/commondefs
SRCDIR = . $(ROOT)/bootrom/build/bootrom/thread/ARM9 \ SRCDIR = . $(ROOT)/bootrom/build/bootrom/exclusive/ARM9 \
INSTALL_DIR = .. INSTALL_DIR = ..
INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN_BASENAME).axf INSTALL_TARGETS = $(BINDIR)/$(TARGET_BIN_BASENAME).axf

View File

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