Received: by 10.223.164.202 with SMTP id h10csp1193608wrb; Tue, 7 Nov 2017 23:51:48 -0800 (PST) X-Google-Smtp-Source: ABhQp+SelK7IhIbNRh4JY9BmKizlE1/QyD1ks6eJJyn59Nm9CJXS9CD+DDcEuaGQQjzfrjkAq0lP X-Received: by 10.84.140.235 with SMTP id 98mr1474670plt.428.1510127508131; Tue, 07 Nov 2017 23:51:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510127508; cv=none; d=google.com; s=arc-20160816; b=DoA949cL1h9p6+QkfGCG0vuj+ltQDHxU0IJeLyKK/qqdgVEThw2EVv+SputuGrD0AT w54jeAaMKuV9JX2Dhi2D2dbV5sGl2hZ33ufkm5aimWFfn+r+L7GU47bb3RB58+j2zRug Yju2/8HiAZBmZ0AxzdfSfr9Hr2Qe1yVDajTura9lJKtt9w6yp+NO43j6j9huGUJ1xLT7 HdJlXR/N15xf/8gLiQZOhk5qd8vHk4fizaAaKiUovJDs09mZsNzsJAi9lZ1mwG39E/li PtrUXYYmu+PyTg+Us49OpzqOS6KbR870XmPKijiXr13yo8vyJvah0ijEx1gAaeqgmcRx VuFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=a1FgkYlYxlGT1kWhGiXILNIHorP52G4t4nYrihEtBiQ=; b=ngssSGcsINHrW59Ex/goMSu5exvVdH/DrPU6tEM1uwyYpgPeBS3mBeGbKHvr2fcuam 5htH1/WJqpHP1zzZXGGnYKz5vR/zzkoI4c0XH0Ps8wUa4j2bc7P93zK3CR7Sx+etkHvx 6Hh26MqFAYBdmwhrRduQbw7whE7gB+0+yl76K2q7dDK2fdV35FLlrDe/rd8eYgYy/mh2 /tClgnVLMJfmc9O5l6q79R9N4wH7ifQccy0HFnWmopVguQCuqcQY73zovM1NNaBdY5jN LafKDvS183fpk+DW7IEhyuq0aCsheJ9LYc/vthQA0MPZnk+ehLcuEMPJwnUPCDMmr4yQ +m+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=abKbxORT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b187si3422267pfg.335.2017.11.07.23.51.35; Tue, 07 Nov 2017 23:51:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=abKbxORT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754843AbdKHGXn (ORCPT + 91 others); Wed, 8 Nov 2017 01:23:43 -0500 Received: from mail-pl0-f67.google.com ([209.85.160.67]:45532 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754270AbdKHGU6 (ORCPT ); Wed, 8 Nov 2017 01:20:58 -0500 Received: by mail-pl0-f67.google.com with SMTP id 30so668133pla.2; Tue, 07 Nov 2017 22:20:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=a1FgkYlYxlGT1kWhGiXILNIHorP52G4t4nYrihEtBiQ=; b=abKbxORTGATyUqEnpyB9mo+LGAabmY4RXefNkN18EGGA2nYAA0xZNfragz3aRMWd/k pnuzN+MUIsC3s/xRdBbz7lNf6eNu+8jF34Fvg2gDZR+uBZshSRQQhyFAxam8wQho4sPW vSSRsgCistL+oy5Vaq1U0HGLzbeYRkIoWMLvlN2NVkqp2EdYB6RLFx5YI+uiZ8m2HTud 8Qb8PDAHEM7Y+NkLuFH8znvSOtVrULSbSHOdu/wthXSDBbF4i49crfP7E9SE7Edj6MuX fEjGyR3Gvw1+7Uu9FcvE43V9VkUWrExkw+vGszLMiI44T5ZKe+LDhUIHv/sgTDKn5cKY gt2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=a1FgkYlYxlGT1kWhGiXILNIHorP52G4t4nYrihEtBiQ=; b=l9a0oNGyeocQ7o3eXruNEby5R0SX7EcjTVnO+jKrwNOtZuWomiSEEoFBlQiGl7e6rB ROylK06Zi+9lAs22eaSp8JGucLZ4h4uc50/zdvh4DmLGj9ePoxTeDCYulTnRujeQB3Gh x/SKqwXTo5nkmmwB6xYkW7Y1HVa76npPMl6dYFA0ePHDgoVzwKlgWhwOmuBLVP5hJQyU rj6e5W6sKkg6ChIyYpH7IDOicc4KPXGm6HM5lxB4t4QYClekHgPca7pUzDwgXhXt014S W8072eOloX0/1ehmcmkZ6kFiLh1xA+2WDSP/0/MWJYDX4dtQlY7+hP20X6F2hf6fgsFo ol4w== X-Gm-Message-State: AJaThX41LWkjogGe4uUKPGdbm0n1RNyRuJyKqjLiVdY3CdNaih7cPA1q 9btG24a9dzD9HZI133Ux9WWFG9sw X-Received: by 10.84.168.129 with SMTP id f1mr1233383plb.71.1510122057344; Tue, 07 Nov 2017 22:20:57 -0800 (PST) Received: from app09.andestech.com ([118.163.51.199]) by smtp.gmail.com with ESMTPSA id a4sm6581339pfj.72.2017.11.07.22.20.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Nov 2017 22:20:56 -0800 (PST) From: Greentime Hu To: greentime@andestech.com, linux-kernel@vger.kernel.org, arnd@arndb.de, linux-arch@vger.kernel.org, tglx@linutronix.de, jason@lakedaemon.net, marc.zyngier@arm.com, robh+dt@kernel.org, netdev@vger.kernel.org Cc: green.hu@gmail.com, Vincent Chen Subject: [PATCH 24/31] nds32: Miscellaneous header files Date: Wed, 8 Nov 2017 13:55:12 +0800 Message-Id: <6f3f5675b73bc7fe895c615b0d48f93966499782.1510118606.git.green.hu@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greentime Hu Signed-off-by: Vincent Chen Signed-off-by: Greentime Hu --- arch/nds32/include/asm/delay.h | 51 +++++++++++++++++++++++++++++ arch/nds32/include/asm/linkage.h | 24 ++++++++++++++ arch/nds32/include/uapi/asm/byteorder.h | 26 +++++++++++++++ arch/nds32/include/uapi/asm/posix_types.h | 41 +++++++++++++++++++++++ 4 files changed, 142 insertions(+) create mode 100644 arch/nds32/include/asm/delay.h create mode 100644 arch/nds32/include/asm/linkage.h create mode 100644 arch/nds32/include/uapi/asm/byteorder.h create mode 100644 arch/nds32/include/uapi/asm/posix_types.h diff --git a/arch/nds32/include/asm/delay.h b/arch/nds32/include/asm/delay.h new file mode 100644 index 0000000..bdeeb76 --- /dev/null +++ b/arch/nds32/include/asm/delay.h @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2005-2017 Andes Technology Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef __NDS32_DELAY_H__ +#define __NDS32_DELAY_H__ + +#include + +static inline void __delay(unsigned long loops) +{ + __asm__ __volatile__(".align 2\n" + "1:\n" + "\taddi\t%0, %0, -1\n" + "\tbgtz\t%0, 1b\n" + :"=r"(loops) + :"0"(loops)); +} + +static inline void __udelay(unsigned long usecs, unsigned long lpj) +{ + usecs *= (unsigned long)(((0x8000000000000000ULL / (500000 / HZ)) + + 0x80000000ULL) >> 32); + usecs = (unsigned long)(((unsigned long long)usecs * lpj) >> 32); + __delay(usecs); +} + +#define udelay(usecs) __udelay((usecs), loops_per_jiffy) + +/* make sure "usecs *= ..." in udelay do not overflow. */ +#if HZ >= 1000 +#define MAX_UDELAY_MS 1 +#elif HZ <= 200 +#define MAX_UDELAY_MS 5 +#else +#define MAX_UDELAY_MS (1000 / HZ) +#endif + +#endif diff --git a/arch/nds32/include/asm/linkage.h b/arch/nds32/include/asm/linkage.h new file mode 100644 index 0000000..d17abd8 --- /dev/null +++ b/arch/nds32/include/asm/linkage.h @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2005-2017 Andes Technology Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef __ASM_LINKAGE_H +#define __ASM_LINKAGE_H + +/* This file is required by include/linux/linkage.h */ +#define __ALIGN .align 2 +#define __ALIGN_STR ".align 2" + +#endif diff --git a/arch/nds32/include/uapi/asm/byteorder.h b/arch/nds32/include/uapi/asm/byteorder.h new file mode 100644 index 0000000..198e8dd --- /dev/null +++ b/arch/nds32/include/uapi/asm/byteorder.h @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2005-2017 Andes Technology Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef __NDS32_BYTEORDER_H__ +#define __NDS32_BYTEORDER_H__ + +#ifdef __NDS32_EB__ +#include +#else +#include +#endif + +#endif /* __NDS32_BYTEORDER_H__ */ diff --git a/arch/nds32/include/uapi/asm/posix_types.h b/arch/nds32/include/uapi/asm/posix_types.h new file mode 100644 index 0000000..d0aca66 --- /dev/null +++ b/arch/nds32/include/uapi/asm/posix_types.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2005-2017 Andes Technology Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef __ARCH_NDS32_POSIX_TYPES_H +#define __ARCH_NDS32_POSIX_TYPES_H + +/* + * This file is generally used by user-level software, so you need to + * be a little careful about namespace pollution etc. Also, we cannot + * assume GCC is being used. + */ + +typedef unsigned short __kernel_mode_t; +#define __kernel_mode_t __kernel_mode_t + +typedef unsigned short __kernel_ipc_pid_t; +#define __kernel_ipc_pid_t __kernel_ipc_pid_t + +typedef unsigned short __kernel_uid_t; +typedef unsigned short __kernel_gid_t; +#define __kernel_uid_t __kernel_uid_t + +typedef unsigned short __kernel_old_dev_t; +#define __kernel_old_dev_t __kernel_old_dev_t + +#include + +#endif -- 1.7.9.5 From 1584802585752729257@xxx Wed Nov 22 21:18:42 +0000 2017 X-GM-THRID: 1584802585752729257 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread