From patchwork Thu Jul 25 10:48:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sunshaojie X-Patchwork-Id: 18558 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f198.google.com (mail-ye0-f198.google.com [209.85.213.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EC0CE25DF6 for ; Thu, 25 Jul 2013 10:49:00 +0000 (UTC) Received: by mail-ye0-f198.google.com with SMTP id m13sf460853yen.9 for ; Thu, 25 Jul 2013 03:49:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=DQQNPOMhyO4oxjy3W2B0KseX1c5jrM88wh/Ztu/bpP0=; b=Djmr1r3Ll+4+dVl8mneaG9SNKhoH3FqxdsFYUCQRaZADygNdZH0reQjR9qJGWfkguz wOhIIXjI1WNZ+a9KVuFNw0hBcq6OaucsDpZzDHhGtH/Xx5fREEO9jQAeVkt836xdW+8j /GaVhN4K/eC/Njo/V/ScbwqIDbR6wb/+zCEThrDXjlJHLMflkwrsYJbSILWIn0uAJbab sWALVLfFz+R0icfSTvx5L1xn8IV9Ex7lwJc63vsaXXe9TZfjepdukgAljUh2u8/8GGj8 mzHtFFuz6ZZ2ZVxS4CAThvQ1e9tMAz4IBaIanrqK8tflaQblYaelga2okgQtijaEsAto +RAQ== X-Received: by 10.236.169.196 with SMTP id n44mr23592693yhl.9.1374749340647; Thu, 25 Jul 2013 03:49:00 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.94.163 with SMTP id dd3ls549362qeb.92.gmail; Thu, 25 Jul 2013 03:49:00 -0700 (PDT) X-Received: by 10.58.96.76 with SMTP id dq12mr17369014veb.91.1374749340544; Thu, 25 Jul 2013 03:49:00 -0700 (PDT) Received: from mail-ve0-f178.google.com (mail-ve0-f178.google.com [209.85.128.178]) by mx.google.com with ESMTPS id k4si12151912vdi.119.2013.07.25.03.49.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:49:00 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.178; Received: by mail-ve0-f178.google.com with SMTP id pb11so382233veb.37 for ; Thu, 25 Jul 2013 03:49:00 -0700 (PDT) X-Received: by 10.220.67.10 with SMTP id p10mr208112vci.85.1374749340433; Thu, 25 Jul 2013 03:49:00 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.165.8 with SMTP id yu8csp70960veb; Thu, 25 Jul 2013 03:48:59 -0700 (PDT) X-Received: by 10.66.149.40 with SMTP id tx8mr48933104pab.38.1374749339244; Thu, 25 Jul 2013 03:48:59 -0700 (PDT) Received: from mail-pd0-f175.google.com (mail-pd0-f175.google.com [209.85.192.175]) by mx.google.com with ESMTPS id zu9si8181191pbc.98.2013.07.25.03.48.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:48:59 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.175 is neither permitted nor denied by best guess record for domain of shaojie.sun@linaro.org) client-ip=209.85.192.175; Received: by mail-pd0-f175.google.com with SMTP id 4so1545192pdd.6 for ; Thu, 25 Jul 2013 03:48:58 -0700 (PDT) X-Received: by 10.66.169.70 with SMTP id ac6mr22257344pac.156.1374749338865; Thu, 25 Jul 2013 03:48:58 -0700 (PDT) Received: from localhost.localdomain ([58.251.159.202]) by mx.google.com with ESMTPSA id ts6sm1190298pbc.12.2013.07.25.03.48.55 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:48:58 -0700 (PDT) From: Shaojie Sun To: daniel.lezcano@linaro.org Cc: mike.turquette@linaro.org, amit.kucheria@linaro.org, sunshaojie@huawei.com, patches@linaro.org, Shaojie Sun Subject: [PATCH 2/2] CPU_TOPOLOGY: supported on Android platform. Date: Thu, 25 Jul 2013 18:48:49 +0800 Message-Id: <1374749329-21281-1-git-send-email-shaojie.sun@linaro.com> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQk3PMfl+/KFnK3yCJlM9rWmiKMvPR4nrFjbVnJiB9sL9mszRTquD5t1dXCzuVIfkpWaa8wC X-Original-Sender: shaojie.sun@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , add Android.mk, so we can build it on android platform. Signed-off-by: Shaojie Sun --- Android.mk | 19 +++++++++++++++++++ list.h | 2 ++ topology.c | 4 ---- 3 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 Android.mk diff --git a/Android.mk b/Android.mk new file mode 100644 index 0000000..05d5cfa --- /dev/null +++ b/Android.mk @@ -0,0 +1,19 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + + +LOCAL_MODULE_TAGS := optional +LOCAL_SHARED_LIBRARIES := libstlport + +#LOCAL_STATIC_LIBRARIES := libncurses + +LOCAL_MODULE := cpu_topology + +#LOCAL_CPPFLAGS += -DDEFINE_ETHTOOL_CMD \ + +LOCAL_C_INCLUDES += bionic \ + +LOCAL_SRC_FILES += \ + topology.c + +include $(BUILD_EXECUTABLE) diff --git a/list.h b/list.h index e2d79b1..6db4c62 100644 --- a/list.h +++ b/list.h @@ -336,8 +336,10 @@ static inline void list_splice_tail_init(struct list_head *list, } } +#undef offsetof #define offsetof(s, m) ((size_t)&(((s *)0)->m)) +#undef container_of #define container_of(ptr, type, member) ({ \ const typeof(((type *)0)->member) * __mptr = (ptr); \ (type *)((char *)__mptr - offsetof(type, member)); }) diff --git a/topology.c b/topology.c index ae72dd9..0902541 100644 --- a/topology.c +++ b/topology.c @@ -297,10 +297,6 @@ static int folder_scan(char *path, folder_filter_t filter) if (ret < 0) return -1; - ret = basename(basedir) ? 0 : -1; - if (ret < 0) - goto out_free_basedir; - while (!readdir_r(dir, &dirent, &direntp)) { if (!direntp)