mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-25 17:27:01 +00:00
Initial simulation platform for the arm-qemu-armv7a target.
This commit is contained in:
1
packages/platforms/qemu/Makefile
Normal file
1
packages/platforms/qemu/Makefile
Normal file
@@ -0,0 +1 @@
|
||||
include $(ONL)/make/pkg.mk
|
||||
1
packages/platforms/qemu/arm/Makefile
Normal file
1
packages/platforms/qemu/arm/Makefile
Normal file
@@ -0,0 +1 @@
|
||||
include $(ONL)/make/pkg.mk
|
||||
2
packages/platforms/qemu/arm/arm-qemu-armv7a/.gitignore
vendored
Normal file
2
packages/platforms/qemu/arm/arm-qemu-armv7a/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*x86*64*cel*redstone*xp*.mk
|
||||
onlpdump.mk
|
||||
1
packages/platforms/qemu/arm/arm-qemu-armv7a/Makefile
Normal file
1
packages/platforms/qemu/arm/arm-qemu-armv7a/Makefile
Normal file
@@ -0,0 +1 @@
|
||||
include $(ONL)/make/pkg.mk
|
||||
@@ -0,0 +1 @@
|
||||
include $(ONL)/make/pkg.mk
|
||||
1
packages/platforms/qemu/arm/arm-qemu-armv7a/onlp/PKG.yml
Normal file
1
packages/platforms/qemu/arm/arm-qemu-armv7a/onlp/PKG.yml
Normal file
@@ -0,0 +1 @@
|
||||
!include $ONL_TEMPLATES/onlp-platform-any.yml PLATFORM=arm-qemu-armv7a ARCH=armel TOOLCHAIN=arm-linux-gnueabi
|
||||
@@ -0,0 +1,2 @@
|
||||
FILTER=src
|
||||
include $(ONL)/make/subdirs.mk
|
||||
@@ -0,0 +1,44 @@
|
||||
############################################################
|
||||
# <bsn.cl fy=2014 v=onl>
|
||||
#
|
||||
# Copyright 2014 BigSwitch Networks, Inc.
|
||||
#
|
||||
# Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.eclipse.org/legal/epl-v10.html
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
# either express or implied. See the License for the specific
|
||||
# language governing permissions and limitations under the
|
||||
# License.
|
||||
#
|
||||
# </bsn.cl>
|
||||
############################################################
|
||||
#
|
||||
#
|
||||
############################################################
|
||||
include $(ONL)/make/config.armel.mk
|
||||
|
||||
MODULE := libonlp-arm-qemu-armv7a
|
||||
include $(BUILDER)/standardinit.mk
|
||||
|
||||
DEPENDMODULES := AIM IOF arm_qemu_armv7a onlplib
|
||||
DEPENDMODULE_HEADERS := sff
|
||||
|
||||
include $(BUILDER)/dependmodules.mk
|
||||
|
||||
SHAREDLIB := libonlp-arm-qemu-armv7a.so
|
||||
$(SHAREDLIB)_TARGETS := $(ALL_TARGETS)
|
||||
include $(BUILDER)/so.mk
|
||||
.DEFAULT_GOAL := $(SHAREDLIB)
|
||||
|
||||
GLOBAL_CFLAGS += -I$(onlp_BASEDIR)/module/inc
|
||||
GLOBAL_CFLAGS += -DAIM_CONFIG_INCLUDE_MODULES_INIT=1
|
||||
GLOBAL_CFLAGS += -fPIC
|
||||
GLOBAL_LINK_LIBS += -lpthread
|
||||
|
||||
include $(BUILDER)/targets.mk
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Inclusive Makefile for the arm_qemu_armv7a module.
|
||||
#
|
||||
# Autogenerated 2016-03-31 14:50:33.145280
|
||||
#
|
||||
###############################################################################
|
||||
arm_qemu_armv7a_BASEDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Inclusive Makefile for the libonlp-arm-qemu-armv7a module.
|
||||
#
|
||||
# Autogenerated 2016-03-31 14:50:19.497986
|
||||
#
|
||||
###############################################################################
|
||||
libonlp-arm-qemu-armv7a_BASEDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
############################################################
|
||||
# <bsn.cl fy=2014 v=onl>
|
||||
#
|
||||
# Copyright 2014 BigSwitch Networks, Inc.
|
||||
#
|
||||
# Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.eclipse.org/legal/epl-v10.html
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
# either express or implied. See the License for the specific
|
||||
# language governing permissions and limitations under the
|
||||
# License.
|
||||
#
|
||||
# </bsn.cl>
|
||||
############################################################
|
||||
#
|
||||
#
|
||||
#
|
||||
############################################################
|
||||
include $(ONL)/make/config.armel.mk
|
||||
|
||||
.DEFAULT_GOAL := onlpdump
|
||||
|
||||
MODULE := onlpdump
|
||||
include $(BUILDER)/standardinit.mk
|
||||
|
||||
DEPENDMODULES := AIM IOF onlp arm_qemu_armv7a onlplib onlp_platform_defaults sff cjson cjson_util timer_wheel OS
|
||||
|
||||
include $(BUILDER)/dependmodules.mk
|
||||
|
||||
BINARY := onlpdump
|
||||
$(BINARY)_LIBRARIES := $(LIBRARY_TARGETS)
|
||||
include $(BUILDER)/bin.mk
|
||||
|
||||
GLOBAL_CFLAGS += -DAIM_CONFIG_AIM_MAIN_FUNCTION=onlpdump_main
|
||||
GLOBAL_CFLAGS += -DAIM_CONFIG_INCLUDE_MODULES_INIT=1
|
||||
GLOBAL_CFLAGS += -DAIM_CONFIG_INCLUDE_MAIN=1
|
||||
GLOBAL_LINK_LIBS += -lpthread -lm
|
||||
|
||||
include $(BUILDER)/targets.mk
|
||||
2
packages/platforms/qemu/arm/arm-qemu-armv7a/onlp/builds/src/arm_qemu_armv7a/.gitignore
vendored
Normal file
2
packages/platforms/qemu/arm/arm-qemu-armv7a/onlp/builds/src/arm_qemu_armv7a/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/arm_qemu_armv7a.mk
|
||||
/doc
|
||||
@@ -0,0 +1,28 @@
|
||||
############################################################
|
||||
# <bsn.cl fy=2014 v=onl>
|
||||
#
|
||||
# Copyright 2014, 2015 Big Switch Networks, Inc.
|
||||
#
|
||||
# Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.eclipse.org/legal/epl-v10.html
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
# either express or implied. See the License for the specific
|
||||
# language governing permissions and limitations under the
|
||||
# License.
|
||||
#
|
||||
# </bsn.cl>
|
||||
############################################################
|
||||
#
|
||||
#
|
||||
#
|
||||
############################################################
|
||||
include $(ONL)/make/config.mk
|
||||
MODULE := arm_qemu_armv7a
|
||||
AUTOMODULE := arm_qemu_armv7a
|
||||
include $(BUILDER)/definemodule.mk
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,68 @@
|
||||
############################################################
|
||||
# <bsn.cl fy=2014 v=onl>
|
||||
#
|
||||
# Copyright 2014, 2015 Big Switch Networks, Inc.
|
||||
#
|
||||
# Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.eclipse.org/legal/epl-v10.html
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
# either express or implied. See the License for the specific
|
||||
# language governing permissions and limitations under the
|
||||
# License.
|
||||
#
|
||||
# </bsn.cl>
|
||||
############################################################
|
||||
#
|
||||
# arm_qemu_armv7a Autogeneration Definitions.
|
||||
#
|
||||
############################################################
|
||||
|
||||
cdefs: &cdefs
|
||||
- ONLPSIM_CONFIG_INCLUDE_LOGGING:
|
||||
doc: "Include or exclude logging."
|
||||
default: 1
|
||||
- ONLPSIM_CONFIG_LOG_OPTIONS_DEFAULT:
|
||||
doc: "Default enabled log options."
|
||||
default: AIM_LOG_OPTIONS_DEFAULT
|
||||
- ONLPSIM_CONFIG_LOG_BITS_DEFAULT:
|
||||
doc: "Default enabled log bits."
|
||||
default: AIM_LOG_BITS_DEFAULT
|
||||
- ONLPSIM_CONFIG_LOG_CUSTOM_BITS_DEFAULT:
|
||||
doc: "Default enabled custom log bits."
|
||||
default: 0
|
||||
- ONLPSIM_CONFIG_PORTING_STDLIB:
|
||||
doc: "Default all porting macros to use the C standard libraries."
|
||||
default: 1
|
||||
- ONLPSIM_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS:
|
||||
doc: "Include standard library headers for stdlib porting macros."
|
||||
default: ONLPSIM_CONFIG_PORTING_STDLIB
|
||||
- ONLPSIM_CONFIG_INCLUDE_UCLI:
|
||||
doc: "Include generic uCli support."
|
||||
default: 0
|
||||
- ONLPSIM_CONFIG_SFP_COUNT:
|
||||
doc: "SFP Count."
|
||||
default: 0
|
||||
|
||||
definitions:
|
||||
cdefs:
|
||||
ONLPSIM_CONFIG_HEADER:
|
||||
defs: *cdefs
|
||||
basename: arm_qemu_armv7a_config
|
||||
|
||||
portingmacro:
|
||||
ONLPSIM:
|
||||
macros:
|
||||
- malloc
|
||||
- free
|
||||
- memset
|
||||
- memcpy
|
||||
- strncpy
|
||||
- vsnprintf
|
||||
- snprintf
|
||||
- strlen
|
||||
@@ -0,0 +1,29 @@
|
||||
############################################################
|
||||
# <bsn.cl fy=2014 v=onl>
|
||||
#
|
||||
# Copyright 2014, 2015 Big Switch Networks, Inc.
|
||||
#
|
||||
# Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.eclipse.org/legal/epl-v10.html
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
# either express or implied. See the License for the specific
|
||||
# language governing permissions and limitations under the
|
||||
# License.
|
||||
#
|
||||
# </bsn.cl>
|
||||
############################################################
|
||||
#
|
||||
# arm_qemu_armv7a Autogeneration
|
||||
#
|
||||
############################################################
|
||||
|
||||
arm_qemu_armv7a_AUTO_DEFS := module/auto/arm_qemu_armv7a.yml
|
||||
arm_qemu_armv7a_AUTO_DIRS := module/inc/arm_qemu_armv7a module/src
|
||||
include $(BUILDER)/auto.mk
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
/************************************************************
|
||||
* <bsn.cl fy=2014 v=onl>
|
||||
*
|
||||
* Copyright 2014, 2015 Big Switch Networks, Inc.
|
||||
*
|
||||
* Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*
|
||||
* </bsn.cl>
|
||||
************************************************************
|
||||
*
|
||||
*
|
||||
*
|
||||
***********************************************************/
|
||||
|
||||
#include <arm_qemu_armv7a/arm_qemu_armv7a_config.h>
|
||||
|
||||
/* <--auto.start.xmacro(ALL).define> */
|
||||
/* <auto.end.xmacro(ALL).define> */
|
||||
|
||||
/* <--auto.start.xenum(ALL).define> */
|
||||
/* <auto.end.xenum(ALL).define> */
|
||||
|
||||
|
||||
@@ -0,0 +1,162 @@
|
||||
/************************************************************
|
||||
* <bsn.cl fy=2014 v=onl>
|
||||
*
|
||||
* Copyright 2014, 2015 Big Switch Networks, Inc.
|
||||
*
|
||||
* Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*
|
||||
* </bsn.cl>
|
||||
************************************************************
|
||||
*
|
||||
*
|
||||
*
|
||||
***********************************************************/
|
||||
|
||||
/**************************************************************************//**
|
||||
*
|
||||
* @file
|
||||
* @brief arm_qemu_armv7a Configuration Header
|
||||
*
|
||||
* @addtogroup arm_qemu_armv7a-config
|
||||
* @{
|
||||
*
|
||||
*****************************************************************************/
|
||||
#ifndef __ONLPSIM_CONFIG_H__
|
||||
#define __ONLPSIM_CONFIG_H__
|
||||
|
||||
#ifdef GLOBAL_INCLUDE_CUSTOM_CONFIG
|
||||
#include <global_custom_config.h>
|
||||
#endif
|
||||
#ifdef ONLPSIM_INCLUDE_CUSTOM_CONFIG
|
||||
#include <arm_qemu_armv7a_custom_config.h>
|
||||
#endif
|
||||
|
||||
/* <auto.start.cdefs(ONLPSIM_CONFIG_HEADER).header> */
|
||||
#include <AIM/aim.h>
|
||||
/**
|
||||
* ONLPSIM_CONFIG_INCLUDE_LOGGING
|
||||
*
|
||||
* Include or exclude logging. */
|
||||
|
||||
|
||||
#ifndef ONLPSIM_CONFIG_INCLUDE_LOGGING
|
||||
#define ONLPSIM_CONFIG_INCLUDE_LOGGING 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* ONLPSIM_CONFIG_LOG_OPTIONS_DEFAULT
|
||||
*
|
||||
* Default enabled log options. */
|
||||
|
||||
|
||||
#ifndef ONLPSIM_CONFIG_LOG_OPTIONS_DEFAULT
|
||||
#define ONLPSIM_CONFIG_LOG_OPTIONS_DEFAULT AIM_LOG_OPTIONS_DEFAULT
|
||||
#endif
|
||||
|
||||
/**
|
||||
* ONLPSIM_CONFIG_LOG_BITS_DEFAULT
|
||||
*
|
||||
* Default enabled log bits. */
|
||||
|
||||
|
||||
#ifndef ONLPSIM_CONFIG_LOG_BITS_DEFAULT
|
||||
#define ONLPSIM_CONFIG_LOG_BITS_DEFAULT AIM_LOG_BITS_DEFAULT
|
||||
#endif
|
||||
|
||||
/**
|
||||
* ONLPSIM_CONFIG_LOG_CUSTOM_BITS_DEFAULT
|
||||
*
|
||||
* Default enabled custom log bits. */
|
||||
|
||||
|
||||
#ifndef ONLPSIM_CONFIG_LOG_CUSTOM_BITS_DEFAULT
|
||||
#define ONLPSIM_CONFIG_LOG_CUSTOM_BITS_DEFAULT 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* ONLPSIM_CONFIG_PORTING_STDLIB
|
||||
*
|
||||
* Default all porting macros to use the C standard libraries. */
|
||||
|
||||
|
||||
#ifndef ONLPSIM_CONFIG_PORTING_STDLIB
|
||||
#define ONLPSIM_CONFIG_PORTING_STDLIB 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* ONLPSIM_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS
|
||||
*
|
||||
* Include standard library headers for stdlib porting macros. */
|
||||
|
||||
|
||||
#ifndef ONLPSIM_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS
|
||||
#define ONLPSIM_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS ONLPSIM_CONFIG_PORTING_STDLIB
|
||||
#endif
|
||||
|
||||
/**
|
||||
* ONLPSIM_CONFIG_INCLUDE_UCLI
|
||||
*
|
||||
* Include generic uCli support. */
|
||||
|
||||
|
||||
#ifndef ONLPSIM_CONFIG_INCLUDE_UCLI
|
||||
#define ONLPSIM_CONFIG_INCLUDE_UCLI 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* ONLPSIM_CONFIG_SFP_COUNT
|
||||
*
|
||||
* SFP Count. */
|
||||
|
||||
|
||||
#ifndef ONLPSIM_CONFIG_SFP_COUNT
|
||||
#define ONLPSIM_CONFIG_SFP_COUNT 0
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* All compile time options can be queried or displayed
|
||||
*/
|
||||
|
||||
/** Configuration settings structure. */
|
||||
typedef struct arm_qemu_armv7a_config_settings_s {
|
||||
/** name */
|
||||
const char* name;
|
||||
/** value */
|
||||
const char* value;
|
||||
} arm_qemu_armv7a_config_settings_t;
|
||||
|
||||
/** Configuration settings table. */
|
||||
/** arm_qemu_armv7a_config_settings table. */
|
||||
extern arm_qemu_armv7a_config_settings_t arm_qemu_armv7a_config_settings[];
|
||||
|
||||
/**
|
||||
* @brief Lookup a configuration setting.
|
||||
* @param setting The name of the configuration option to lookup.
|
||||
*/
|
||||
const char* arm_qemu_armv7a_config_lookup(const char* setting);
|
||||
|
||||
/**
|
||||
* @brief Show the compile-time configuration.
|
||||
* @param pvs The output stream.
|
||||
*/
|
||||
int arm_qemu_armv7a_config_show(struct aim_pvs_s* pvs);
|
||||
|
||||
/* <auto.end.cdefs(ONLPSIM_CONFIG_HEADER).header> */
|
||||
|
||||
#include "arm_qemu_armv7a_porting.h"
|
||||
|
||||
#endif /* __ONLPSIM_CONFIG_H__ */
|
||||
/* @} */
|
||||
@@ -0,0 +1,51 @@
|
||||
/************************************************************
|
||||
* <bsn.cl fy=2014 v=onl>
|
||||
*
|
||||
* Copyright 2014, 2015 Big Switch Networks, Inc.
|
||||
*
|
||||
* Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*
|
||||
* </bsn.cl>
|
||||
************************************************************
|
||||
*
|
||||
*
|
||||
*
|
||||
***********************************************************/
|
||||
|
||||
/********************************************************//**
|
||||
*
|
||||
* arm_qemu_armv7a Doxygen Header
|
||||
*
|
||||
***********************************************************/
|
||||
#ifndef __ONLPSIM_DOX_H__
|
||||
#define __ONLPSIM_DOX_H__
|
||||
|
||||
/**
|
||||
* @defgroup arm_qemu_armv7a arm_qemu_armv7a - onlpsim Description
|
||||
*
|
||||
|
||||
The documentation overview for this module should go here.
|
||||
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @defgroup arm_qemu_armv7a-arm_qemu_armv7a Public Interface
|
||||
* @defgroup arm_qemu_armv7a-config Compile Time Configuration
|
||||
* @defgroup arm_qemu_armv7a-porting Porting Macros
|
||||
*
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
#endif /* __ONLPSIM_DOX_H__ */
|
||||
@@ -0,0 +1,132 @@
|
||||
/************************************************************
|
||||
* <bsn.cl fy=2014 v=onl>
|
||||
*
|
||||
* Copyright 2014, 2015 Big Switch Networks, Inc.
|
||||
*
|
||||
* Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*
|
||||
* </bsn.cl>
|
||||
************************************************************
|
||||
*
|
||||
*
|
||||
*
|
||||
***********************************************************/
|
||||
|
||||
/********************************************************//**
|
||||
*
|
||||
* @file
|
||||
* @brief arm_qemu_armv7a Porting Macros.
|
||||
*
|
||||
* @addtogroup arm_qemu_armv7a-porting
|
||||
* @{
|
||||
*
|
||||
***********************************************************/
|
||||
#ifndef __ONLPSIM_PORTING_H__
|
||||
#define __ONLPSIM_PORTING_H__
|
||||
|
||||
|
||||
/* <auto.start.portingmacro(ALL).define> */
|
||||
#if ONLPSIM_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS == 1
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <memory.h>
|
||||
#endif
|
||||
|
||||
#ifndef ONLPSIM_MALLOC
|
||||
#if defined(GLOBAL_MALLOC)
|
||||
#define ONLPSIM_MALLOC GLOBAL_MALLOC
|
||||
#elif ONLPSIM_CONFIG_PORTING_STDLIB == 1
|
||||
#define ONLPSIM_MALLOC malloc
|
||||
#else
|
||||
#error The macro ONLPSIM_MALLOC is required but cannot be defined.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ONLPSIM_FREE
|
||||
#if defined(GLOBAL_FREE)
|
||||
#define ONLPSIM_FREE GLOBAL_FREE
|
||||
#elif ONLPSIM_CONFIG_PORTING_STDLIB == 1
|
||||
#define ONLPSIM_FREE free
|
||||
#else
|
||||
#error The macro ONLPSIM_FREE is required but cannot be defined.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ONLPSIM_MEMSET
|
||||
#if defined(GLOBAL_MEMSET)
|
||||
#define ONLPSIM_MEMSET GLOBAL_MEMSET
|
||||
#elif ONLPSIM_CONFIG_PORTING_STDLIB == 1
|
||||
#define ONLPSIM_MEMSET memset
|
||||
#else
|
||||
#error The macro ONLPSIM_MEMSET is required but cannot be defined.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ONLPSIM_MEMCPY
|
||||
#if defined(GLOBAL_MEMCPY)
|
||||
#define ONLPSIM_MEMCPY GLOBAL_MEMCPY
|
||||
#elif ONLPSIM_CONFIG_PORTING_STDLIB == 1
|
||||
#define ONLPSIM_MEMCPY memcpy
|
||||
#else
|
||||
#error The macro ONLPSIM_MEMCPY is required but cannot be defined.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ONLPSIM_STRNCPY
|
||||
#if defined(GLOBAL_STRNCPY)
|
||||
#define ONLPSIM_STRNCPY GLOBAL_STRNCPY
|
||||
#elif ONLPSIM_CONFIG_PORTING_STDLIB == 1
|
||||
#define ONLPSIM_STRNCPY strncpy
|
||||
#else
|
||||
#error The macro ONLPSIM_STRNCPY is required but cannot be defined.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ONLPSIM_VSNPRINTF
|
||||
#if defined(GLOBAL_VSNPRINTF)
|
||||
#define ONLPSIM_VSNPRINTF GLOBAL_VSNPRINTF
|
||||
#elif ONLPSIM_CONFIG_PORTING_STDLIB == 1
|
||||
#define ONLPSIM_VSNPRINTF vsnprintf
|
||||
#else
|
||||
#error The macro ONLPSIM_VSNPRINTF is required but cannot be defined.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ONLPSIM_SNPRINTF
|
||||
#if defined(GLOBAL_SNPRINTF)
|
||||
#define ONLPSIM_SNPRINTF GLOBAL_SNPRINTF
|
||||
#elif ONLPSIM_CONFIG_PORTING_STDLIB == 1
|
||||
#define ONLPSIM_SNPRINTF snprintf
|
||||
#else
|
||||
#error The macro ONLPSIM_SNPRINTF is required but cannot be defined.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ONLPSIM_STRLEN
|
||||
#if defined(GLOBAL_STRLEN)
|
||||
#define ONLPSIM_STRLEN GLOBAL_STRLEN
|
||||
#elif ONLPSIM_CONFIG_PORTING_STDLIB == 1
|
||||
#define ONLPSIM_STRLEN strlen
|
||||
#else
|
||||
#error The macro ONLPSIM_STRLEN is required but cannot be defined.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* <auto.end.portingmacro(ALL).define> */
|
||||
|
||||
|
||||
#endif /* __ONLPSIM_PORTING_H__ */
|
||||
/* @} */
|
||||
@@ -0,0 +1,29 @@
|
||||
############################################################
|
||||
# <bsn.cl fy=2014 v=onl>
|
||||
#
|
||||
# Copyright 2014, 2015 Big Switch Networks, Inc.
|
||||
#
|
||||
# Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.eclipse.org/legal/epl-v10.html
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
# either express or implied. See the License for the specific
|
||||
# language governing permissions and limitations under the
|
||||
# License.
|
||||
#
|
||||
# </bsn.cl>
|
||||
############################################################
|
||||
#
|
||||
#
|
||||
#
|
||||
############################################################
|
||||
THIS_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||
arm_qemu_armv7a_INCLUDES := -I $(THIS_DIR)inc
|
||||
arm_qemu_armv7a_INTERNAL_INCLUDES := -I $(THIS_DIR)src
|
||||
arm_qemu_armv7a_DEPENDMODULE_ENTRIES := init:arm_qemu_armv7a ucli:arm_qemu_armv7a
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
############################################################
|
||||
# <bsn.cl fy=2014 v=onl>
|
||||
#
|
||||
# Copyright 2014, 2015 Big Switch Networks, Inc.
|
||||
#
|
||||
# Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.eclipse.org/legal/epl-v10.html
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
# either express or implied. See the License for the specific
|
||||
# language governing permissions and limitations under the
|
||||
# License.
|
||||
#
|
||||
# </bsn.cl>
|
||||
############################################################
|
||||
#
|
||||
# Local source generation targets.
|
||||
#
|
||||
############################################################
|
||||
|
||||
include ../../../../init.mk
|
||||
|
||||
ucli:
|
||||
$(SUBMODULE_BIGCODE)/tools/uclihandlers.py arm_qemu_armv7a_ucli.c
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
/************************************************************
|
||||
* <bsn.cl fy=2014 v=onl>
|
||||
*
|
||||
* Copyright 2014, 2015 Big Switch Networks, Inc.
|
||||
*
|
||||
* Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*
|
||||
* </bsn.cl>
|
||||
************************************************************
|
||||
*
|
||||
*
|
||||
*
|
||||
***********************************************************/
|
||||
|
||||
#include <arm_qemu_armv7a/arm_qemu_armv7a_config.h>
|
||||
|
||||
/* <auto.start.cdefs(ONLPSIM_CONFIG_HEADER).source> */
|
||||
#define __arm_qemu_armv7a_config_STRINGIFY_NAME(_x) #_x
|
||||
#define __arm_qemu_armv7a_config_STRINGIFY_VALUE(_x) __arm_qemu_armv7a_config_STRINGIFY_NAME(_x)
|
||||
arm_qemu_armv7a_config_settings_t arm_qemu_armv7a_config_settings[] =
|
||||
{
|
||||
#ifdef ONLPSIM_CONFIG_INCLUDE_LOGGING
|
||||
{ __arm_qemu_armv7a_config_STRINGIFY_NAME(ONLPSIM_CONFIG_INCLUDE_LOGGING), __arm_qemu_armv7a_config_STRINGIFY_VALUE(ONLPSIM_CONFIG_INCLUDE_LOGGING) },
|
||||
#else
|
||||
{ ONLPSIM_CONFIG_INCLUDE_LOGGING(__arm_qemu_armv7a_config_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
#ifdef ONLPSIM_CONFIG_LOG_OPTIONS_DEFAULT
|
||||
{ __arm_qemu_armv7a_config_STRINGIFY_NAME(ONLPSIM_CONFIG_LOG_OPTIONS_DEFAULT), __arm_qemu_armv7a_config_STRINGIFY_VALUE(ONLPSIM_CONFIG_LOG_OPTIONS_DEFAULT) },
|
||||
#else
|
||||
{ ONLPSIM_CONFIG_LOG_OPTIONS_DEFAULT(__arm_qemu_armv7a_config_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
#ifdef ONLPSIM_CONFIG_LOG_BITS_DEFAULT
|
||||
{ __arm_qemu_armv7a_config_STRINGIFY_NAME(ONLPSIM_CONFIG_LOG_BITS_DEFAULT), __arm_qemu_armv7a_config_STRINGIFY_VALUE(ONLPSIM_CONFIG_LOG_BITS_DEFAULT) },
|
||||
#else
|
||||
{ ONLPSIM_CONFIG_LOG_BITS_DEFAULT(__arm_qemu_armv7a_config_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
#ifdef ONLPSIM_CONFIG_LOG_CUSTOM_BITS_DEFAULT
|
||||
{ __arm_qemu_armv7a_config_STRINGIFY_NAME(ONLPSIM_CONFIG_LOG_CUSTOM_BITS_DEFAULT), __arm_qemu_armv7a_config_STRINGIFY_VALUE(ONLPSIM_CONFIG_LOG_CUSTOM_BITS_DEFAULT) },
|
||||
#else
|
||||
{ ONLPSIM_CONFIG_LOG_CUSTOM_BITS_DEFAULT(__arm_qemu_armv7a_config_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
#ifdef ONLPSIM_CONFIG_PORTING_STDLIB
|
||||
{ __arm_qemu_armv7a_config_STRINGIFY_NAME(ONLPSIM_CONFIG_PORTING_STDLIB), __arm_qemu_armv7a_config_STRINGIFY_VALUE(ONLPSIM_CONFIG_PORTING_STDLIB) },
|
||||
#else
|
||||
{ ONLPSIM_CONFIG_PORTING_STDLIB(__arm_qemu_armv7a_config_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
#ifdef ONLPSIM_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS
|
||||
{ __arm_qemu_armv7a_config_STRINGIFY_NAME(ONLPSIM_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS), __arm_qemu_armv7a_config_STRINGIFY_VALUE(ONLPSIM_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS) },
|
||||
#else
|
||||
{ ONLPSIM_CONFIG_PORTING_INCLUDE_STDLIB_HEADERS(__arm_qemu_armv7a_config_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
#ifdef ONLPSIM_CONFIG_INCLUDE_UCLI
|
||||
{ __arm_qemu_armv7a_config_STRINGIFY_NAME(ONLPSIM_CONFIG_INCLUDE_UCLI), __arm_qemu_armv7a_config_STRINGIFY_VALUE(ONLPSIM_CONFIG_INCLUDE_UCLI) },
|
||||
#else
|
||||
{ ONLPSIM_CONFIG_INCLUDE_UCLI(__arm_qemu_armv7a_config_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
#ifdef ONLPSIM_CONFIG_SFP_COUNT
|
||||
{ __arm_qemu_armv7a_config_STRINGIFY_NAME(ONLPSIM_CONFIG_SFP_COUNT), __arm_qemu_armv7a_config_STRINGIFY_VALUE(ONLPSIM_CONFIG_SFP_COUNT) },
|
||||
#else
|
||||
{ ONLPSIM_CONFIG_SFP_COUNT(__arm_qemu_armv7a_config_STRINGIFY_NAME), "__undefined__" },
|
||||
#endif
|
||||
{ NULL, NULL }
|
||||
};
|
||||
#undef __arm_qemu_armv7a_config_STRINGIFY_VALUE
|
||||
#undef __arm_qemu_armv7a_config_STRINGIFY_NAME
|
||||
|
||||
const char*
|
||||
arm_qemu_armv7a_config_lookup(const char* setting)
|
||||
{
|
||||
int i;
|
||||
for(i = 0; arm_qemu_armv7a_config_settings[i].name; i++) {
|
||||
if(strcmp(arm_qemu_armv7a_config_settings[i].name, setting)) {
|
||||
return arm_qemu_armv7a_config_settings[i].value;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
arm_qemu_armv7a_config_show(struct aim_pvs_s* pvs)
|
||||
{
|
||||
int i;
|
||||
for(i = 0; arm_qemu_armv7a_config_settings[i].name; i++) {
|
||||
aim_printf(pvs, "%s = %s\n", arm_qemu_armv7a_config_settings[i].name, arm_qemu_armv7a_config_settings[i].value);
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
/* <auto.end.cdefs(ONLPSIM_CONFIG_HEADER).source> */
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/************************************************************
|
||||
* <bsn.cl fy=2014 v=onl>
|
||||
*
|
||||
* Copyright 2014, 2015 Big Switch Networks, Inc.
|
||||
*
|
||||
* Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*
|
||||
* </bsn.cl>
|
||||
************************************************************
|
||||
*
|
||||
*
|
||||
*
|
||||
***********************************************************/
|
||||
|
||||
#include <arm_qemu_armv7a/arm_qemu_armv7a_config.h>
|
||||
|
||||
/* <--auto.start.enum(ALL).source> */
|
||||
/* <auto.end.enum(ALL).source> */
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/************************************************************
|
||||
* <bsn.cl fy=2014 v=onl>
|
||||
*
|
||||
* Copyright 2014, 2015 Big Switch Networks, Inc.
|
||||
*
|
||||
* Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*
|
||||
* </bsn.cl>
|
||||
************************************************************
|
||||
*
|
||||
*
|
||||
*
|
||||
***********************************************************/
|
||||
|
||||
#ifndef __ONLPSIM_INT_H__
|
||||
#define __ONLPSIM_INT_H__
|
||||
|
||||
#include <arm_qemu_armv7a/arm_qemu_armv7a_config.h>
|
||||
|
||||
|
||||
#endif /* __ONLPSIM_INT_H__ */
|
||||
@@ -0,0 +1,38 @@
|
||||
/************************************************************
|
||||
* <bsn.cl fy=2014 v=onl>
|
||||
*
|
||||
* Copyright 2014, 2015 Big Switch Networks, Inc.
|
||||
*
|
||||
* Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*
|
||||
* </bsn.cl>
|
||||
************************************************************
|
||||
*
|
||||
*
|
||||
*
|
||||
***********************************************************/
|
||||
|
||||
#include <arm_qemu_armv7a/arm_qemu_armv7a_config.h>
|
||||
|
||||
#include "arm_qemu_armv7a_log.h"
|
||||
/*
|
||||
* arm_qemu_armv7a log struct.
|
||||
*/
|
||||
AIM_LOG_STRUCT_DEFINE(
|
||||
ONLPSIM_CONFIG_LOG_OPTIONS_DEFAULT,
|
||||
ONLPSIM_CONFIG_LOG_BITS_DEFAULT,
|
||||
NULL, /* Custom log map */
|
||||
ONLPSIM_CONFIG_LOG_CUSTOM_BITS_DEFAULT
|
||||
);
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/************************************************************
|
||||
* <bsn.cl fy=2014 v=onl>
|
||||
*
|
||||
* Copyright 2014, 2015 Big Switch Networks, Inc.
|
||||
*
|
||||
* Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*
|
||||
* </bsn.cl>
|
||||
************************************************************
|
||||
*
|
||||
*
|
||||
*
|
||||
***********************************************************/
|
||||
|
||||
#ifndef __ONLPSIM_LOG_H__
|
||||
#define __ONLPSIM_LOG_H__
|
||||
|
||||
#define AIM_LOG_MODULE_NAME arm_qemu_armv7a
|
||||
#include <AIM/aim_log.h>
|
||||
|
||||
#endif /* __ONLPSIM_LOG_H__ */
|
||||
@@ -0,0 +1,44 @@
|
||||
/************************************************************
|
||||
* <bsn.cl fy=2014 v=onl>
|
||||
*
|
||||
* Copyright 2014, 2015 Big Switch Networks, Inc.
|
||||
*
|
||||
* Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*
|
||||
* </bsn.cl>
|
||||
************************************************************
|
||||
*
|
||||
*
|
||||
*
|
||||
***********************************************************/
|
||||
|
||||
#include <arm_qemu_armv7a/arm_qemu_armv7a_config.h>
|
||||
|
||||
#include "arm_qemu_armv7a_log.h"
|
||||
|
||||
static int
|
||||
datatypes_init__(void)
|
||||
{
|
||||
#define ONLPSIM_ENUMERATION_ENTRY(_enum_name, _desc) AIM_DATATYPE_MAP_REGISTER(_enum_name, _enum_name##_map, _desc, AIM_LOG_INTERNAL);
|
||||
#include <arm_qemu_armv7a/arm_qemu_armv7a.x>
|
||||
return 0;
|
||||
}
|
||||
|
||||
void __arm_qemu_armv7a_module_init__(void)
|
||||
{
|
||||
AIM_LOG_STRUCT_REGISTER();
|
||||
datatypes_init__();
|
||||
}
|
||||
|
||||
int __onlp_platform_version__ = 1;
|
||||
@@ -0,0 +1,82 @@
|
||||
/************************************************************
|
||||
* <bsn.cl fy=2014 v=onl>
|
||||
*
|
||||
* Copyright 2014, 2015 Big Switch Networks, Inc.
|
||||
*
|
||||
* Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*
|
||||
* </bsn.cl>
|
||||
************************************************************
|
||||
*
|
||||
*
|
||||
*
|
||||
***********************************************************/
|
||||
|
||||
#include <arm_qemu_armv7a/arm_qemu_armv7a_config.h>
|
||||
|
||||
#if ONLPSIM_CONFIG_INCLUDE_UCLI == 1
|
||||
|
||||
#include <uCli/ucli.h>
|
||||
#include <uCli/ucli_argparse.h>
|
||||
#include <uCli/ucli_handler_macros.h>
|
||||
|
||||
static ucli_status_t
|
||||
arm_qemu_armv7a_ucli_ucli__config__(ucli_context_t* uc)
|
||||
{
|
||||
UCLI_HANDLER_MACRO_MODULE_CONFIG(arm_qemu_armv7a)
|
||||
}
|
||||
|
||||
/* <auto.ucli.handlers.start> */
|
||||
/******************************************************************************
|
||||
*
|
||||
* These handler table(s) were autogenerated from the symbols in this
|
||||
* source file.
|
||||
*
|
||||
*****************************************************************************/
|
||||
static ucli_command_handler_f arm_qemu_armv7a_ucli_ucli_handlers__[] =
|
||||
{
|
||||
arm_qemu_armv7a_ucli_ucli__config__,
|
||||
NULL
|
||||
};
|
||||
/******************************************************************************/
|
||||
/* <auto.ucli.handlers.end> */
|
||||
|
||||
static ucli_module_t
|
||||
arm_qemu_armv7a_ucli_module__ =
|
||||
{
|
||||
"arm_qemu_armv7a_ucli",
|
||||
NULL,
|
||||
arm_qemu_armv7a_ucli_ucli_handlers__,
|
||||
NULL,
|
||||
NULL,
|
||||
};
|
||||
|
||||
ucli_node_t*
|
||||
arm_qemu_armv7a_ucli_node_create(void)
|
||||
{
|
||||
ucli_node_t* n;
|
||||
ucli_module_init(&arm_qemu_armv7a_ucli_module__);
|
||||
n = ucli_node_create("arm_qemu_armv7a", NULL, &arm_qemu_armv7a_ucli_module__);
|
||||
ucli_node_subnode_add(n, ucli_module_log_node_create("arm_qemu_armv7a"));
|
||||
return n;
|
||||
}
|
||||
|
||||
#else
|
||||
void*
|
||||
arm_qemu_armv7a_ucli_node_create(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/************************************************************
|
||||
* <bsn.cl fy=2014 v=onl>
|
||||
*
|
||||
* Copyright 2014, 2015 Big Switch Networks, Inc.
|
||||
*
|
||||
* Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*
|
||||
* </bsn.cl>
|
||||
************************************************************
|
||||
*
|
||||
* Fan Platform Implementation Defaults.
|
||||
*
|
||||
***********************************************************/
|
||||
#include <onlp/platformi/fani.h>
|
||||
#include "arm_qemu_armv7a_int.h"
|
||||
|
||||
/*
|
||||
* This function will be called prior to all of onlp_fani_* functions.
|
||||
*/
|
||||
int
|
||||
onlp_fani_init(void)
|
||||
{
|
||||
return ONLP_STATUS_OK;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/************************************************************
|
||||
* <bsn.cl fy=2014 v=onl>
|
||||
*
|
||||
* Copyright 2014, 2015 Big Switch Networks, Inc.
|
||||
*
|
||||
* Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*
|
||||
* </bsn.cl>
|
||||
************************************************************
|
||||
*
|
||||
*
|
||||
***********************************************************/
|
||||
#include <onlp/platformi/ledi.h>
|
||||
#include "arm_qemu_armv7a_int.h"
|
||||
|
||||
int
|
||||
onlp_ledi_init(void)
|
||||
{
|
||||
return ONLP_STATUS_OK;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
############################################################
|
||||
# <bsn.cl fy=2014 v=onl>
|
||||
#
|
||||
# Copyright 2014, 2015 Big Switch Networks, Inc.
|
||||
#
|
||||
# Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.eclipse.org/legal/epl-v10.html
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
# either express or implied. See the License for the specific
|
||||
# language governing permissions and limitations under the
|
||||
# License.
|
||||
#
|
||||
# </bsn.cl>
|
||||
############################################################
|
||||
#
|
||||
#
|
||||
#
|
||||
############################################################
|
||||
|
||||
LIBRARY := arm_qemu_armv7a
|
||||
$(LIBRARY)_SUBDIR := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||
#$(LIBRARY)_LAST := 1
|
||||
include $(BUILDER)/lib.mk
|
||||
@@ -0,0 +1,32 @@
|
||||
/************************************************************
|
||||
* <bsn.cl fy=2014 v=onl>
|
||||
*
|
||||
* Copyright 2014, 2015 Big Switch Networks, Inc.
|
||||
*
|
||||
* Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*
|
||||
* </bsn.cl>
|
||||
************************************************************
|
||||
*
|
||||
*
|
||||
*
|
||||
***********************************************************/
|
||||
#include <onlp/platformi/psui.h>
|
||||
#include "arm_qemu_armv7a_int.h"
|
||||
|
||||
int
|
||||
onlp_psui_init(void)
|
||||
{
|
||||
return ONLP_STATUS_OK;
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/************************************************************
|
||||
* <bsn.cl fy=2014 v=onl>
|
||||
*
|
||||
* Copyright 2014, 2015 Big Switch Networks, Inc.
|
||||
*
|
||||
* Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*
|
||||
* </bsn.cl>
|
||||
************************************************************
|
||||
*
|
||||
*
|
||||
***********************************************************/
|
||||
#include <onlp/platformi/sfpi.h>
|
||||
#include <arm_qemu_armv7a/arm_qemu_armv7a_config.h>
|
||||
#include "arm_qemu_armv7a_log.h"
|
||||
|
||||
static int sfp_count__ = ONLPSIM_CONFIG_SFP_COUNT;
|
||||
|
||||
int
|
||||
onlp_sfpi_init(void)
|
||||
{
|
||||
return ONLP_STATUS_OK;
|
||||
}
|
||||
|
||||
int
|
||||
onlp_sfpi_bitmap_get(onlp_sfp_bitmap_t* bmap)
|
||||
{
|
||||
int p;
|
||||
for(p = 0; p < sfp_count__; p++) {
|
||||
AIM_BITMAP_SET(bmap, p);
|
||||
}
|
||||
return ONLP_STATUS_OK;
|
||||
}
|
||||
|
||||
int
|
||||
onlp_sfpi_is_present(int port)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
onlp_sfpi_presence_bitmap_get(onlp_sfp_bitmap_t* dst)
|
||||
{
|
||||
AIM_BITMAP_CLR_ALL(dst);
|
||||
return ONLP_STATUS_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* This function reads the SFPs idrom and returns in
|
||||
* in the data buffer provided.
|
||||
*/
|
||||
int
|
||||
onlp_sfpi_eeprom_read(int port, uint8_t data[256])
|
||||
{
|
||||
return ONLP_STATUS_E_MISSING;
|
||||
}
|
||||
|
||||
/*
|
||||
* De-initialize the SFPI subsystem.
|
||||
*/
|
||||
int
|
||||
onlp_sfpi_denit(void)
|
||||
{
|
||||
return ONLP_STATUS_OK;
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
/************************************************************
|
||||
* <bsn.cl fy=2014 v=onl>
|
||||
*
|
||||
* Copyright 2014, 2015 Big Switch Networks, Inc.
|
||||
*
|
||||
* Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*
|
||||
* </bsn.cl>
|
||||
************************************************************
|
||||
*
|
||||
*
|
||||
*
|
||||
***********************************************************/
|
||||
#include <onlp/platformi/sysi.h>
|
||||
#include <onlplib/crc32.h>
|
||||
#include "arm_qemu_armv7a_log.h"
|
||||
|
||||
const char*
|
||||
onlp_sysi_platform_get(void)
|
||||
{
|
||||
return "arm-qemu-armv7a-r0";
|
||||
}
|
||||
|
||||
int
|
||||
onlp_sysi_init(void)
|
||||
{
|
||||
return ONLP_STATUS_OK;
|
||||
}
|
||||
|
||||
int
|
||||
onlp_sysi_onie_data_get(uint8_t** data, int* size)
|
||||
{
|
||||
static uint8_t onie_data[] = {
|
||||
'T', 'l', 'v','I','n','f','o', 0,
|
||||
0x1, 0x0, 0x0,
|
||||
0x21, 0x8, 'O', 'N', 'L', 'S', 'I', 'M', 0, 0,
|
||||
0x22, 0x3, 'O', 'N', 'L',
|
||||
0xFE, 0x4, 0x2f, 0x52, 0x8f, 0xda,
|
||||
};
|
||||
|
||||
if(onie_data[9] == 0 && onie_data[10] == 0) {
|
||||
int len = sizeof(onie_data);
|
||||
len -= 11;
|
||||
onie_data[9] = (len & 0xFF00) >> 8;
|
||||
onie_data[10] = (len & 0xFF);
|
||||
}
|
||||
|
||||
*data = onie_data;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
onlp_sysi_onie_data_free(uint8_t* data)
|
||||
{
|
||||
/*
|
||||
* We returned a static array in onlp_sysi_onie_data_get()
|
||||
* so no free operation is required.
|
||||
*/
|
||||
}
|
||||
|
||||
void
|
||||
onlp_sysi_platform_manage(void)
|
||||
{
|
||||
}
|
||||
|
||||
int
|
||||
onlp_sysi_oids_get(onlp_oid_t* table, int max)
|
||||
{
|
||||
memset(table, 0, max*sizeof(onlp_oid_t));
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/************************************************************
|
||||
* <bsn.cl fy=2014 v=onl>
|
||||
*
|
||||
* Copyright 2014, 2015 Big Switch Networks, Inc.
|
||||
*
|
||||
* Licensed under the Eclipse Public License, Version 1.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*
|
||||
* </bsn.cl>
|
||||
************************************************************
|
||||
*
|
||||
* Thermal Sensor Platform Implementation.
|
||||
*
|
||||
***********************************************************/
|
||||
#include <onlp/platformi/thermali.h>
|
||||
#include "arm_qemu_armv7a_log.h"
|
||||
|
||||
int
|
||||
onlp_thermali_init(void)
|
||||
{
|
||||
return ONLP_STATUS_OK;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
include $(ONL)/make/pkg.mk
|
||||
@@ -0,0 +1 @@
|
||||
include $(ONL)/make/pkg.mk
|
||||
@@ -0,0 +1 @@
|
||||
!include $ONL_TEMPLATES/platform-config-platform.yml ARCH=armel VENDOR=qemu PLATFORM=arm-qemu-armv7a-r0
|
||||
@@ -0,0 +1,11 @@
|
||||
echo "pci0000:00/0000:00:03.0 ma1" >/etc/onl/net
|
||||
|
||||
cp /dev/null /etc/onl/mounts
|
||||
echo "block/sda sda flash" >> /etc/onl/mounts
|
||||
echo "block/vda vda flash" >> /etc/onl/mounts
|
||||
echo "LABEL=FLASH * flash" >> /etc/onl/mounts
|
||||
|
||||
echo "block/sdb sdb flash2" >> /etc/onl/mounts
|
||||
echo "block/vdb vdb flash2" >> /etc/onl/mounts
|
||||
echo "LABEL=FLASH2 * flash2" >> /etc/onl/mounts
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
############################################################
|
||||
# <bsn.cl fy=2013 v=none>
|
||||
#
|
||||
# Copyright 2013, 2014 BigSwitch Networks, Inc.
|
||||
#
|
||||
#
|
||||
#
|
||||
# </bsn.cl>
|
||||
############################################################
|
||||
# Platform data goes here.
|
||||
|
||||
platform_installer() {
|
||||
# Standard isntallation to an available GPT partition
|
||||
installer_standard_gpt_install /dev/sda
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
from onl.platform.base import *
|
||||
from onl.platform.qemu import *
|
||||
|
||||
class OnlPlatform_arm_qemu_armv7a_r0(OnlPlatformQEMU):
|
||||
|
||||
def model(self):
|
||||
return "QEMU ARMv7a"
|
||||
|
||||
def platform(self):
|
||||
return "arm-qemu-armv7a"
|
||||
|
||||
def sys_oid_platform(self):
|
||||
return ".2"
|
||||
|
||||
def baseconfig(self):
|
||||
return True
|
||||
1
packages/platforms/qemu/vendor-config/Makefile
Normal file
1
packages/platforms/qemu/vendor-config/Makefile
Normal file
@@ -0,0 +1 @@
|
||||
include $(ONL)/make/pkg.mk
|
||||
1
packages/platforms/qemu/vendor-config/PKG.yml
Normal file
1
packages/platforms/qemu/vendor-config/PKG.yml
Normal file
@@ -0,0 +1 @@
|
||||
!include $ONL_TEMPLATES/platform-config-vendor.yml VENDOR=qemu Vendor=QEMU
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/python
|
||||
############################################################
|
||||
# <bsn.cl fy=2013 v=none>
|
||||
#
|
||||
# Copyright 2013, 2014 BigSwitch Networks, Inc.
|
||||
#
|
||||
#
|
||||
#
|
||||
# </bsn.cl>
|
||||
############################################################
|
||||
#
|
||||
# OnlPlatform support for the KVM simulation platform.
|
||||
#
|
||||
############################################################
|
||||
from onl.platform.base import *
|
||||
|
||||
class OnlPlatformQEMU(OnlPlatformBase):
|
||||
def manufacturer(self):
|
||||
return "QEMU"
|
||||
|
||||
def sys_oid_vendor(self):
|
||||
return ".42623"
|
||||
Reference in New Issue
Block a user