Skip to content

Commit

Permalink
Merge pull request #5 from RusPiRo/feature/aarch64
Browse files Browse the repository at this point in the history
Feature/aarch64
  • Loading branch information
2ndTaleStudio authored Dec 13, 2019
2 parents db5e1a6 + 3b57b65 commit 175e8c8
Show file tree
Hide file tree
Showing 17 changed files with 655 additions and 492 deletions.
35 changes: 23 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,31 @@ branches:

language: rust

rust:
# build nightly only for the time beeing
- nightly

matrix:
fast_finish: true

include:
- rust: nightly
- name: "build 64Bit"
install:
- sudo apt-get install gcc-aarch64-linux-gnu gcc-aarch64-linux-gnu
- cargo install cargo-xbuild
- rustup target add aarch64-unknown-linux-gnu
- rustup component add rust-src
- sudo chmod ugo+x build.sh
script: sed -i 's/path.*=.*"\.\{2\}.*", version/version/g' Cargo.toml && ./build.sh 64 travis

script: ./travis-build.sh
- name: "build 32Bit"
install:
- sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
- cargo install cargo-xbuild
- rustup target add armv7-unknown-linux-gnueabihf
- rustup component add rust-src
- sudo chmod ugo+x build.sh
# remove the path in the dependencies of the cargo file to ensure we use the version from crates.io
script: sed -i 's/path.*=.*"\.\{2\}.*", version/version/g' Cargo.toml && ./build.sh 32 travis

install:
# install cross compiler toolchain
- sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
# install cargo xbuild to proper cross compile
- cargo install cargo-xbuild
# add the build target used for Raspbarry Pi targeting builds
- rustup target add armv7-unknown-linux-gnueabihf
- rustup component add rust-src
- sudo chmod ugo+x ./travis-build.sh
- name: "unit tests"
script: sed -i 's/path.*=.*"\.\{2\}.*", version/version/g' Cargo.toml && cargo test --tests
150 changes: 0 additions & 150 deletions Cargo.lock

This file was deleted.

16 changes: 9 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
[package]
name = "ruspiro-interrupt"
authors = ["Andre Borrmann <[email protected]>"]
version = "0.2.1" # remember to update html_root_url
description = "Providing a simple and convinient way to implement interrupt handler for Raspberry Pi interrupts."
version = "0.3.0" # remember to update html_root_url
description = """
Providing a simple and convinient way to implement interrupt handler for Raspberry Pi interrupts.
"""
license = "Apache-2.0"
repository = "https://github.com/RusPiRo/ruspiro-interrupt/tree/v0.2.1"
documentation = "https://docs.rs/ruspiro-interrupt/0.2.1"
repository = "https://github.com/RusPiRo/ruspiro-interrupt/tree/v0.3.0"
documentation = "https://docs.rs/ruspiro-interrupt/0.3.0"
readme = "README.md"
keywords = ["RusPiRo", "baremetal", "raspberrypi", "interrupt"]
categories = ["no-std", "embedded"]
Expand All @@ -19,10 +21,10 @@ maintenance = { status = "actively-developed" }

[dependencies]
paste = "0.1.5"
ruspiro-register = "0.1"
ruspiro-interrupt-core = { path = "./core", version = "0.2" }
ruspiro-register = { path = "../register", version = "0.3" }
ruspiro-interrupt-core = { path = "./core", version = "0.3" }
ruspiro-interrupt-macros = { path = "./macros", version = "0.2" }
ruspiro-singleton = "0.2"
ruspiro-singleton = { path = "../singleton", version = "0.3" }

[features]
default = ["ruspiro_pi3"]
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ script providing all the necessary linker symbols and entrypoints calling into t
To use the crate just add the following dependency to your ``Cargo.toml`` file:
```
[dependencies]
ruspiro-interrupt = "0.2"
ruspiro-interrupt = "0.3"
```

Once done the access to the features/attribute of the interrupt crate is available in your rust files like so:
```
extern crate ruspiro_interrupt; // needed for proper linking of weak defined functions
use ruspiro-interrupt::*;
#[IrqHandler(<irq-type-name>)]
Expand Down
4 changes: 0 additions & 4 deletions Xargo.toml

This file was deleted.

36 changes: 36 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/sh

set +ev

if [ $# -eq 0 ]
then
echo "not enough parameter given"
exit 1
fi

# check which aarch version to build
if [ $1 = "64" ]
then
# aarch64
export CFLAGS='-march=armv8-a -Wall -O3 -nostdlib -nostartfiles -ffreestanding -mtune=cortex-a53'
export RUSTFLAGS='-C linker=aarch64-elf-gcc -C target-cpu=cortex-a53 -C target-feature=+strict-align,+a53,+fp-armv8,+neon -C link-arg=-nostartfiles -C opt-level=3 -C debuginfo=0'
if [ "$2" = "" ]
then
export CC='aarch64-elf-gcc'
export AR='aarch64-elf-ar'
fi
cargo xbuild --target aarch64-unknown-linux-gnu --release
elif [ $1 = "32" ]
then
# aarch32
export CFLAGS='-mfpu=neon-fp-armv8 -mfloat-abi=hard -march=armv8-a -Wall -O3 -nostdlib -nostartfiles -ffreestanding -mtune=cortex-a53'
export RUSTFLAGS='-C linker=arm-eabi-gcc.exe -C target-cpu=cortex-a53 -C target-feature=+strict-align,+a53,+fp-armv8,+v8,+vfp3,+d16,+thumb2,+neon -C link-arg=-nostartfiles -C opt-level=3 -C debuginfo=0'
if [ -z "$2" ]
then
export CC='arm-eabi-gcc.exe'
export AR='arm-eabi-ar.exe'
fi
cargo xbuild --target armv7-unknown-linux-gnueabihf --release
else
echo 'provide the archtitecture to be build. Use either "build.sh 32" or "build.sh 64"'
fi
10 changes: 6 additions & 4 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
[package]
name = "ruspiro-interrupt-core"
authors = ["Andre Borrmann <[email protected]>"]
version = "0.2.0" # remember to update html_root_url
description = "Interrupt core functions to globally enable/disable interrupts on Raspberry Pi"
version = "0.3.0" # remember to update html_root_url
description = """
Interrupt core functions to globally enable/disable interrupts on Raspberry Pi
"""
license = "Apache-2.0"
repository = "https://github.com/RusPiRo/ruspiro-interrupt/tree/v0.2.1/core"
documentation = "https://docs.rs/ruspiro-interrupt-core/0.2.0"
repository = "https://github.com/RusPiRo/ruspiro-interrupt/tree/v0.3.0/core"
documentation = "https://docs.rs/ruspiro-interrupt-core/0.3.0"
readme = "README.md"
keywords = ["RusPiRo", "baremetal", "raspberrypi", "interrupt"]
categories = ["no-std", "embedded"]
Expand Down
2 changes: 1 addition & 1 deletion core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Core interrupt functions to globally enable/disable interrupts to be triggered o
To use the crate just add the following dependency to your ``Cargo.toml`` file:
```
[dependencies]
ruspiro-interrupt-core = "0.2"
ruspiro-interrupt-core = "0.3"
```

Once done the access to the functions to enable/disable interrupts is available in your rust files like so:
Expand Down
Loading

0 comments on commit 175e8c8

Please sign in to comment.