Initial snapshot

This commit is contained in:
Mercier Pierre-Olivier 2013-02-11 22:04:30 +01:00
commit fee4dd4e6d
373 changed files with 62144 additions and 0 deletions

View file

@ -0,0 +1,137 @@
#
# ---------- header -----------------------------------------------------------
#
# project kaneton
#
# license kaneton
#
# file /home/mycure/kane...ofile/host/linux/ia32.mips64/mips64.conf
#
# created julien quintard [thu jun 28 21:15:33 2007]
# updated julien quintard [fri may 1 23:54:21 2009]
#
#
# ---------- information ------------------------------------------------------
#
# this file contains definitions specific to the mips64 target microprocessor
# architecture.
#
#
# include the linux generic definitions
#
_INCLUDES_ = -I${_INCLUDE_DIR_}
#
# ---------- flags ------------------------------------------------------------
#
_CC_FLAGS_ = -D___kaneton \
${_INCLUDES_} \
${_KANETON_FLAGS_} \
-fno-builtin \
-Wimplicit \
-Wparentheses \
-Wreturn-type \
-Wswitch -Wswitch-enum \
-Wunused-function \
-Wunused-variable \
-Wmissing-prototypes \
-Wmissing-declarations \
-Wall -W -std=c99 \
-mabi=64 \
-G 0 \
-march=mips64 \
-EL \
-mgp64 \
-mfp64 \
-mlong64 \
-DMIPS64_DEPENDENT \
-DMIPS64_DEV
_LD_FLAGS_ = --warn-unresolved-symbols \
--oformat=elf64-littlemips
_ASM_FLAGS_ = -mabi=64 \
-G 0 \
-march=mips64 \
-EL \
-mgp64 \
-mfp64
_CPP_FLAGS_ =
_SHELL_FLAGS_ =
_PYTHON_FLAGS_ =
_PERL_FLAGS_ =
_MAKE_FLAGS_ =
#
# ---------- binaries ---------------------------------------------------------
#
_BINARIES_ = ${_SHELL_}, ${_CC_}, ${_MAKE_}, \
${_RM_}, ${_AR_}, ${_RANLIB_}, \
${_LD_}, ${_AS_}, ${_BIBTEX_},\
${_LN_}, ${_TOUCH_}, ${_WC_}, \
${_DATE_}, ${_TAIL_}, ${_TAR_}, \
${_PDFLATEX_}, ${_CP_}, \
${_CAT_}, ${_SED_}, ${_CPP_}, \
${_MTOOLS_}, ${_MCOPY_}, \
${_XPDF_}, ${_MKTEMP_}, ${_MV_},\
${_LEX_}, ${_SCRIPT_}, \
${_PERL_}, ${_PYTHON_}, \
${_DIRNAME_}, ${_BASENAME_}, \
${_WHICH_}
_SHELL_ = bash
_CC_ = mips64-gcc
_AS_ = mips64-as
_OBJCOPY_ = mips64-objcopy
_MAKE_ = gmake
_RM_ = rm -f
_PURGE_ = ${_RM_} *.pyc *~ .*~ \#* .\#*
_AR_ = mips64-ar cq
_RANLIB_ = mips64-ranlib
_CD_ = cd
_LD_ = mips64-ld
_LN_ = ln -s -f
_TOUCH_ = touch
_WC_ = wc
_DATE_ = date -u
_TAIL_ = tail
_TAR_ = tar
_PDFLATEX_ = pdflatex
_BIBTEX_ = bibtex
_CP_ = cp
_CAT_ = cat
_SED_ = sed -r
_ECHO_ = echo
_CPP_ = mips64-cpp
_MTOOLS_ = mtools
_MCOPY_ = mcopy
_XPDF_ = xpdf
_MKTEMP_ = mktemp
_MV_ = mv
_PWD_ = pwd
_LEX_ = lex -t
_SCRIPT_ = script
_PERL_ = perl
_PYTHON_ = python
_DIRNAME_ = dirname
_BASENAME_ = basename
_WHICH_ = which
_EXIT_ = exit
#
# microprocessor specific definitions
#
_CC_FLAGS_ += -D___kaneton$$\endian=1 \
-D___kaneton$$\wordsz=64 \
-D___kaneton$$\pagesz=4096

View file

@ -0,0 +1,33 @@
#
# ---------- header -----------------------------------------------------------
#
# project kaneton
#
# license kaneton
#
# file /home/mycure/kane...nvironment/profile/host/linux/linux.desc
#
# created julien quintard [tue may 8 13:20:04 2007]
# updated julien quintard [tue may 29 16:37:31 2007]
#
#
# ---------- information ------------------------------------------------------
#
# this file describes the linux environment variables.
#
- variable: _SHELL_
string: Shell
type: any
description: The shell binary path
- variable: _CC_
string: C Compiler
type: any
description: The C compiler binary path
- variable: _MAKE_
string: Make
type: any
description: The make binary path

View file

@ -0,0 +1,23 @@
#
# ---------- header -----------------------------------------------------------
#
# project kaneton
#
# license kaneton
#
# file /home/enguerrand/...profile/host/linux/ia32.mips64/mips64.mk
#
# created julien quintard [tue may 8 13:03:34 2007]
# updated enguerrand raymond [sun may 17 09:36:48 2009]
#
#
# ---------- information ------------------------------------------------------
#
# this file implements the remaining functions of the kaneton make interface.
#
# indeed the major generic part of the interface is already provided by the
# host profile.
#
include ../linux.mk

View file

@ -0,0 +1,219 @@
#
# ---------- header -----------------------------------------------------------
#
# project kaneton
#
# license kaneton
#
# file /home/enguerrand/...profile/host/linux/ia32.mips64/mips64.py
#
# created julien quintard [tue may 8 13:20:21 2007]
# updated enguerrand raymond [fri apr 17 20:59:36 2009]
#
#
# ---------- information ------------------------------------------------------
#
# this file implements the remaining functions of the kaneton python interface.
#
# note that the host profile already provides many functions. these
# functions can be overriden but you will probably just use them.
#
# in addition, the host profile already imports some packages.
#
#
# ---------- python path ------------------------------------------------------
#
pythonpath = os.getenv("PYTHONPATH")
if not pythonpath:
pythonpath = ""
os.putenv("PYTHONPATH", pythonpath + ":" + _PYTHON_INCLUDE_DIR_)
#
# ---------- functions --------------------------------------------------------
#
#
# colorize()
#
# this function returns a colorized text if the environment is configured
# to or simply the original text.
#
# note that this function implementation is based on UNIX escape sequences.
#
def colorize(text, color, options):
if _DISPLAY_ == _DISPLAY_UNCOLORED_:
return text
if options & OPTION_FLICKERING:
text = "" + text + ""
if color == COLOR_BLACK:
text = "" + text + ""
elif color == COLOR_RED:
text = "" + text + ""
elif color == COLOR_GREEN:
text = "" + text + ""
elif color == COLOR_YELLOW:
text = "" + text + ""
elif color == COLOR_BLUE:
text = "" + text + ""
elif color == COLOR_MAGENTA:
text = "" + text + ""
elif color == COLOR_CYAN:
text = "" + text + ""
elif color == COLOR_WHITE:
text = "" + text + ""
return text
#
# launch()
#
# this function launch a new program/script/make etc.
#
def launch(file, arguments, options):
directory = None
info = None
status = 0
wd = None
info = os.path.split(file)
directory = info[0]
file = info[1]
if directory:
wd = cwd(OPTION_NONE)
cd(directory, OPTION_NONE)
if re.match("^.*\.sh$", file):
status = os.system(_SHELL_ + " " + file + " " + arguments)
elif re.match("^.*\.py$", file):
status = os.system(_PYTHON_ + " " + file + " " + arguments)
elif re.match("^.*\.pl$", file):
status = os.system(_PERL_ + " " + file + " " + arguments)
elif re.match("^Makefile$", file):
status = os.system(_MAKE_ + " -f " + file + " " + arguments)
else:
status = os.system(file + " " + arguments)
if directory:
cd(wd, OPTION_NONE)
return status
#
# pack()
#
# this function creates an archive of the given directory.
#
def pack(directory, file, options):
launch(_TAR_, "-cjf " + file + " " + directory, OPTION_NONE)
#
# unpack()
#
# this function unpackages an archive into the given (optional) directory.
#
def unpack(file, directory, options):
if directory:
launch(_TAR_, "-xjf " + file + " -C " + directory, OPTION_NONE)
else:
launch(_TAR_, "-xjf " + file, OPTION_NONE)
#
# load()
#
# this function copies a file on a device, this device can be virtual:
# an image.
#
def load(file, device, path, options):
if options == OPTION_DEVICE:
launch(_MCOPY_, "-o -n " + file + " " + device + path, OPTION_NONE)
if options == OPTION_IMAGE:
launch(_MCOPY_, "-o -n " + "-i" + device + " " +
file + " ::" + path, OPTION_NONE)
#
# record()
#
# this function runs the program recording a session.
#
def record(transcript, options):
directory = None
time = None
log = None
tmp = None
wd = None
tmp = temporary(OPTION_DIRECTORY)
directory = tmp + "/" + "transcript"
log = directory + "/" + "log"
time = directory + "/" + "time"
mkdir(directory, OPTION_NONE)
launch(_SCRIPT_, "-q -t " + log + " -c " +
_TRANSCRIPT_CMD_ + " 2> " + time, OPTION_NONE)
wd = cwd(OPTION_NONE)
cd(tmp, OPTION_NONE)
pack("transcript", wd + "/" + transcript, OPTION_NONE)
cd(wd, OPTION_NONE)
remove(tmp, OPTION_NONE)
#
# play()
#
# this function runs the program replaying a session.
#
def play(transcript, options):
directory = None
time = None
log = None
tmp = None
wd = None
tmp = temporary(OPTION_DIRECTORY)
log = tmp + "/" + "transcript/log"
time = tmp + "/" + "transcript/time"
unpack(transcript, tmp, OPTION_NONE)
launch(_SCRIPTREPLAY_TOOL_, time + " " + log, OPTION_NONE)
remove(tmp, OPTION_NONE)
#
# locate()
#
# this function tries to locate a program on the system.
#
def locate(file, options):
return launch(_WHICH_, file + " 1>/dev/null 2>/dev/null", OPTION_NONE)

View file

@ -0,0 +1,48 @@
#
# ---------- header -----------------------------------------------------------
#
# project kaneton
#
# license kaneton
#
# file /home/enguerrand/...t/profile/host/linux/ia32.mips64/util.py
#
# created enguerrand raymond [fri apr 17 20:59:04 2009]
# updated enguerrand raymond [fri apr 17 21:00:47 2009]
#
#
# ---------- information ------------------------------------------------------
#
# this file implements some useful functions used for mips compilation, build
# and installation.
#
#
# binary_extract()
#
# this function extracts given sections (section names separate by space)
# from elf to put in binary
#
def binary_extract(elf, sections, binary):
section_list = sections.split()
cmd_option = "-S"
for section in section_list:
cmd_option += " -j " + section
cmd_option += " --output-target binary " + elf + " " + binary
launch(_OBJCOPY_, cmd_option, "")
#
# concat_file()
#
# this function concatenates file a the result file end
#
def concat_file(file, result):
os.system(_CAT_ + " " + file + " >> " + result)