Merged branch haiku/branches/developer/bonefish/optimization revision
23139 into trunk, with roughly the following changes (for details svn log the branch): * The int 99 syscall handler is now fully in assembly. * Added a sysenter/sysexit handler and use it on Pentiums that support it (via commpage). * Got rid of i386_handle_trap(). A bit of functionality was moved into the assembly handler which now uses a jump table to call C functions handling the respective interrupt. * Some optimizations to get user debugger support code out of the interrupt handling path. * Introduced a thread::flags fields which allows to skip handling of rare events (signals, user debug enabling/disabling) on the common interrupt handling path. * Got rid of the explicit iframe stack. The iframes can still be retrieved by iterating through the stack frames. * Made the commpage an architecture independent feature. It's used for the real time data stuff (instead of creating a separate area). * The x86 CPU modules can now provide processor optimized versions for common functions (currently memcpy() only). They are used in the kernel and are provided to the userland via commpage entries. * Introduced build system feature allowing easy use of C structure member offsets in assembly code. Changes after merging: * Fixed merge conflict in src/system/kernel/arch/x86/arch_debug.cpp (caused by refactoring and introduction of "call" debugger command). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23370 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -212,6 +212,118 @@ actions Ld
|
||||
$(LINK) $(LINKFLAGS) -o "$(1)" "$(2)" "$(NEEDLIBS)" $(LINKLIBS)
|
||||
}
|
||||
|
||||
rule CreateAsmStructOffsetsHeader header : source
|
||||
{
|
||||
# CreateAsmStructOffsetsHeader header : source
|
||||
#
|
||||
# Grist will be added to both header and source.
|
||||
|
||||
header = [ FGristFiles $(header) ] ;
|
||||
source = [ FGristFiles $(source) ] ;
|
||||
|
||||
# find out which headers, defines, etc. to use
|
||||
local headers ;
|
||||
local sysHeaders ;
|
||||
local defines ;
|
||||
local flags ;
|
||||
local includesSeparator ;
|
||||
local localIncludesOption ;
|
||||
local systemIncludesOption ;
|
||||
|
||||
on $(header) { # use on $(1) variable values
|
||||
if ! $(PLATFORM) in $(SUPPORTED_PLATFORMS) {
|
||||
return ;
|
||||
}
|
||||
|
||||
# headers and defines
|
||||
headers = $(SEARCH_SOURCE) $(SUBDIRHDRS) $(HDRS) ;
|
||||
sysHeaders = $(SUBDIRSYSHDRS) $(SYSHDRS) ;
|
||||
defines = $(DEFINES) ;
|
||||
|
||||
if $(PLATFORM) = host {
|
||||
sysHeaders += $(HOST_HDRS) ;
|
||||
defines += $(HOST_DEFINES) ;
|
||||
|
||||
if $(USES_BE_API) {
|
||||
sysHeaders += $(HOST_BE_API_HEADERS) ;
|
||||
}
|
||||
|
||||
} else {
|
||||
sysHeaders += $(TARGET_HDRS) ;
|
||||
defines += $(TARGET_DEFINES) ;
|
||||
}
|
||||
|
||||
# optimization flags
|
||||
if $(DEBUG) = 0 {
|
||||
flags += $(OPTIM) ;
|
||||
} else {
|
||||
flags += -O0 ;
|
||||
}
|
||||
|
||||
if $(PLATFORM) = host {
|
||||
# warning flags
|
||||
if $(WARNINGS) != 0 {
|
||||
flags += $(HOST_WARNING_C++FLAGS) ;
|
||||
}
|
||||
|
||||
# debug and other flags
|
||||
flags += $(HOST_C++FLAGS) $(HOST_DEBUG_$(DEBUG)_C++FLAGS)
|
||||
$(SUBDIRC++FLAGS) $(C++FLAGS) ;
|
||||
|
||||
if $(USES_BE_API) {
|
||||
flags += $(HOST_BE_API_C++FLAGS) ;
|
||||
}
|
||||
|
||||
C++ on $(header) = $(HOST_C++) ;
|
||||
|
||||
includesSeparator = $(HOST_INCLUDES_SEPARATOR) ;
|
||||
localIncludesOption = $(HOST_LOCAL_INCLUDES_OPTION) ;
|
||||
systemIncludesOption = $(HOST_SYSTEM_INCLUDES_OPTION) ;
|
||||
|
||||
} else {
|
||||
# warning flags
|
||||
if $(WARNINGS) != 0 {
|
||||
flags += $(TARGET_WARNING_C++FLAGS) ;
|
||||
}
|
||||
|
||||
# debug and other flags
|
||||
flags += $(TARGET_C++FLAGS) $(TARGET_DEBUG_$(DEBUG)_C++FLAGS)
|
||||
$(SUBDIRC++FLAGS) $(C++FLAGS) ;
|
||||
|
||||
C++ on $(header) = $(TARGET_C++) ;
|
||||
|
||||
includesSeparator = $(TARGET_INCLUDES_SEPARATOR) ;
|
||||
localIncludesOption = $(TARGET_LOCAL_INCLUDES_OPTION) ;
|
||||
systemIncludesOption = $(TARGET_SYSTEM_INCLUDES_OPTION) ;
|
||||
}
|
||||
}
|
||||
|
||||
# locate object, search for source, and set on target variables
|
||||
|
||||
Depends $(header) : $(source) ;
|
||||
SEARCH on $(source) += $(SEARCH_SOURCE) ;
|
||||
MakeLocateArch $(header) ;
|
||||
LocalClean clean : $(header) ;
|
||||
|
||||
HDRRULE on $(source) = HdrRule ;
|
||||
HDRSCAN on $(source) = $(HDRPATTERN) ;
|
||||
HDRSEARCH on $(source) = $(headers) $(sysHeaders) $(STDHDRS) ;
|
||||
HDRGRIST on $(source) = $(HDRGRIST) ;
|
||||
|
||||
C++FLAGS on $(header) = $(flags) ;
|
||||
CCHDRS on $(header) = [ FIncludes $(headers) : $(localIncludesOption) ]
|
||||
$(includesSeparator)
|
||||
[ FSysIncludes $(sysHeaders) : $(systemIncludesOption) ] ;
|
||||
CCDEFS on $(header) = [ FDefines $(defines) ] ;
|
||||
|
||||
CreateAsmStructOffsetsHeader1 $(header) : $(source) ;
|
||||
}
|
||||
|
||||
actions CreateAsmStructOffsetsHeader1
|
||||
{
|
||||
$(C++) -S "$(2)" $(C++FLAGS) $(CCDEFS) $(CCHDRS) -o - \
|
||||
| grep "#define" | sed -e 's/\$//' > "$(1)"
|
||||
}
|
||||
|
||||
rule MergeObjectFromObjects
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user