From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id E3442A0679 for ; Thu, 28 Mar 2019 20:29:54 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AD0912C19; Thu, 28 Mar 2019 20:29:54 +0100 (CET) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-eopbgr780090.outbound.protection.outlook.com [40.107.78.90]) by dpdk.org (Postfix) with ESMTP id 131AC1DB8 for ; Thu, 28 Mar 2019 20:29:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0lXJxZoV8vvGrC7r6YAWqjZxsqQkcHbXBEl5WGwBsyI=; b=BEd6eBmE6rxoH4XJ5AwQ/SCxiXReLdo4KjmfQXUSJwjemoCg7aXel4ozln/PSgKsJvnxZKC3G0Tet1Tkjb7ZyhoX+Jg0wTF6kOqAJQ57Bnc5+sO5r/iKMq9qmNFBsUSeaM6begv9wuj5I0LbF7jnkuysQ05/SPNLGwz1ihIhnkM= ARC-Seal: i=1; a=rsa-sha256; s=testarcselector01; d=microsoft.com; cv=none; b=NuOy0Gj7Y7oq11yjVCR+oo6GeV/8bDTFv8YrWTi742BF3ruwrv+JbLzqZJ4B1Km6aRgLJfIyeowraEWKBfz+YlAdj3cUdscGweTIJyQeXqh0MslyxV1YZ2UE3Vz6ZLFlTn89fkCAsGBUSEAMtsMH6siGLsVNUPpqaG3fDP/dvl4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=testarcselector01; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0lXJxZoV8vvGrC7r6YAWqjZxsqQkcHbXBEl5WGwBsyI=; b=MbZou1twux5f5Q6ZZou1llvCDzc30f1cEConoz2IQNER1wgkXZLHDEwVkpMa3LfBz137t/yPAD3+hJCbZcjCaY2c7B07/Cy6/cf7Qhb4B27tFyDprNq4nuLzLEMkdpxWtCLW3h86uCw5AJ1rgOn+yDzqkNSuma0/9ap1apRBiF4= ARC-Authentication-Results: =?us-ascii?Q?i=3D1; _test.office365.com_1; =0D=0A=09=09dmarc=3Dnone_action?= =?us-ascii?Q?=3Dnone_header.from=3Dmicrosoft.com;=0D=0A=09=09arc=3Dnone?= Received: from MWHPR21MB0638.namprd21.prod.outlook.com (10.175.141.139) by MWHPR21MB0175.namprd21.prod.outlook.com (10.173.52.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1771.3; Thu, 28 Mar 2019 19:29:51 +0000 Received: from MWHPR21MB0638.namprd21.prod.outlook.com ([fe80::c4e7:ece1:887e:b983]) by MWHPR21MB0638.namprd21.prod.outlook.com ([fe80::c4e7:ece1:887e:b983%3]) with mapi id 15.20.1771.002; Thu, 28 Mar 2019 19:29:51 +0000 From: Harini Ramakrishnan To: Anand Rawat , "dev@dpdk.org" CC: "pallavi.kadam@intel.com" , "ranjit.menon@intel.com" , "jeffrey.b.shaw@intel.com" , "bruce.richardson@intel.com" , "thomas@monjalon.net" Thread-Topic: [dpdk-dev] [PATCH v6 5/8] eal: add headers for compatibility with windows Thread-Index: AQHU5Q0K26beYlobiESZUHsrWDQDhqYhbvDA Date: Thu, 28 Mar 2019 19:29:51 +0000 Message-ID: References: <20190306041634.12976-1-anand.rawat@intel.com> <20190328022115.4660-1-anand.rawat@intel.com> <20190328022115.4660-6-anand.rawat@intel.com> In-Reply-To: <20190328022115.4660-6-anand.rawat@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=haramakr@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2019-03-28T19:29:49.2490032Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=2307457c-1da1-4b2b-8811-eed72530a828; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic x-originating-ip: [2001:4898:80e8:a:84e2:1334:627:d48e] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b3232d29-ccda-4134-27ce-08d6b3b3bf92 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:MWHPR21MB0175; x-ms-traffictypediagnostic: MWHPR21MB0175: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1201; x-forefront-prvs: 0990C54589 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39860400002)(346002)(136003)(396003)(376002)(366004)(189003)(199004)(13464003)(186003)(68736007)(72206003)(6246003)(256004)(25786009)(106356001)(71200400001)(105586002)(446003)(81156014)(5660300002)(71190400001)(53546011)(4326008)(110136005)(22452003)(8990500004)(316002)(10090500001)(81166006)(86362001)(486006)(476003)(86612001)(55016002)(11346002)(8936002)(53936002)(9686003)(6116002)(99286004)(14454004)(2501003)(33656002)(478600001)(6506007)(54906003)(229853002)(76176011)(74316002)(102836004)(97736004)(305945005)(7736002)(7696005)(52536014)(46003)(6346003)(2906002)(6436002)(10290500003); DIR:OUT; SFP:1102; SCL:1; SRVR:MWHPR21MB0175; H:MWHPR21MB0638.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Harini.Ramakrishnan@microsoft.com; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: kXPSfJVBY3rvYrbWDih4hpIoDkjVoTaWryjBLmLoCMdzU9/pyBfs4GaPUMi2DVM0CjGRus3xc7CyBI4ARBp6qSdRkCojwBOLtVfh7TMsZmjFBcmtu4cD93DY6lyJvPOdrnGWRQWeCa3ACFHibroP6jKpWBg6ed6BlUnn7sIfn0yeRoiHe1aLfuZ3ygeEMGuKtgdOTdIG2qTkRcchbkiStU67WytT9DrO6s4OEkG3vGcNohHHvZH5itYRzCuLgk4VHKgHKorqRwCO1YXJYBQZLl0w7UVXw8ij3BDzvA1ZP0N9D2bc26WuRO/9B6RVHWsTKfkiRnzBRh1PlniloCT5bwam4bHkQqMpi26xItdw5MQj9Ebe3ULx/9h96ZZR3yuFEdGLN2ZljzV5qDGSiSznK0ChCc9Jev2RL3Y/jpO5cZg= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: b3232d29-ccda-4134-27ce-08d6b3b3bf92 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Mar 2019 19:29:51.3417 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR21MB0175 Subject: Re: [dpdk-dev] [PATCH v6 5/8] eal: add headers for compatibility with windows X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190328192951.3RMStLzDlkOTLZTAlW-w31AyHXJSOOibpMbW-IIQbsc@z> Acked-by: Harini Ramakrishnan -----Original Message----- From: dev On Behalf Of Anand Rawat Sent: Wednesday, March 27, 2019 7:21 PM To: dev@dpdk.org Cc: anand.rawat@intel.com; pallavi.kadam@intel.com; ranjit.menon@intel.com;= jeffrey.b.shaw@intel.com; bruce.richardson@intel.com; thomas@monjalon.net Subject: [dpdk-dev] [PATCH v6 5/8] eal: add headers for compatibility with = windows Added headers to support windows environment for common source. These headers will have windows specific implementions of the system librar= y apis provided in linux and freebsd. Signed-off-by: Anand Rawat Signed-off-by: Pallavi Kadam Reviewed-by: Jeff Shaw Reviewed-by: Ranjit Menon --- .../windows/eal/include/exec-env/fnmatch.h | 43 ++++++++++ .../windows/eal/include/exec-env/pthread.h | 22 +++++ .../windows/eal/include/exec-env/regex.h | 83 +++++++++++++++++++ .../windows/eal/include/exec-env/sched.h | 41 +++++++++ .../windows/eal/include/exec-env/unistd.h | 8 ++ 5 files changed, 197 insertions(+) create mode 100644 lib/librte_eal/windows/eal/include/exec-env/fnmatch.h create mode 100644 lib/librte_eal/windows/eal/include/exec-env/pthread.h create mode 100644 lib/librte_eal/windows/eal/include/exec-env/regex.h create mode 100644 lib/librte_eal/windows/eal/include/exec-env/sched.h create mode 100644 lib/librte_eal/windows/eal/include/exec-env/unistd.h diff --git a/lib/librte_eal/windows/eal/include/exec-env/fnmatch.h b/lib/li= brte_eal/windows/eal/include/exec-env/fnmatch.h new file mode 100644 index 000000000..c2e2131b1 --- /dev/null +++ b/lib/librte_eal/windows/eal/include/exec-env/fnmatch.h @@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2019 Intel Corporation + */ + +#ifndef _FNMATCH_H_ +#define _FNMATCH_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define FNM_NOMATCH 1 + +/** + * This function is used for searhing a given string source + * with the given regular expression pattern. + * + * @param pattern + * regular expression notation decribing the pattern to match + * + * @param string + * source string to searcg for the pattern + * + * @param flag + * containing information about the pattern + * + * @return + * if the pattern is found then return 0 or else FNM_NOMATCH + */ +static inline int fnmatch(__rte_unused const char *pattern, + __rte_unused const char *string, + __rte_unused int flags) +{ + /* TODO */ + /* This is a stub, not the expected result */ + return FNM_NOMATCH; +} + +#ifdef __cplusplus +} +#endif + +#endif /* _FNMATCH_H_ */ diff --git a/lib/librte_eal/windows/eal/include/exec-env/pthread.h b/lib/li= brte_eal/windows/eal/include/exec-env/pthread.h new file mode 100644 index 000000000..a62b25bf6 --- /dev/null +++ b/lib/librte_eal/windows/eal/include/exec-env/pthread.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2019 Intel Corporation + */ + +#ifndef _PTHREAD_H_ +#define _PTHREAD_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* defining pthread_t type on windows */ typedef uintptr_t pthread_t; + +/* defining pthread_attr_t type on windows */ typedef void=20 +*pthread_attr_t; + +#ifdef __cplusplus +} +#endif + +#endif /* _PTHREAD_H_ */ diff --git a/lib/librte_eal/windows/eal/include/exec-env/regex.h b/lib/libr= te_eal/windows/eal/include/exec-env/regex.h new file mode 100644 index 000000000..daa102f74 --- /dev/null +++ b/lib/librte_eal/windows/eal/include/exec-env/regex.h @@ -0,0 +1,83 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2019 Intel Corporation + */ + +#ifndef _REGEX_H_ +#define _REGEX_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define REG_NOMATCH 1 +#define REG_ESPACE 12 + +/* defining regex_t for windows */ +typedef void *regex_t; +/* defining regmatch_t for windows */ +typedef void *regmatch_t; + +/** + * The regcomp() function will compile the regular expression + * contained in the string pointed to by the pattern argument + * and place the results in the structure pointed to by preg. + * The cflags argument is the bitwise inclusive OR of zero or + * more of the flags + */ +static inline int regcomp(__rte_unused regex_t *preg, + __rte_unused const char *regex, __rte_unused int cflags) { + /* TODO */ + /* This is a stub, not the expected result */ + return REG_ESPACE; +} + +/** + * The regexec() function compares the null-terminated string + * specified by string with the compiled regular expression + * preg initialised by a previous call to regcomp(). If it finds + * a match, regexec() returns 0; otherwise it returns non-zero + * indicating either no match or an error. The eflags argument + * is the bitwise inclusive OR of zero or more of the flags. + */ +static inline int regexec(__rte_unused const regex_t *preg, + __rte_unused const char *string, __rte_unused size_t nmatch, + __rte_unused regmatch_t pmatch[], __rte_unused int eflags) { + /* TODO */ + /* This is a stub, not the expected result */ + return REG_NOMATCH; +} + +/** + * The regerror() function provides a mapping from error codes + * returned by regcomp() and regexec() to unspecified printable strings. + */ +static inline size_t regerror(__rte_unused int errcode, + __rte_unused const regex_t *preg, char *errbuf, + __rte_unused size_t errbuf_size) +{ + /* TODO */ + /* This is a stub, not the expected result */ + if (errbuf) { + *errbuf =3D '\0'; + return 1; + } + return 0; +} + +/** + * The regfree() function frees any memory allocated by regcomp() + * associated with preg. + */ +static inline void regfree(__rte_unused regex_t *preg) { + /* TODO */ + /* This is a stub, not the expected result */ } + +#ifdef __cplusplus +} +#endif + +#endif /* _REGEX_H_ */ diff --git a/lib/librte_eal/windows/eal/include/exec-env/sched.h b/lib/libr= te_eal/windows/eal/include/exec-env/sched.h new file mode 100644 index 000000000..b105c43c3 --- /dev/null +++ b/lib/librte_eal/windows/eal/include/exec-env/sched.h @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2019 Intel Corporation + */ + +#ifndef _SCHED_H_ +#define _SCHED_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef CPU_SET_SIZE +#define CPU_SET_SIZE RTE_MAX_LCORE +#endif + +#define _BITS_PER_SET (sizeof(long long) * 8) #define _BIT_SET_MASK=20 +(_BITS_PER_SET - 1) + +#define _NUM_SETS(b) (((b) + _BIT_SET_MASK) / _BITS_PER_SET) #define=20 +_WHICH_SET(b) ((b) / _BITS_PER_SET) #define _WHICH_BIT(b) ((b) &=20 +(_BITS_PER_SET - 1)) + +typedef struct _rte_cpuset_s { + long long _bits[_NUM_SETS(CPU_SET_SIZE)]; } rte_cpuset_t; + +#define CPU_SET(b, s) ((s)->_bits[_WHICH_SET(b)] |=3D (1LL <<=20 +_WHICH_BIT(b))) + +#define CPU_ZERO(s) \ + do { \ + unsigned int _i; \ + \ + for (_i =3D 0; _i < _NUM_SETS(CPU_SET_SIZE); _i++) \ + (s)->_bits[_i] =3D 0LL; \ + } while (0) + +#ifdef __cplusplus +} +#endif + +#endif /* _SCHED_H_ */ diff --git a/lib/librte_eal/windows/eal/include/exec-env/unistd.h b/lib/lib= rte_eal/windows/eal/include/exec-env/unistd.h new file mode 100644 index 000000000..fe3d9b579 --- /dev/null +++ b/lib/librte_eal/windows/eal/include/exec-env/unistd.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2019 Intel Corporation + */ + +/* Added to support common code on windows */ #ifndef _UNISTD_H_=20 +#define _UNISTD_H_ #endif /* _UNISTD_H_ */ -- 2.17.1.windows.2