Merge Mainline
This commit is contained in:
commit
917cec8cc0
172
README.md
172
README.md
@ -1,49 +1,139 @@
|
||||
# PROJECT IMMORTALWRT
|
||||
## The Core Source Code of ImmortalWrt
|
||||
### Welcome to our Telegram Group: [@ctcgfw\_openwrt\_discuss](https://t.me/ctcgfw_openwrt_discuss).
|
||||
- - -
|
||||
<img src="https://avatars.githubusercontent.com/u/53193414?s=200&v=4" alt="logo" width="200" height="200" align="right">
|
||||
|
||||
# How to make it
|
||||
## Minimum requirements
|
||||
Linux with case sensitive<br/>
|
||||
2G DDR2 RAM<br/>
|
||||
2 CPU Cores (AMD64, 1.4Ghz)<br/>
|
||||
25G disk space left<br/>
|
||||
Has access to both ChinaNet & Internet
|
||||
# Project ImmortalWrt
|
||||
|
||||
## Install the necessary packages (for Ubuntu user)
|
||||
```bash
|
||||
sudo apt-get update -y
|
||||
sudo apt-get full-upgrade -y
|
||||
sudo apt-get install -y build-essential cmake asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib g++-multilib p7zip p7zip-full msmtp libssl-dev texinfo libreadline-dev libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint ccache curl wget vim nano python2.7 python3 python3-pip python3-ply haveged lrzsz device-tree-compiler scons antlr3 gperf intltool mkisofs rsync
|
||||
```
|
||||
#### For mainland China & Ubuntu(16.04+) user, you may run the following command to setup quickly:
|
||||
```bash
|
||||
sudo bash -c "bash <(curl -s https://build-scripts.project-openwrt.eu.org/init_build_environment.sh)"
|
||||
```
|
||||
ImmortalWrt is a fork of [OpenWrt](https://openwrt.org), with more packages ported, more device supported, better performance, and special optimizations for mainland China users.<br/>
|
||||
Compared the official one, we allow to use hacks or non-upstreamable patches / modifications to achieve our purpose. Source from anywhere.
|
||||
|
||||
## Clone the source
|
||||
```bash
|
||||
git clone -b openwrt-18.06-k5.4 --single-branch https://github.com/immortalwrt/immortalwrt && cd immortalwrt
|
||||
./scripts/feeds update -a && ./scripts/feeds install -a
|
||||
```
|
||||
Default login address: http://192.168.1.1 or http://immortalwrt.lan, username: __root__, password: __password__.
|
||||
|
||||
## Configure your firmware
|
||||
```bash
|
||||
make menuconfig
|
||||
```
|
||||
## Development
|
||||
To build your own firmware you need a GNU/Linux, BSD or MacOSX system (case sensitive filesystem required). Cygwin is unsupported because of the lack of a case sensitive file system.<br/>
|
||||
|
||||
## Make it
|
||||
```bash
|
||||
make -j$(nproc) V=s
|
||||
```
|
||||
### Requirements
|
||||
To build with this project, Ubuntu 18.04 LTS is preferred. And you need use the CPU based on AMD64 architecture, with at least 4GB RAM and 25 GB available disk space. Make sure the __Internet__ is accessible.
|
||||
|
||||
## Tips
|
||||
You'd better not use **root** to make it, or you may be not able to use.<br/>
|
||||
Default login address: 192.168.1.1, username is **root** and password is **password**.
|
||||
The following tools are needed to compile ImmortalWrt, the package names vary between distributions.
|
||||
|
||||
# Contributed
|
||||
### See [CONTRIBUTED.md](https://github.com/immortalwrt/immortalwrt/blob/openwrt-18.06/CONTRIBUTED.md).
|
||||
- Here is an example for Ubuntu users:<br/>
|
||||
- Method 1:
|
||||
<details>
|
||||
<summary>Setup dependencies via APT</summary>
|
||||
|
||||
# License
|
||||
### [GNU General Public License v3.0](https://github.com/immortalwrt/immortalwrt/blob/openwrt-18.06/LICENSES/GPL-3.0).
|
||||
```bash
|
||||
sudo apt update -y
|
||||
sudo apt full-upgrade -y
|
||||
sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \
|
||||
bzip2 ccache cmake cpio curl device-tree-compiler ecj fastjar flex gawk gettext git git-core gperf haveged \
|
||||
help2man intltool lib32gcc1 libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev libmpc-dev \
|
||||
libmpfr-dev libncurses5-dev libncurses5-dev libreadline-dev libssl-dev libtool libz-dev lrzsz mkisofs msmtp \
|
||||
nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pip python3-ply python-docutils \
|
||||
qemu-utils re2c rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip vim wget xmlto \
|
||||
xxd zlib1g-dev
|
||||
```
|
||||
</details>
|
||||
- Method 2:
|
||||
```bash
|
||||
curl -s https://build-scripts.project-openwrt.eu.org/init_build_environment.sh | sudo bash
|
||||
```
|
||||
|
||||
- You can also download and use prebuilt container directly:<br/>
|
||||
See #Quickstart - Build image via OPDE
|
||||
|
||||
Note:
|
||||
- For the for love of god please do __not__ use ROOT user to build your image.
|
||||
- Using CPUs based on other architectures should be fine to compile ImmortalWrt, but more hacks are needed - No warranty at all.
|
||||
- You must __not__ have spaces in PATH or in the work folders on the drive.
|
||||
- If you're using Windows Subsystem for Linux (or WSL), removing Windows folders from PATH is required, please see [Build system setup WSL](https://openwrt.org/docs/guide-developer/build-system/wsl) documentation.
|
||||
- Using macOS as the host build OS is __not__ recommended. No warranty at all. You can get tips from [Build system setup macOS](https://openwrt.org/docs/guide-developer/build-system/buildroot.exigence.macosx) documentation.
|
||||
- As you're building ImmortalWrt, patching or disabling UPX tools is also required.
|
||||
- For more details, please see [Build system setup](https://openwrt.org/docs/guide-developer/build-system/install-buildsystem) documentation.
|
||||
|
||||
### Quickstart
|
||||
- Method 1:
|
||||
1. Run `git clone -b <branch> --single-branch https://github.com/immortalwrt/immortalwrt` to clone the source code.
|
||||
2. Run `cd immortalwrt` to enter source directory.
|
||||
3. Run `./scripts/feeds update -a` to obtain all the latest package definitions defined in feeds.conf / feeds.conf.default
|
||||
4. Run `./scripts/feeds install -a` to install symlinks for all obtained packages into package/feeds/
|
||||
5. Run `make menuconfig` to select your preferred configuration for the toolchain, target system & firmware packages.
|
||||
6. Run `make` to build your firmware. This will download all sources, build the cross-compile toolchain and then cross-compile the GNU/Linux kernel & all chosen applications for your target system.
|
||||
|
||||
- Method 2:
|
||||
<details>
|
||||
<summary>Build image via OPDE</summary>
|
||||
|
||||
- Pull the prebuilt container:
|
||||
```bash
|
||||
docker pull immortalwrt/opde:base
|
||||
# docker run --rm -it immortalwrt/opde:base
|
||||
```
|
||||
|
||||
- For Linux User:
|
||||
```bash
|
||||
git clone -b <branch> --single-branch https://github.com/immortalwrt/immortalwrt && cd immortalwrt
|
||||
docker run --rm -it \
|
||||
-v $PWD:/openwrt \
|
||||
immortalwrt/opde:base zsh
|
||||
./scripts/feeds update -a && ./scripts/feeds install -a
|
||||
```
|
||||
|
||||
- For Windows User:
|
||||
1. Create a volume 'immortalwrt' and clone ImmortalWrt source into volume.
|
||||
```bash
|
||||
docker run --rm -it -v immortalwrt:/openwrt immortalwrt/opde:base git clone -b <branch> --single-branch https://github.com/immortalwrt/immortalwrt .
|
||||
```
|
||||
2. Enter docker container and update feeds.
|
||||
```bash
|
||||
docker run --rm -it -v immortalwrt:/openwrt immortalwrt/opde:base
|
||||
./scripts/feeds update -a && ./scripts/feeds install -a
|
||||
```
|
||||
- Tips: ImmortalWrt source code can not be cloned into NTFS filesystem (symbol link problem during compilation), but docker volume is fine.
|
||||
|
||||
- Proxy Support:
|
||||
```bash
|
||||
docker run --rm -it \
|
||||
-e all_proxy=http://example.com:1081 \
|
||||
-e http_proxy=http://example.com:1081 \
|
||||
-e https_proxy=http://example.com:1081 \
|
||||
-e ALL_PROXY=http://example.com:1081 \
|
||||
-e HTTP_PROXY=http://example.com:1081 \
|
||||
-e HTTPS_PROXY=http://example.com:1081 \
|
||||
-v $PWD:/openwrt \
|
||||
immortalwrt/opde:base zsh
|
||||
```
|
||||
|
||||
> Recommand `http` rather `socks5` protocol
|
||||
>
|
||||
> IP can not be `localhost` or `127.0.0.1`
|
||||
|
||||
- For Windows User, binary is still in volume. It can be copied to outside via followed command:
|
||||
```bash
|
||||
docker run --rm -v <D:\path\to\dir>:/dst -v openwrt:/openwrt -w /dst immortalwrt:base cp /openwrt/bin /dst
|
||||
```
|
||||
> Make sure `D:\path\to\dir` has been appended in [File Sharing](https://docs.docker.com/docker-for-windows/#file-sharing).
|
||||
|
||||
</details>
|
||||
|
||||
### Related Repositories
|
||||
The main repository uses multiple sub-repositories to manage packages of different categories. All packages are installed via the ImmortalWrt package manager called opkg. If you're looking to develop the web interface or port packages to ImmortalWrt, please find the fitting repository below.
|
||||
- [LuCI Web Interface](https://github.com/immortalwrt/luci): Modern and modular interface to control the device via a web browser.
|
||||
- [ImmortalWrt Packages](https://github.com/immortalwrt/packages): Community repository of ported packages.
|
||||
- [OpenWrt Routing](https://github.com/openwrt/routing): Packages specifically focused on (mesh) routing.
|
||||
- [CONTRIBUTED.md](https://github.com/immortalwrt/immortalwrt/blob/master/CONTRIBUTED.md): the 3rd-party packages we introduced.
|
||||
|
||||
## Support Information
|
||||
For a list of supported devices see the [OpenWrt Hardware Database](https://openwrt.org/supported_devices)
|
||||
### Documentation
|
||||
- [Quick Start Guide](https://openwrt.org/docs/guide-quick-start/start)
|
||||
- [User Guide](https://openwrt.org/docs/guide-user/start)
|
||||
- [Developer Documentation](https://openwrt.org/docs/guide-developer/start)
|
||||
- [Technical Reference](https://openwrt.org/docs/techref/start)
|
||||
|
||||
### Support Community
|
||||
- Support Chat: group [@ctcgfw_openwrt_discuss](https://t.me/ctcgfw_openwrt_discuss) on [Telegram](https://telegram.org/).
|
||||
|
||||
## Sponsors
|
||||
[](https://dlercloud.com/)
|
||||
|
||||
## License
|
||||
ImmortalWrt is licensed under [GPL-3.0-only](https://spdx.org/licenses/GPL-3.0-only.html).
|
||||
|
||||
@ -319,4 +319,12 @@ menu "Target Images"
|
||||
it will be mounted by PARTUUID which makes the kernel find the
|
||||
appropriate disk automatically.
|
||||
|
||||
config TARGET_ROOTFS_PERSIST_VAR
|
||||
bool "Make /var persistent"
|
||||
default n
|
||||
help
|
||||
Do not symlink /var to /tmp, so that its content will persist
|
||||
across reboots. When enabled, /var/run will still be linked
|
||||
to /tmp/run.
|
||||
|
||||
endmenu
|
||||
|
||||
@ -75,7 +75,7 @@ JFFS2OPTS += $(MKFS_DEVTABLE_OPT)
|
||||
SQUASHFS_BLOCKSIZE := $(CONFIG_TARGET_SQUASHFS_BLOCK_SIZE)k
|
||||
SQUASHFSOPT := -b $(SQUASHFS_BLOCKSIZE)
|
||||
SQUASHFSOPT += -p '/dev d 755 0 0' -p '/dev/console c 600 0 0 5 1'
|
||||
SQUASHFSOPT += $(if $(CONFIG_SELINUX),-xattr,-no-xattrs)
|
||||
SQUASHFSOPT += $(if $(CONFIG_SELINUX),-xattrs,-no-xattrs)
|
||||
SQUASHFSCOMP := gzip
|
||||
LZMA_XZ_OPTIONS := -Xpreset 9 -Xe -Xlc 0 -Xlp 2 -Xpb 2
|
||||
ifeq ($(CONFIG_SQUASHFS_XZ),y)
|
||||
|
||||
@ -170,6 +170,10 @@ $(eval $(call SetupHostCommand,python3,Please install Python >= 3.6, \
|
||||
python3.6 -V 2>&1 | grep 'Python 3', \
|
||||
python3 -V 2>&1 | grep -E 'Python 3\.[6-9]\.?'))
|
||||
|
||||
$(eval $(call TestHostCommand,python3-distutils, \
|
||||
Please install the Python3 distutils module, \
|
||||
$(STAGING_DIR_HOST)/bin/python3 -c 'import distutils'))
|
||||
|
||||
$(eval $(call SetupHostCommand,git,Please install Git (git-core) >= 1.7.12.2, \
|
||||
git --exec-path | xargs -I % -- grep -q -- --recursive %/git-submodule))
|
||||
|
||||
|
||||
@ -179,8 +179,13 @@ define Package/base-files/install
|
||||
mkdir -p $(1)/www
|
||||
mkdir -p $(1)/root
|
||||
$(LN) /proc/mounts $(1)/etc/mtab
|
||||
ifneq ($(CONFIG_TARGET_ROOTFS_PERSIST_VAR),y)
|
||||
rm -f $(1)/var
|
||||
$(LN) tmp $(1)/var
|
||||
else
|
||||
mkdir -p $(1)/var
|
||||
$(LN) /tmp/run $(1)/var/run
|
||||
endif
|
||||
mkdir -p $(1)/etc
|
||||
$(LN) /tmp/resolv.conf /tmp/TZ /tmp/localtime $(1)/etc/
|
||||
|
||||
|
||||
@ -8,12 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gdb
|
||||
PKG_VERSION:=10.1
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=10.2
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@GNU/gdb
|
||||
PKG_HASH:=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0
|
||||
PKG_HASH:=aaa1223d534c9b700a8bec952d9748ee1977513f178727e1bee520ee000b4f29
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
@ -45,7 +45,6 @@ endef
|
||||
define Package/gdbserver
|
||||
$(call Package/gdb/Default)
|
||||
TITLE:=Remote server for GNU Debugger
|
||||
DEPENDS+=@!arc
|
||||
endef
|
||||
|
||||
define Package/gdbserver/description
|
||||
|
||||
@ -1,38 +0,0 @@
|
||||
The signal definitions of musl and gdb collide
|
||||
|
||||
The kernel defines "struct sigcontext" in asm/sigcontext.h and musl libc
|
||||
defines it in signal.h which collides.
|
||||
Kernel 4.14 misses the definitions of struct user_sve_header so we still
|
||||
have to use the aarch64-sve-linux-sigcontext.h header file which also
|
||||
provides that and make sure aarch64-sve-linux-sigcontext.h does not
|
||||
provide the same headers as the kernel or musl.
|
||||
|
||||
--- a/gdb/nat/aarch64-sve-linux-ptrace.h
|
||||
+++ b/gdb/nat/aarch64-sve-linux-ptrace.h
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <sys/ptrace.h>
|
||||
#include <asm/ptrace.h>
|
||||
|
||||
-#ifndef SVE_SIG_ZREGS_SIZE
|
||||
+#ifndef SVE_PT_REGS_SVE
|
||||
#include "aarch64-sve-linux-sigcontext.h"
|
||||
#endif
|
||||
|
||||
--- a/gdb/nat/aarch64-sve-linux-sigcontext.h
|
||||
+++ b/gdb/nat/aarch64-sve-linux-sigcontext.h
|
||||
@@ -19,6 +19,7 @@
|
||||
#ifndef NAT_AARCH64_SVE_LINUX_SIGCONTEXT_H
|
||||
#define NAT_AARCH64_SVE_LINUX_SIGCONTEXT_H
|
||||
|
||||
+#ifndef SVE_MAGIC
|
||||
#define SVE_MAGIC 0x53564501
|
||||
|
||||
struct sve_context {
|
||||
@@ -128,6 +129,7 @@ struct sve_context {
|
||||
(SVE_SIG_FFR_OFFSET(vq) + SVE_SIG_FFR_SIZE(vq) - SVE_SIG_REGS_OFFSET)
|
||||
|
||||
#define SVE_SIG_CONTEXT_SIZE(vq) (SVE_SIG_REGS_OFFSET + SVE_SIG_REGS_SIZE(vq))
|
||||
+#endif
|
||||
|
||||
/* SVE/FP/SIMD state (NT_ARM_SVE) */
|
||||
|
||||
@ -1,53 +0,0 @@
|
||||
--- a/gdb/linux-nat.c
|
||||
+++ b/gdb/linux-nat.c
|
||||
@@ -17,6 +17,7 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
+#include "stopcode.h"
|
||||
#include "defs.h"
|
||||
#include "inferior.h"
|
||||
#include "infrun.h"
|
||||
@@ -70,6 +71,10 @@
|
||||
#include "gdbsupport/gdb-sigmask.h"
|
||||
#include "debug.h"
|
||||
|
||||
+#ifndef __SIGRTMIN
|
||||
+#define __SIGRTMIN SIGRTMIN
|
||||
+#endif
|
||||
+
|
||||
/* This comment documents high-level logic of this file.
|
||||
|
||||
Waiting for events in sync mode
|
||||
--- /dev/null
|
||||
+++ b/gdb/stopcode.h
|
||||
@@ -0,0 +1,4 @@
|
||||
+#ifndef W_STOPCODE
|
||||
+#define W_STOPCODE(sig) ((sig) << 8 | 0x7f)
|
||||
+#endif
|
||||
+
|
||||
--- a/gdb/nat/ppc-linux.h
|
||||
+++ b/gdb/nat/ppc-linux.h
|
||||
@@ -18,7 +18,10 @@
|
||||
#ifndef NAT_PPC_LINUX_H
|
||||
#define NAT_PPC_LINUX_H
|
||||
|
||||
+#define pt_regs __pt_regs
|
||||
#include <asm/ptrace.h>
|
||||
+#undef pt_regs
|
||||
+
|
||||
#include <asm/cputable.h>
|
||||
|
||||
/* This sometimes isn't defined. */
|
||||
--- a/gdbserver/linux-ppc-low.cc
|
||||
+++ b/gdbserver/linux-ppc-low.cc
|
||||
@@ -23,7 +23,9 @@
|
||||
#include "elf/common.h"
|
||||
#include <sys/uio.h>
|
||||
#include <elf.h>
|
||||
+#define pt_regs __pt_regs
|
||||
#include <asm/ptrace.h>
|
||||
+#undef pt_regs
|
||||
|
||||
#include "arch/ppc-linux-common.h"
|
||||
#include "arch/ppc-linux-tdesc.h"
|
||||
35
package/devel/gdb/patches/130-gdb-ctrl-c.patch
Normal file
35
package/devel/gdb/patches/130-gdb-ctrl-c.patch
Normal file
@ -0,0 +1,35 @@
|
||||
From 63df98fa78c8a6e12b40ebdc5c155838d2bf8b5f Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Thu, 29 Nov 2018 18:00:23 -0800
|
||||
Subject: [PATCH 11/11] gdbserver ctrl-c handling
|
||||
|
||||
This problem was created by the upstream commit 78708b7c8c
|
||||
After applying the commit, it will send SIGINT to the process
|
||||
group(-signal_pid).
|
||||
But if we use gdbserver send SIGINT, and the attached process is not a
|
||||
process
|
||||
group leader, then the "kill (-signal_pid, SIGINT)" returns error and
|
||||
fails to
|
||||
interrupt the attached process.
|
||||
|
||||
Upstream-Status: Submitted
|
||||
[https://sourceware.org/bugzilla/show_bug.cgi?id=18945]
|
||||
|
||||
Author: Josh Gao
|
||||
Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
gdbserver/linux-low.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/gdbserver/linux-low.cc
|
||||
+++ b/gdbserver/linux-low.cc
|
||||
@@ -5714,7 +5714,7 @@ linux_process_target::request_interrupt
|
||||
{
|
||||
/* Send a SIGINT to the process group. This acts just like the user
|
||||
typed a ^C on the controlling terminal. */
|
||||
- ::kill (-signal_pid, SIGINT);
|
||||
+ ::kill (signal_pid, SIGINT);
|
||||
}
|
||||
|
||||
bool
|
||||
@ -1,11 +0,0 @@
|
||||
--- a/gdb/dwarf2/index-write.c
|
||||
+++ b/gdb/dwarf2/index-write.c
|
||||
@@ -777,7 +777,7 @@ public:
|
||||
gdb_assert (m_abbrev_table.empty ());
|
||||
const size_t name_count = m_name_to_value_set.size ();
|
||||
m_bucket_table.resize
|
||||
- (std::pow (2, std::ceil (std::log2 (name_count * 4 / 3))));
|
||||
+ (std::pow (2, std::ceil (log2 (name_count * 4 / 3))));
|
||||
m_hash_table.reserve (name_count);
|
||||
m_name_table_string_offs.reserve (name_count);
|
||||
m_name_table_entry_offs.reserve (name_count);
|
||||
30
package/devel/gdb/patches/140-sgidefs.patch
Normal file
30
package/devel/gdb/patches/140-sgidefs.patch
Normal file
@ -0,0 +1,30 @@
|
||||
From 677b5b56135141c0d259e370aacd0e11c810aa15 Mon Sep 17 00:00:00 2001
|
||||
From: Andre McCurdy <armccurdy@gmail.com>
|
||||
Date: Fri, 5 Feb 2016 14:00:00 -0800
|
||||
Subject: [PATCH] use <asm/sgidefs.h>
|
||||
|
||||
Build fix for MIPS with musl libc
|
||||
|
||||
The MIPS specific header <sgidefs.h> is provided by glibc and uclibc
|
||||
but not by musl. Regardless of the libc, the kernel headers provide
|
||||
<asm/sgidefs.h> which provides the same definitions, so use that
|
||||
instead.
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
|
||||
---
|
||||
gdb/mips-linux-nat.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/gdb/mips-linux-nat.c
|
||||
+++ b/gdb/mips-linux-nat.c
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "gdb_proc_service.h"
|
||||
#include "gregset.h"
|
||||
|
||||
-#include <sgidefs.h>
|
||||
+#include <asm/sgidefs.h>
|
||||
#include "nat/gdb_ptrace.h"
|
||||
#include <asm/ptrace.h>
|
||||
#include "inf-ptrace.h"
|
||||
32
package/devel/gdb/patches/150-mips64.patch
Normal file
32
package/devel/gdb/patches/150-mips64.patch
Normal file
@ -0,0 +1,32 @@
|
||||
From e92f8932ef488de2a56db4299131ce6a4eb170bd Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Wed, 23 Mar 2016 06:30:09 +0000
|
||||
Subject: [PATCH] mips-linux-nat: Define _ABIO32 if not defined
|
||||
|
||||
This helps building gdb on mips64 on musl, since
|
||||
musl does not provide sgidefs.h this define is
|
||||
only defined when GCC is using o32 ABI, in that
|
||||
case gcc emits it as built-in define and hence
|
||||
it works ok for mips32
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
Upstream-Status: Pending
|
||||
|
||||
gdb/mips-linux-nat.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
--- a/gdb/mips-linux-nat.c
|
||||
+++ b/gdb/mips-linux-nat.c
|
||||
@@ -42,6 +42,11 @@
|
||||
#define PTRACE_GET_THREAD_AREA 25
|
||||
#endif
|
||||
|
||||
+/* musl does not define and relies on compiler built-in macros for it */
|
||||
+#ifndef _ABIO32
|
||||
+#define _ABIO32 1
|
||||
+#endif
|
||||
+
|
||||
class mips_linux_nat_target final : public linux_nat_trad_target
|
||||
{
|
||||
public:
|
||||
@ -8,7 +8,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=automount
|
||||
PKG_VERSION:=1
|
||||
PKG_FLAGS:=nonshared
|
||||
PKG_RELEASE:=$(COMMITCOUNT)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=gpio-button-hotplug
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=3
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@ -26,28 +26,15 @@
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/of_gpio.h>
|
||||
#include <linux/of_irq.h>
|
||||
#include <linux/gpio_keys.h>
|
||||
|
||||
#define DRV_NAME "gpio-keys"
|
||||
#include <linux/gpio/consumer.h>
|
||||
|
||||
#define BH_SKB_SIZE 2048
|
||||
|
||||
#define DRV_NAME "gpio-keys"
|
||||
#define PFX DRV_NAME ": "
|
||||
|
||||
#undef BH_DEBUG
|
||||
|
||||
#ifdef BH_DEBUG
|
||||
#define BH_DBG(fmt, args...) printk(KERN_DEBUG "%s: " fmt, DRV_NAME, ##args )
|
||||
#else
|
||||
#define BH_DBG(fmt, args...) do {} while (0)
|
||||
#endif
|
||||
|
||||
#define BH_ERR(fmt, args...) printk(KERN_ERR "%s: " fmt, DRV_NAME, ##args )
|
||||
|
||||
struct bh_priv {
|
||||
unsigned long seen;
|
||||
};
|
||||
|
||||
struct bh_event {
|
||||
const char *name;
|
||||
unsigned int type;
|
||||
@ -65,12 +52,16 @@ struct bh_map {
|
||||
|
||||
struct gpio_keys_button_data {
|
||||
struct delayed_work work;
|
||||
struct bh_priv bh;
|
||||
unsigned long seen;
|
||||
int map_entry;
|
||||
int last_state;
|
||||
int count;
|
||||
int threshold;
|
||||
int can_sleep;
|
||||
struct gpio_keys_button *b;
|
||||
int irq;
|
||||
unsigned int software_debounce;
|
||||
struct gpio_desc *gpiod;
|
||||
const struct gpio_keys_button *b;
|
||||
};
|
||||
|
||||
extern u64 uevent_next_seqnum(void);
|
||||
@ -100,9 +91,12 @@ static struct bh_map button_map[] = {
|
||||
BH_MAP(KEY_LIGHTS_TOGGLE, "lights_toggle"),
|
||||
BH_MAP(KEY_PHONE, "phone"),
|
||||
BH_MAP(KEY_POWER, "power"),
|
||||
BH_MAP(KEY_POWER2, "reboot"),
|
||||
BH_MAP(KEY_RESTART, "reset"),
|
||||
BH_MAP(KEY_RFKILL, "rfkill"),
|
||||
BH_MAP(KEY_VIDEO, "video"),
|
||||
BH_MAP(KEY_VOLUMEDOWN, "volume_down"),
|
||||
BH_MAP(KEY_VOLUMEUP, "volume_up"),
|
||||
BH_MAP(KEY_WIMAX, "wwan"),
|
||||
BH_MAP(KEY_WLAN, "wlan"),
|
||||
BH_MAP(KEY_WPS_BUTTON, "wps"),
|
||||
@ -133,7 +127,7 @@ int bh_event_add_var(struct bh_event *event, int argv, const char *format, ...)
|
||||
s = skb_put(event->skb, len + 1);
|
||||
strcpy(s, buf);
|
||||
|
||||
BH_DBG("added variable '%s'\n", s);
|
||||
pr_debug(PFX "added variable '%s'\n", s);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -200,7 +194,7 @@ static void button_hotplug_work(struct work_struct *work)
|
||||
|
||||
out_free_skb:
|
||||
if (ret) {
|
||||
BH_ERR("work error %d\n", ret);
|
||||
pr_err(PFX "work error %d\n", ret);
|
||||
kfree_skb(event->skb);
|
||||
}
|
||||
out_free_event:
|
||||
@ -212,8 +206,8 @@ static int button_hotplug_create_event(const char *name, unsigned int type,
|
||||
{
|
||||
struct bh_event *event;
|
||||
|
||||
BH_DBG("create event, name=%s, seen=%lu, pressed=%d\n",
|
||||
name, seen, pressed);
|
||||
pr_debug(PFX "create event, name=%s, seen=%lu, pressed=%d\n",
|
||||
name, seen, pressed);
|
||||
|
||||
event = kzalloc(sizeof(*event), GFP_KERNEL);
|
||||
if (!event)
|
||||
@ -243,36 +237,6 @@ static int button_get_index(unsigned int code)
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void button_hotplug_event(struct gpio_keys_button_data *data,
|
||||
unsigned int type, int value)
|
||||
{
|
||||
struct bh_priv *priv = &data->bh;
|
||||
unsigned long seen = jiffies;
|
||||
int btn;
|
||||
|
||||
BH_DBG("event type=%u, code=%u, value=%d\n", type, data->b->code, value);
|
||||
|
||||
if ((type != EV_KEY) && (type != EV_SW))
|
||||
return;
|
||||
|
||||
btn = button_get_index(data->b->code);
|
||||
if (btn < 0)
|
||||
return;
|
||||
|
||||
button_hotplug_create_event(button_map[btn].name, type,
|
||||
(seen - priv->seen) / HZ, value);
|
||||
priv->seen = seen;
|
||||
}
|
||||
|
||||
struct gpio_keys_button_dev {
|
||||
int polled;
|
||||
struct delayed_work work;
|
||||
|
||||
struct device *dev;
|
||||
struct gpio_keys_platform_data *pdata;
|
||||
struct gpio_keys_button_data data[0];
|
||||
};
|
||||
|
||||
static int gpio_button_get_value(struct gpio_keys_button_data *bdata)
|
||||
{
|
||||
int val;
|
||||
@ -285,27 +249,61 @@ static int gpio_button_get_value(struct gpio_keys_button_data *bdata)
|
||||
return val ^ bdata->b->active_low;
|
||||
}
|
||||
|
||||
static void gpio_keys_polled_check_state(struct gpio_keys_button_data *bdata)
|
||||
static void gpio_keys_handle_button(struct gpio_keys_button_data *bdata)
|
||||
{
|
||||
unsigned int type = bdata->b->type ?: EV_KEY;
|
||||
int state = gpio_button_get_value(bdata);
|
||||
unsigned long seen = jiffies;
|
||||
|
||||
if (state != bdata->last_state) {
|
||||
unsigned int type = bdata->b->type ?: EV_KEY;
|
||||
pr_debug(PFX "event type=%u, code=%u, pressed=%d\n",
|
||||
type, bdata->b->code, state);
|
||||
|
||||
if (bdata->count < bdata->threshold) {
|
||||
bdata->count++;
|
||||
return;
|
||||
}
|
||||
|
||||
if ((bdata->last_state != -1) || (type == EV_SW))
|
||||
button_hotplug_event(bdata, type, state);
|
||||
|
||||
bdata->last_state = state;
|
||||
/* is this the initialization state? */
|
||||
if (bdata->last_state == -1) {
|
||||
/*
|
||||
* Don't advertise unpressed buttons on initialization.
|
||||
* Just save their state and continue otherwise this
|
||||
* can cause OpenWrt to enter failsafe.
|
||||
*/
|
||||
if (type == EV_KEY && state == 0)
|
||||
goto set_state;
|
||||
/*
|
||||
* But we are very interested in pressed buttons and
|
||||
* initial switch state. These will be reported to
|
||||
* userland.
|
||||
*/
|
||||
} else if (bdata->last_state == state) {
|
||||
/* reset asserted counter (only relevant for polled keys) */
|
||||
bdata->count = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (bdata->count < bdata->threshold) {
|
||||
bdata->count++;
|
||||
return;
|
||||
}
|
||||
|
||||
if (bdata->seen == 0)
|
||||
bdata->seen = seen;
|
||||
|
||||
button_hotplug_create_event(button_map[bdata->map_entry].name, type,
|
||||
(seen - bdata->seen) / HZ, state);
|
||||
bdata->seen = seen;
|
||||
|
||||
set_state:
|
||||
bdata->last_state = state;
|
||||
bdata->count = 0;
|
||||
}
|
||||
|
||||
struct gpio_keys_button_dev {
|
||||
int polled;
|
||||
struct delayed_work work;
|
||||
|
||||
struct device *dev;
|
||||
struct gpio_keys_platform_data *pdata;
|
||||
struct gpio_keys_button_data data[0];
|
||||
};
|
||||
|
||||
static void gpio_keys_polled_queue_work(struct gpio_keys_button_dev *bdev)
|
||||
{
|
||||
struct gpio_keys_platform_data *pdata = bdev->pdata;
|
||||
@ -324,7 +322,9 @@ static void gpio_keys_polled_poll(struct work_struct *work)
|
||||
|
||||
for (i = 0; i < bdev->pdata->nbuttons; i++) {
|
||||
struct gpio_keys_button_data *bdata = &bdev->data[i];
|
||||
gpio_keys_polled_check_state(bdata);
|
||||
|
||||
if (bdata->gpiod)
|
||||
gpio_keys_handle_button(bdata);
|
||||
}
|
||||
gpio_keys_polled_queue_work(bdev);
|
||||
}
|
||||
@ -339,11 +339,21 @@ static void gpio_keys_polled_close(struct gpio_keys_button_dev *bdev)
|
||||
pdata->disable(bdev->dev);
|
||||
}
|
||||
|
||||
static void gpio_keys_irq_work_func(struct work_struct *work)
|
||||
{
|
||||
struct gpio_keys_button_data *bdata = container_of(work,
|
||||
struct gpio_keys_button_data, work.work);
|
||||
|
||||
gpio_keys_handle_button(bdata);
|
||||
}
|
||||
|
||||
static irqreturn_t button_handle_irq(int irq, void *_bdata)
|
||||
{
|
||||
struct gpio_keys_button_data *bdata = (struct gpio_keys_button_data *) _bdata;
|
||||
struct gpio_keys_button_data *bdata =
|
||||
(struct gpio_keys_button_data *) _bdata;
|
||||
|
||||
button_hotplug_event(bdata, bdata->b->type ?: EV_KEY, gpio_button_get_value(bdata));
|
||||
mod_delayed_work(system_wq, &bdata->work,
|
||||
msecs_to_jiffies(bdata->software_debounce));
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
@ -389,7 +399,9 @@ gpio_keys_get_devtree_pdata(struct device *dev)
|
||||
continue;
|
||||
}
|
||||
|
||||
button = &pdata->buttons[i++];
|
||||
button = (struct gpio_keys_button *)(&pdata->buttons[i++]);
|
||||
|
||||
button->irq = irq_of_parse_and_map(pp, 0);
|
||||
|
||||
button->gpio = of_get_gpio_flags(pp, 0, &flags);
|
||||
if (button->gpio < 0) {
|
||||
@ -402,7 +414,7 @@ gpio_keys_get_devtree_pdata(struct device *dev)
|
||||
return ERR_PTR(error);
|
||||
}
|
||||
} else {
|
||||
button->active_low = flags & OF_GPIO_ACTIVE_LOW;
|
||||
button->active_low = !!(flags & OF_GPIO_ACTIVE_LOW);
|
||||
}
|
||||
|
||||
if (of_property_read_u32(pp, "linux,code", &button->code)) {
|
||||
@ -505,10 +517,23 @@ static int gpio_keys_button_probe(struct platform_device *pdev,
|
||||
unsigned int gpio = button->gpio;
|
||||
|
||||
if (button->wakeup) {
|
||||
dev_err(dev, DRV_NAME "does not support wakeup\n");
|
||||
dev_err(dev, "does not support wakeup\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
bdata->map_entry = button_get_index(button->code);
|
||||
if (bdata->map_entry < 0) {
|
||||
dev_warn(dev, "does not support key code:%u\n",
|
||||
button->code);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!(button->type == 0 || button->type == EV_KEY ||
|
||||
button->type == EV_SW)) {
|
||||
dev_warn(dev, "only supports buttons or switches\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
error = devm_gpio_request(dev, gpio,
|
||||
button->desc ? button->desc : DRV_NAME);
|
||||
if (error) {
|
||||
@ -516,6 +541,9 @@ static int gpio_keys_button_probe(struct platform_device *pdev,
|
||||
gpio, error);
|
||||
return error;
|
||||
}
|
||||
bdata->gpiod = gpio_to_desc(gpio);
|
||||
if (!bdata->gpiod)
|
||||
return -EINVAL;
|
||||
|
||||
error = gpio_direction_input(gpio);
|
||||
if (error) {
|
||||
@ -526,13 +554,27 @@ static int gpio_keys_button_probe(struct platform_device *pdev,
|
||||
}
|
||||
|
||||
bdata->can_sleep = gpio_cansleep(gpio);
|
||||
bdata->last_state = -1;
|
||||
bdata->last_state = -1; /* Unknown state on boot */
|
||||
|
||||
if (bdev->polled)
|
||||
if (bdev->polled) {
|
||||
bdata->threshold = DIV_ROUND_UP(button->debounce_interval,
|
||||
pdata->poll_interval);
|
||||
else
|
||||
bdata->threshold = 1;
|
||||
pdata->poll_interval);
|
||||
} else {
|
||||
/* bdata->threshold = 0; already initialized */
|
||||
|
||||
if (button->debounce_interval) {
|
||||
error = gpiod_set_debounce(bdata->gpiod,
|
||||
button->debounce_interval * 1000);
|
||||
/*
|
||||
* use timer if gpiolib doesn't provide
|
||||
* debounce.
|
||||
*/
|
||||
if (error < 0) {
|
||||
bdata->software_debounce =
|
||||
button->debounce_interval;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bdata->b = &pdata->buttons[i];
|
||||
}
|
||||
@ -560,26 +602,45 @@ static int gpio_keys_probe(struct platform_device *pdev)
|
||||
|
||||
pdata = bdev->pdata;
|
||||
for (i = 0; i < pdata->nbuttons; i++) {
|
||||
struct gpio_keys_button *button = &pdata->buttons[i];
|
||||
const struct gpio_keys_button *button = &pdata->buttons[i];
|
||||
struct gpio_keys_button_data *bdata = &bdev->data[i];
|
||||
unsigned long irqflags = IRQF_ONESHOT;
|
||||
|
||||
if (!button->irq)
|
||||
button->irq = gpio_to_irq(button->gpio);
|
||||
if (button->irq < 0) {
|
||||
dev_err(&pdev->dev, "failed to get irq for gpio:%d\n", button->gpio);
|
||||
INIT_DELAYED_WORK(&bdata->work, gpio_keys_irq_work_func);
|
||||
|
||||
if (!bdata->gpiod)
|
||||
continue;
|
||||
|
||||
if (!button->irq) {
|
||||
bdata->irq = gpio_to_irq(button->gpio);
|
||||
|
||||
if (bdata->irq < 0) {
|
||||
dev_err(&pdev->dev, "failed to get irq for gpio:%d\n",
|
||||
button->gpio);
|
||||
continue;
|
||||
}
|
||||
|
||||
irqflags |= IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING;
|
||||
} else {
|
||||
bdata->irq = button->irq;
|
||||
}
|
||||
|
||||
ret = devm_request_threaded_irq(&pdev->dev, button->irq, NULL, button_handle_irq,
|
||||
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
|
||||
dev_name(&pdev->dev), bdata);
|
||||
if (ret < 0)
|
||||
dev_err(&pdev->dev, "failed to request irq:%d for gpio:%d\n", button->irq, button->gpio);
|
||||
else
|
||||
dev_dbg(&pdev->dev, "gpio:%d has irq:%d\n", button->gpio, button->irq);
|
||||
schedule_delayed_work(&bdata->work,
|
||||
msecs_to_jiffies(bdata->software_debounce));
|
||||
|
||||
if (bdata->b->type == EV_SW)
|
||||
button_hotplug_event(bdata, EV_SW, gpio_button_get_value(bdata));
|
||||
ret = devm_request_threaded_irq(&pdev->dev,
|
||||
bdata->irq, NULL, button_handle_irq,
|
||||
irqflags, dev_name(&pdev->dev), bdata);
|
||||
|
||||
if (ret < 0) {
|
||||
bdata->irq = 0;
|
||||
dev_err(&pdev->dev, "failed to request irq:%d for gpio:%d\n",
|
||||
bdata->irq, button->gpio);
|
||||
continue;
|
||||
} else {
|
||||
dev_dbg(&pdev->dev, "gpio:%d has irq:%d\n",
|
||||
button->gpio, bdata->irq);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -590,7 +651,6 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)
|
||||
struct gpio_keys_platform_data *pdata;
|
||||
struct gpio_keys_button_dev *bdev;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
ret = gpio_keys_button_probe(pdev, &bdev, 1);
|
||||
|
||||
@ -604,14 +664,24 @@ static int gpio_keys_polled_probe(struct platform_device *pdev)
|
||||
if (pdata->enable)
|
||||
pdata->enable(bdev->dev);
|
||||
|
||||
for (i = 0; i < pdata->nbuttons; i++)
|
||||
gpio_keys_polled_check_state(&bdev->data[i]);
|
||||
|
||||
gpio_keys_polled_queue_work(bdev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void gpio_keys_irq_close(struct gpio_keys_button_dev *bdev)
|
||||
{
|
||||
struct gpio_keys_platform_data *pdata = bdev->pdata;
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < pdata->nbuttons; i++) {
|
||||
struct gpio_keys_button_data *bdata = &bdev->data[i];
|
||||
|
||||
disable_irq(bdata->irq);
|
||||
cancel_delayed_work_sync(&bdata->work);
|
||||
}
|
||||
}
|
||||
|
||||
static int gpio_keys_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct gpio_keys_button_dev *bdev = platform_get_drvdata(pdev);
|
||||
@ -620,6 +690,8 @@ static int gpio_keys_remove(struct platform_device *pdev)
|
||||
|
||||
if (bdev->polled)
|
||||
gpio_keys_polled_close(bdev);
|
||||
else
|
||||
gpio_keys_irq_close(bdev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=openssl
|
||||
PKG_BASE:=1.1.1
|
||||
PKG_BUGFIX:=k
|
||||
PKG_BUGFIX:=l
|
||||
PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX)
|
||||
PKG_RELEASE:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
@ -28,7 +28,7 @@ PKG_SOURCE_URL:= \
|
||||
ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/ \
|
||||
ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/old/$(PKG_BASE)/
|
||||
|
||||
PKG_HASH:=892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5
|
||||
PKG_HASH:=0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1
|
||||
|
||||
PKG_LICENSE:=OpenSSL
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
From 1c2fabcdb34e436286b4a8760cfbfbff11ea551a Mon Sep 17 00:00:00 2001
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Eneas U de Queiroz <cote2004-github@yahoo.com>
|
||||
Date: Sat, 3 Nov 2018 15:41:10 -0300
|
||||
Subject: eng_devcrypto: add configuration options
|
||||
@ -14,7 +14,6 @@ Reviewed-by: Richard Levitte <levitte@openssl.org>
|
||||
(Merged from https://github.com/openssl/openssl/pull/7585)
|
||||
|
||||
diff --git a/crypto/engine/eng_devcrypto.c b/crypto/engine/eng_devcrypto.c
|
||||
index a2c9a966f7..5ec38ca8f3 100644
|
||||
--- a/crypto/engine/eng_devcrypto.c
|
||||
+++ b/crypto/engine/eng_devcrypto.c
|
||||
@@ -16,6 +16,7 @@
|
||||
@ -558,7 +557,7 @@ index a2c9a966f7..5ec38ca8f3 100644
|
||||
/******************************************************************************
|
||||
*
|
||||
* LOAD / UNLOAD
|
||||
@@ -793,6 +1109,8 @@ void engine_load_devcrypto_int()
|
||||
@@ -806,6 +1122,8 @@ void engine_load_devcrypto_int()
|
||||
|
||||
if (!ENGINE_set_id(e, "devcrypto")
|
||||
|| !ENGINE_set_name(e, "/dev/crypto engine")
|
||||
|
||||
@ -0,0 +1,123 @@
|
||||
From fa8f23284d4689c2a737204b337b58d966dcbd8c Mon Sep 17 00:00:00 2001
|
||||
From: Sean Parkinson <sean@wolfssl.com>
|
||||
Date: Fri, 20 Aug 2021 10:23:38 +1000
|
||||
Subject: [PATCH] Maths x86 asm: change asm snippets to get compiling
|
||||
|
||||
TFM:
|
||||
Use register or memory for c0, c1, c2 in SQRADD and SQRADD2.
|
||||
SP:
|
||||
Use register or memory for vl, vh, vo in SP_ASM_MUL_ADD,
|
||||
SP_ASM_MUL_ADD2 and SP_ASM_SQR_ADD.
|
||||
---
|
||||
wolfcrypt/src/asm.c | 29 ++++++++++++++++++++---------
|
||||
wolfcrypt/src/sp_int.c | 6 +++---
|
||||
2 files changed, 23 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/wolfcrypt/src/asm.c b/wolfcrypt/src/asm.c
|
||||
index b7f53d073..a37e75e02 100644
|
||||
--- a/wolfcrypt/src/asm.c
|
||||
+++ b/wolfcrypt/src/asm.c
|
||||
@@ -698,33 +698,39 @@ __asm__( \
|
||||
|
||||
#define SQRADD(i, j) \
|
||||
__asm__( \
|
||||
- "movl %6,%%eax \n\t" \
|
||||
+ "movl %3,%%eax \n\t" \
|
||||
"mull %%eax \n\t" \
|
||||
"addl %%eax,%0 \n\t" \
|
||||
"adcl %%edx,%1 \n\t" \
|
||||
"adcl $0,%2 \n\t" \
|
||||
- :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i) :"%eax","%edx","cc");
|
||||
+ :"+rm"(c0), "+rm"(c1), "+rm"(c2) \
|
||||
+ : "m"(i) \
|
||||
+ :"%eax","%edx","cc");
|
||||
|
||||
#define SQRADD2(i, j) \
|
||||
__asm__( \
|
||||
- "movl %6,%%eax \n\t" \
|
||||
- "mull %7 \n\t" \
|
||||
+ "movl %3,%%eax \n\t" \
|
||||
+ "mull %4 \n\t" \
|
||||
"addl %%eax,%0 \n\t" \
|
||||
"adcl %%edx,%1 \n\t" \
|
||||
"adcl $0,%2 \n\t" \
|
||||
"addl %%eax,%0 \n\t" \
|
||||
"adcl %%edx,%1 \n\t" \
|
||||
"adcl $0,%2 \n\t" \
|
||||
- :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%edx", "cc");
|
||||
+ :"+rm"(c0), "+rm"(c1), "+rm"(c2) \
|
||||
+ : "m"(i), "m"(j) \
|
||||
+ :"%eax","%edx", "cc");
|
||||
|
||||
#define SQRADDSC(i, j) \
|
||||
-__asm__( \
|
||||
+__asm__( \
|
||||
"movl %3,%%eax \n\t" \
|
||||
"mull %4 \n\t" \
|
||||
"movl %%eax,%0 \n\t" \
|
||||
"movl %%edx,%1 \n\t" \
|
||||
"xorl %2,%2 \n\t" \
|
||||
- :"=r"(sc0), "=r"(sc1), "=r"(sc2): "g"(i), "g"(j) :"%eax","%edx","cc");
|
||||
+ :"=r"(sc0), "=r"(sc1), "=r"(sc2) \
|
||||
+ : "g"(i), "g"(j) \
|
||||
+ :"%eax","%edx","cc");
|
||||
|
||||
#define SQRADDAC(i, j) \
|
||||
__asm__( \
|
||||
@@ -733,7 +739,9 @@ __asm__( \
|
||||
"addl %%eax,%0 \n\t" \
|
||||
"adcl %%edx,%1 \n\t" \
|
||||
"adcl $0,%2 \n\t" \
|
||||
- :"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%eax","%edx","cc");
|
||||
+ :"=r"(sc0), "=r"(sc1), "=r"(sc2) \
|
||||
+ : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
|
||||
+ :"%eax","%edx","cc");
|
||||
|
||||
#define SQRADDDB \
|
||||
__asm__( \
|
||||
@@ -743,7 +751,10 @@ __asm__( \
|
||||
"addl %6,%0 \n\t" \
|
||||
"adcl %7,%1 \n\t" \
|
||||
"adcl %8,%2 \n\t" \
|
||||
- :"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) : "cc");
|
||||
+ :"=r"(c0), "=r"(c1), "=r"(c2) \
|
||||
+ : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), \
|
||||
+ "r"(sc2) \
|
||||
+ : "cc");
|
||||
|
||||
#elif defined(TFM_X86_64)
|
||||
/* x86-64 optimized */
|
||||
diff --git a/wolfcrypt/src/sp_int.c b/wolfcrypt/src/sp_int.c
|
||||
index 6070faaa9..d26702e47 100644
|
||||
--- a/wolfcrypt/src/sp_int.c
|
||||
+++ b/wolfcrypt/src/sp_int.c
|
||||
@@ -477,7 +477,7 @@ static WC_INLINE sp_int_digit sp_div_word(sp_int_digit hi, sp_int_digit lo,
|
||||
"addl %%eax, %[l] \n\t" \
|
||||
"adcl %%edx, %[h] \n\t" \
|
||||
"adcl $0 , %[o] \n\t" \
|
||||
- : [l] "+r" (vl), [h] "+r" (vh), [o] "+r" (vo) \
|
||||
+ : [l] "+rm" (vl), [h] "+rm" (vh), [o] "+rm" (vo) \
|
||||
: [a] "r" (va), [b] "r" (vb) \
|
||||
: "eax", "edx", "cc" \
|
||||
)
|
||||
@@ -503,7 +503,7 @@ static WC_INLINE sp_int_digit sp_div_word(sp_int_digit hi, sp_int_digit lo,
|
||||
"addl %%eax, %[l] \n\t" \
|
||||
"adcl %%edx, %[h] \n\t" \
|
||||
"adcl $0 , %[o] \n\t" \
|
||||
- : [l] "+r" (vl), [h] "+r" (vh), [o] "+r" (vo) \
|
||||
+ : [l] "+rm" (vl), [h] "+rm" (vh), [o] "+rm" (vo) \
|
||||
: [a] "r" (va), [b] "r" (vb) \
|
||||
: "eax", "edx", "cc" \
|
||||
)
|
||||
@@ -542,7 +542,7 @@ static WC_INLINE sp_int_digit sp_div_word(sp_int_digit hi, sp_int_digit lo,
|
||||
"addl %%eax, %[l] \n\t" \
|
||||
"adcl %%edx, %[h] \n\t" \
|
||||
"adcl $0 , %[o] \n\t" \
|
||||
- : [l] "+r" (vl), [h] "+r" (vh), [o] "+r" (vo) \
|
||||
+ : [l] "+rm" (vl), [h] "+rm" (vh), [o] "+rm" (vo) \
|
||||
: [a] "m" (va) \
|
||||
: "eax", "edx", "cc" \
|
||||
)
|
||||
--
|
||||
2.31.1
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=6in4
|
||||
PKG_RELEASE:=26
|
||||
PKG_RELEASE:=27
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@ -138,6 +138,8 @@ proto_6in4_setup() {
|
||||
|
||||
proto_6in4_teardown() {
|
||||
local cfg="$1"
|
||||
local link="6in4-$cfg"
|
||||
ip link del $link
|
||||
}
|
||||
|
||||
proto_6in4_init_config() {
|
||||
|
||||
@ -106,14 +106,12 @@ CONFIGURE_ARGS += \
|
||||
# remove protocol idented software version number:
|
||||
# - LOCAL_IDENT
|
||||
# disable legacy/unsafe methods and unused functionality:
|
||||
# - INETD_MODE
|
||||
# - DROPBEAR_CLI_NETCAT
|
||||
# - DROPBEAR_DSS
|
||||
# - DO_MOTD
|
||||
DB_OPT_COMMON = \
|
||||
DEFAULT_PATH|"$(TARGET_INIT_PATH)" \
|
||||
!!LOCAL_IDENT|"SSH-2.0-dropbear" \
|
||||
INETD_MODE|0 \
|
||||
DROPBEAR_CLI_NETCAT|0 \
|
||||
DROPBEAR_DSS|0 \
|
||||
DO_MOTD|0 \
|
||||
|
||||
@ -8,12 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=lldpd
|
||||
PKG_VERSION:=1.0.9
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=1.0.12
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://media.luffy.cx/files/lldpd
|
||||
PKG_HASH:=6b64eb3125952b1e33472198b054e8aa0dee45f45d3d4be22789090a474949f5
|
||||
PKG_HASH:=d194c65b5b9c98d194a2842ddc75ba17ebdee7ebd5499f81a98d24031628daf1
|
||||
|
||||
PKG_MAINTAINER:=Stijn Tintel <stijn@linux-ipv6.be>
|
||||
PKG_LICENSE:=ISC
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=uhttpd
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/uhttpd.git
|
||||
|
||||
@ -187,7 +187,8 @@ start_instance()
|
||||
append_bool "$cfg" redirect_https "-q" 0
|
||||
}
|
||||
|
||||
for file in /etc/uhttpd/*.json; do
|
||||
config_get json_script "$cfg" json_script
|
||||
for file in $json_script; do
|
||||
[ -s "$file" ] && procd_append_param command -H "$file"
|
||||
done
|
||||
|
||||
|
||||
41
package/network/services/ustp/Makefile
Normal file
41
package/network/services/ustp/Makefile
Normal file
@ -0,0 +1,41 @@
|
||||
#
|
||||
# Copyright (C) 2021 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ustp
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/ustp.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2021-08-25
|
||||
PKG_SOURCE_VERSION:=9622264cf92691f18ae9222b0a4c9db95af5d80d
|
||||
PKG_MIRROR_HASH:=de4ed29eee21192b60e8683633d916d251bcccd5701bdac83b5ba435189297f1
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/ustp
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=OpenWrt STP/RSTP daemon
|
||||
DEPENDS:=+libubox +libubus
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include -flto
|
||||
TARGET_LDFLAGS += -flto -fuse-linker-plugin
|
||||
|
||||
define Package/ustp/install
|
||||
$(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ipkg-install/sbin/* $(1)/sbin/
|
||||
$(INSTALL_BIN) ./files/ustpd.init $(1)/etc/init.d/ustpd
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ustp))
|
||||
14
package/network/services/ustp/files/ustpd.init
Normal file
14
package/network/services/ustp/files/ustpd.init
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (c) 2021 OpenWrt.org
|
||||
|
||||
START=50
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/sbin/ustpd
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG"
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
@ -38,7 +38,6 @@ define Package/ethtool-full
|
||||
TITLE += (full)
|
||||
VARIANT:=full
|
||||
PROVIDES:=ethtool
|
||||
CONFLICTS:=ethtool
|
||||
DEPENDS:=+libmnl
|
||||
endef
|
||||
|
||||
|
||||
@ -5,9 +5,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/umbim.git
|
||||
PKG_SOURCE_DATE:=2019-09-11
|
||||
PKG_SOURCE_VERSION:=184b707ddaa0acee84d02e0ffe599cb8b67782bd
|
||||
PKG_MIRROR_HASH:=482ff69144f81fafed99035840f5a24e772472f2df2f3ac0219d6de791ac5835
|
||||
PKG_SOURCE_DATE:=2021-08-18
|
||||
PKG_SOURCE_VERSION:=de5623104baee6e0c13c92f05c15bf4b4145c0b1
|
||||
PKG_MIRROR_HASH:=2d4a75d2b53c8413521a2fd138895e327bff3f4b4d29a540342b2d2e1e009852
|
||||
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=selinux-policy
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://git.defensec.nl/selinux-policy.git
|
||||
PKG_VERSION:=0.8
|
||||
PKG_MIRROR_HASH:=3b58f751a21394e3aef47fd6c9fe9430fadde6427deb5c79f08478904837ec91
|
||||
PKG_VERSION:=0.9
|
||||
PKG_MIRROR_HASH:=f1a37a4fc104fbacde3012178fc117b473899360f26a8735156394288441d99c
|
||||
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
|
||||
PKG_BUILD_DEPENDS:=secilc/host policycoreutils/host
|
||||
|
||||
|
||||
@ -18,9 +18,6 @@ PKG_BUILD_DEPENDS:=BUSYBOX_CONFIG_PAM:libpam
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_CHECK_FORMAT_SECURITY:=0
|
||||
|
||||
#Busybox use it's own PIE config flag and LDFLAGS are used with ld, not gcc.
|
||||
PKG_ASLR_PIE:=0
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE archival/libarchive/bz/LICENSE
|
||||
PKG_CPE_ID:=cpe:/a:busybox:busybox
|
||||
|
||||
@ -136,7 +136,7 @@ $(BIN_DIR)/$(SDK_NAME).tar.xz: clean
|
||||
$(SDK_BUILD_DIR)/target/linux/*/patches*
|
||||
./convert-config.pl $(TOPDIR)/.config > $(SDK_BUILD_DIR)/Config-build.in
|
||||
$(CP) -L \
|
||||
$(TOPDIR)/LICENSE \
|
||||
$(TOPDIR)/LICENSES \
|
||||
$(TOPDIR)/rules.mk \
|
||||
./files/Config.in \
|
||||
./files/Makefile \
|
||||
|
||||
Loading…
Reference in New Issue
Block a user