From patchwork Fri Dec 18 21:41:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Creekmore X-Patchwork-Id: 7888781 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 268EE9F387 for ; Fri, 18 Dec 2015 21:44:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3374620382 for ; Fri, 18 Dec 2015 21:44:53 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4FE6B2035D for ; Fri, 18 Dec 2015 21:44:52 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aA2mn-00076Q-NG; Fri, 18 Dec 2015 21:42:01 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aA2ml-00074h-Pa for xen-devel@lists.xenproject.org; Fri, 18 Dec 2015 21:41:59 +0000 Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id 94/39-23747-7AD74765; Fri, 18 Dec 2015 21:41:59 +0000 X-Env-Sender: jonathan.creekmore@gmail.com X-Msg-Ref: server-4.tower-31.messagelabs.com!1450474917!2093784!1 X-Originating-IP: [209.85.160.176] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 3172 invoked from network); 18 Dec 2015 21:41:58 -0000 Received: from mail-yk0-f176.google.com (HELO mail-yk0-f176.google.com) (209.85.160.176) by server-4.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 18 Dec 2015 21:41:58 -0000 Received: by mail-yk0-f176.google.com with SMTP id x184so73928279yka.3 for ; Fri, 18 Dec 2015 13:41:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Lq5o4RPstPmdSpfzpOZSvqEkUFTvXB04B+IhZ5CZDX8=; b=siA/dzdM6lkPndCGEqAAvrHx401RGHpB8A9SPcknx7w56xg/DZvoaX1SavvP4oKIb5 CBgQJhhjfg04yPfkWs/V9HHcs+QGby6eFmXlHb7g88V/OLb4oCn2fPy134SIk6xaN3ds Ml4+4GJRX4HaW7LoLckT8wblm4ywL8KEtDIwpvQFMkLSc8ki9ZpZmV7p60ENE3pPXYRl sJEMiXrQho6wAuWPCVpA6d8+AuWOfDWvGuAaV6w7VPQ6UtkHTYBIy5Fziq77el7jLeCm HgF9Ht3KucKcMbBNKCS10XZbjNd+ckPQDNpRYUlMp84jJVkHR2UjArO49MkTZbg5SbjL Cfqg== X-Received: by 10.129.117.84 with SMTP id q81mr4963906ywc.190.1450474917518; Fri, 18 Dec 2015 13:41:57 -0800 (PST) Received: from Nebula.lan (c-68-34-224-206.hsd1.al.comcast.net. [68.34.224.206]) by smtp.gmail.com with ESMTPSA id i125sm17798672ywi.28.2015.12.18.13.41.56 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Dec 2015 13:41:57 -0800 (PST) From: Jonathan Creekmore To: xen-devel@lists.xenproject.org Date: Fri, 18 Dec 2015 15:41:29 -0600 Message-Id: <1450474890-15491-4-git-send-email-jonathan.creekmore@gmail.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1450474890-15491-1-git-send-email-jonathan.creekmore@gmail.com> References: <1450474890-15491-1-git-send-email-jonathan.creekmore@gmail.com> Cc: George Dunlap , Jonathan Creekmore , Dario Faggioli , Josh Whitehead , Robert VanVossen Subject: [Xen-devel] [PATCH v2 3/4] sched: Register the schedulers into the list X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Adds a simple macro to place a pointer to a scheduler into an array section at compile time. Also, goes ahead and generates the array entries with each of the schedulers. CC: George Dunlap CC: Dario Faggioli CC: Josh Whitehead CC: Robert VanVossen Signed-off-by: Jonathan Creekmore Acked-by: Dario Faggioli Reviewed-by: Andrew Cooper --- xen/common/sched_arinc653.c | 2 ++ xen/common/sched_credit.c | 2 ++ xen/common/sched_credit2.c | 2 ++ xen/common/sched_rt.c | 2 ++ xen/include/xen/sched-if.h | 2 ++ 5 files changed, 10 insertions(+) diff --git a/xen/common/sched_arinc653.c b/xen/common/sched_arinc653.c index dbe02ed..3b59514 100644 --- a/xen/common/sched_arinc653.c +++ b/xen/common/sched_arinc653.c @@ -767,6 +767,8 @@ const struct scheduler sched_arinc653_def = { .tick_resume = NULL, }; +REGISTER_SCHEDULER(sched_arinc653_def); + /* * Local variables: * mode: C diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c index 0dce790..e586248 100644 --- a/xen/common/sched_credit.c +++ b/xen/common/sched_credit.c @@ -2027,3 +2027,5 @@ const struct scheduler sched_credit_def = { .tick_suspend = csched_tick_suspend, .tick_resume = csched_tick_resume, }; + +REGISTER_SCHEDULER(sched_credit_def); diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c index 3c49ffa..38b02d0 100644 --- a/xen/common/sched_credit2.c +++ b/xen/common/sched_credit2.c @@ -2228,3 +2228,5 @@ const struct scheduler sched_credit2_def = { .alloc_domdata = csched2_alloc_domdata, .free_domdata = csched2_free_domdata, }; + +REGISTER_SCHEDULER(sched_credit2_def); diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c index 3f1d047..7640cd0 100644 --- a/xen/common/sched_rt.c +++ b/xen/common/sched_rt.c @@ -1199,3 +1199,5 @@ const struct scheduler sched_rtds_def = { .wake = rt_vcpu_wake, .context_saved = rt_context_saved, }; + +REGISTER_SCHEDULER(sched_rtds_def); diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h index 493d43f..9c6e0f5 100644 --- a/xen/include/xen/sched-if.h +++ b/xen/include/xen/sched-if.h @@ -170,6 +170,8 @@ extern const struct scheduler sched_credit2_def; extern const struct scheduler sched_arinc653_def; extern const struct scheduler sched_rtds_def; +#define REGISTER_SCHEDULER(x) static const struct scheduler *x##_entry \ + __used_section(".data.schedulers") = &x; struct cpupool {