You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/04/13 12:38:52 UTC

[incubator-nuttx] branch master updated (f5cf35784e -> 4b9c74514d)

This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


    from f5cf35784e arch/risc-v: Correct format of 32-bit insn in misaligned handler
     new 5cc4f22b43 power/governor: Remove the duplicated function prototype
     new 4b9c74514d drivers/power: Remove activity_governor.h and greedy_governor.h

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 drivers/power/activity_governor.c |   4 +-
 drivers/power/activity_governor.h | 190 --------------------------------------
 drivers/power/greedy_governor.c   |   3 +-
 drivers/power/greedy_governor.h   |  66 -------------
 drivers/power/pm_initialize.c     |   6 --
 5 files changed, 3 insertions(+), 266 deletions(-)
 delete mode 100644 drivers/power/activity_governor.h
 delete mode 100644 drivers/power/greedy_governor.h


[incubator-nuttx] 01/02: power/governor: Remove the duplicated function prototype

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 5cc4f22b436f865974fdaf1cfd9b311727001971
Author: zhuyanlin <zh...@xiaomi.com>
AuthorDate: Mon Feb 14 14:42:02 2022 +0800

    power/governor: Remove the duplicated function prototype
    
    since they are declared include/nuttx/power/pm.h by:
    commit 5ce181e6b702cedbd79790fbe40aab7d29dae7c0
    Author: zhuyanlin <zh...@xiaomi.com>
    Date:   Mon Feb 14 15:32:40 2022 +0800
    
        power:govorner: add govorner to per domain.
    
        For mult domains scene,,
        activity and greety can be used at same time.
        Let user to select domain governor.
    
        Signed-off-by: zhuyanlin <zh...@xiaomi.com>
    
    and add static const to g_pmgovernor
    
    Signed-off-by: zhuyanlin <zh...@xiaomi.com>
---
 drivers/power/activity_governor.c |  4 ++--
 drivers/power/activity_governor.h |  6 ------
 drivers/power/greedy_governor.c   |  2 +-
 drivers/power/greedy_governor.h   | 17 -----------------
 drivers/power/pm_initialize.c     |  6 ------
 5 files changed, 3 insertions(+), 32 deletions(-)

diff --git a/drivers/power/activity_governor.c b/drivers/power/activity_governor.c
index dcd44c1bfc..c124e52b9b 100644
--- a/drivers/power/activity_governor.c
+++ b/drivers/power/activity_governor.c
@@ -188,7 +188,7 @@ struct pm_activity_governor_s g_pm_activity_governor =
 #endif
 };
 
-static struct pm_governor_s g_pmgovernor =
+static const struct pm_governor_s g_pmgovernor =
 {
   governor_initialize,   /* initialize */
   NULL,                  /* deinitialize */
@@ -594,7 +594,7 @@ static void governor_timer(int domain)
  * Public Functions
  ****************************************************************************/
 
-FAR struct pm_governor_s *pm_activity_governor_initialize(void)
+FAR const struct pm_governor_s *pm_activity_governor_initialize(void)
 {
   return &g_pmgovernor;
 }
diff --git a/drivers/power/activity_governor.h b/drivers/power/activity_governor.h
index b997834b92..9478d99c57 100644
--- a/drivers/power/activity_governor.h
+++ b/drivers/power/activity_governor.h
@@ -176,12 +176,6 @@ extern "C"
 #define EXTERN extern
 #endif
 
-/****************************************************************************
- * Public Function Prototypes
- ****************************************************************************/
-
-FAR struct pm_governor_s *pm_activity_governor_initialize(void);
-
 #undef EXTERN
 #ifdef __cplusplus
 }
diff --git a/drivers/power/greedy_governor.c b/drivers/power/greedy_governor.c
index 43c839db05..1ba7000114 100644
--- a/drivers/power/greedy_governor.c
+++ b/drivers/power/greedy_governor.c
@@ -62,7 +62,7 @@ static enum pm_state_e greedy_governor_checkstate(int domain);
  * Private Data
  ****************************************************************************/
 
-static struct pm_governor_s g_greedy_governor_ops =
+static const struct pm_governor_s g_greedy_governor_ops =
 {
   greedy_governor_initialize,   /* initialize */
   NULL,                         /* deinitialize */
diff --git a/drivers/power/greedy_governor.h b/drivers/power/greedy_governor.h
index 96bac1b239..9694cc4b80 100644
--- a/drivers/power/greedy_governor.h
+++ b/drivers/power/greedy_governor.h
@@ -41,23 +41,6 @@ extern "C"
 #define EXTERN extern
 #endif
 
-/****************************************************************************
- * Public Function Prototypes
- ****************************************************************************/
-
-/****************************************************************************
- * Name: pm_greedy_governor_register
- *
- * Description:
- *   Return the greedy governor instance.
- *
- * Returned Value:
- *   A pointer to the governor struct. Otherwise NULL is returned on error.
- *
- ****************************************************************************/
-
-FAR const struct pm_governor_s *pm_greedy_governor_initialize(void);
-
 #undef EXTERN
 #ifdef __cplusplus
 }
diff --git a/drivers/power/pm_initialize.c b/drivers/power/pm_initialize.c
index fc458eb148..0207bb79ff 100644
--- a/drivers/power/pm_initialize.c
+++ b/drivers/power/pm_initialize.c
@@ -28,12 +28,6 @@
 
 #include "pm.h"
 
-#if defined(CONFIG_PM_GOVERNOR_ACTIVITY)
-#  include "activity_governor.h"
-#elif defined(CONFIG_PM_GOVERNOR_GREEDY)
-#  include "greedy_governor.h"
-#endif
-
 #ifdef CONFIG_PM
 
 /****************************************************************************


[incubator-nuttx] 02/02: drivers/power: Remove activity_governor.h and greedy_governor.h

Posted by pk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 4b9c74514dc70f67691995dcd04a4ffd95932b59
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun Apr 10 16:10:09 2022 +0800

    drivers/power: Remove activity_governor.h and greedy_governor.h
    
    since they aren't really used anymore
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 drivers/power/activity_governor.h | 184 --------------------------------------
 drivers/power/greedy_governor.c   |   1 -
 drivers/power/greedy_governor.h   |  49 ----------
 3 files changed, 234 deletions(-)

diff --git a/drivers/power/activity_governor.h b/drivers/power/activity_governor.h
deleted file mode 100644
index 9478d99c57..0000000000
--- a/drivers/power/activity_governor.h
+++ /dev/null
@@ -1,184 +0,0 @@
-/****************************************************************************
- * drivers/power/activity_governor.h
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.  The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-#ifndef __DRIVERS_POWER_ACTIVITY_GOVERNER_H
-#define __DRIVERS_POWER_ACTIVITY_GOVERNER_H
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-#include <nuttx/power/pm.h>
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-/* CONFIG_PM_GOVERNOR_SLICEMS. The activity based governor collects activity
- * counts in time slices.  At the end of the time slice, the count
- * accumulated during that interval is applied to an averaging algorithm to
- * determine the activity level.
- *
- * CONFIG_PM_GOVERNOR_SLICEMS provides the duration of that time slice in
- * milliseconds.  Default: 100 Milliseconds
- */
-
-#ifndef CONFIG_PM_GOVERNOR_SLICEMS
-#  define CONFIG_PM_GOVERNOR_SLICEMS  100 /* Default is 100 msec */
-#endif
-
-#if CONFIG_PM_GOVERNOR_SLICEMS < 1
-#  error CONFIG_PM_GOVERNOR_SLICEMS invalid
-#endif
-
-/* The averaging algorithm is simply: Y = (An*X + SUM(Ai*Yi))/SUM(Aj), where
- * i = 1..n-1 and j= 1..n, n is the length of the "memory", Ai is the
- * weight applied to each value, and X is the current activity.  These
- * weights may be negative and a limited to the range of int16_t.
- *
- * CONFIG_PM_GOVERNOR_MEMORY:
- *  provides the memory for the algorithm.  Default: 2
- * CONFIG_PM_GOVERNOR_COEFn:
- *  provides weight for each sample.  Default: 1
- *
- * Setting CONFIG_PM_GOVERNOR_MEMORY=1 disables all smoothing.
- */
-
-#ifndef CONFIG_PM_GOVERNOR_MEMORY
-#  define CONFIG_PM_GOVERNOR_MEMORY 2
-#endif
-
-#if CONFIG_PM_GOVERNOR_MEMORY < 1
-#  error "CONFIG_PM_GOVERNOR_MEMORY must be >= 1"
-#endif
-
-#ifndef CONFIG_PM_GOVERNOR_COEFN
-#  define CONFIG_PM_GOVERNOR_COEFN 1
-#endif
-
-#if CONFIG_PM_GOVERNOR_MEMORY > 1 && !defined(CONFIG_PM_GOVERNOR_COEF1)
-#  define CONFIG_PM_GOVERNOR_COEF1 1
-#endif
-
-#if CONFIG_PM_GOVERNOR_MEMORY > 2 && !defined(CONFIG_PM_GOVERNOR_COEF2)
-#  define CONFIG_PM_GOVERNOR_COEF2 1
-#endif
-
-#if CONFIG_PM_GOVERNOR_MEMORY > 3 && !defined(CONFIG_PM_GOVERNOR_COEF3)
-#  define CONFIG_PM_GOVERNOR_COEF3 1
-#endif
-
-#if CONFIG_PM_GOVERNOR_MEMORY > 4 && !defined(CONFIG_PM_GOVERNOR_COEF4)
-#  define CONFIG_PM_GOVERNOR_COEF4 1
-#endif
-
-#if CONFIG_PM_GOVERNOR_MEMORY > 5 && !defined(CONFIG_PM_GOVERNOR_COEF5)
-#  define CONFIG_PM_GOVERNOR_COEF5 1
-#endif
-
-#if CONFIG_PM_GOVERNOR_MEMORY > 6
-#  warning "This logic needs to be extended"
-#endif
-
-/* State changes then occur when the weight activity account crosses
- * threshold values for certain periods of time (time slice count).
- *
- * CONFIG_PM_GOVERNOR_xxxENTER_THRESH is the threshold value for entering
- * state xxx.
- * CONFIG_PM_GOVERNOR_xxxENTER_COUNT is the count for entering state xxx.
- *
- * Resuming to normal state, on the other hand, is usually immediate and
- * controlled by wakeup conditions established by the platform.  The PM
- * module only recommends reduced power states.
- */
-
-#ifndef CONFIG_PM_GOVERNOR_IDLEENTER_THRESH
-#  define CONFIG_PM_GOVERNOR_IDLEENTER_THRESH    1   /* <=1: Essentially no activity */
-#endif
-
-#ifndef CONFIG_PM_GOVERNOR_IDLEEXIT_THRESH
-#  define CONFIG_PM_GOVERNOR_IDLEEXIT_THRESH     2   /* >=2: Active */
-#endif
-
-#if CONFIG_PM_GOVERNOR_IDLEENTER_THRESH >= CONFIG_PM_GOVERNOR_IDLEEXIT_THRESH
-#  error "Must have CONFIG_PM_GOVERNOR_IDLEENTER_THRESH < CONFIG_PM_GOVERNOR_IDLEEXIT_THRESH"
-#endif
-
-#ifndef CONFIG_PM_GOVERNOR_IDLEENTER_COUNT
-#  define CONFIG_PM_GOVERNOR_IDLEENTER_COUNT     30  /* Thirty IDLE slices to enter
-                                                      * IDLE mode from normal
-                                                      */
-#endif
-
-#ifndef CONFIG_PM_GOVERNOR_STANDBYENTER_THRESH
-#  define CONFIG_PM_GOVERNOR_STANDBYENTER_THRESH 1   /*  <=1: Essentially no activity */
-#endif
-
-#ifndef CONFIG_PM_GOVERNOR_STANDBYEXIT_THRESH
-#  define CONFIG_PM_GOVERNOR_STANDBYEXIT_THRESH  2   /* >=2: Active */
-#endif
-
-#if CONFIG_PM_GOVERNOR_STANDBYENTER_THRESH >= CONFIG_PM_GOVERNOR_STANDBYEXIT_THRESH
-#  error "Must have CONFIG_PM_GOVERNOR_STANDBYENTER_THRESH < CONFIG_PM_GOVERNOR_STANDBYEXIT_THRESH"
-#endif
-
-#ifndef CONFIG_PM_GOVERNOR_STANDBYENTER_COUNT
-#  define CONFIG_PM_GOVERNOR_STANDBYENTER_COUNT  50  /* Fifty IDLE slices to enter
-                                                      * STANDBY mode from IDLE
-                                                      */
-#endif
-
-#ifndef CONFIG_PM_GOVERNOR_SLEEPENTER_THRESH
-#  define CONFIG_PM_GOVERNOR_SLEEPENTER_THRESH   1   /*  <=1: Essentially no activity */
-#endif
-
-#ifndef CONFIG_PM_GOVERNOR_SLEEPEXIT_THRESH
-#  define CONFIG_PM_GOVERNOR_SLEEPEXIT_THRESH    2   /* >=2: Active */
-#endif
-
-#if CONFIG_PM_GOVERNOR_SLEEPENTER_THRESH >= CONFIG_PM_GOVERNOR_SLEEPEXIT_THRESH
-#  error "Must have CONFIG_PM_GOVERNOR_SLEEPENTER_THRESH < CONFIG_PM_GOVERNOR_SLEEPEXIT_THRESH"
-#endif
-
-#ifndef CONFIG_PM_GOVERNOR_SLEEPENTER_COUNT
-#  define CONFIG_PM_GOVERNOR_SLEEPENTER_COUNT    70  /* 70 IDLE slices to enter SLEEP
-                                                      * mode from STANDBY
-                                                      */
-#endif
-
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
-#ifdef __cplusplus
-#define EXTERN extern "C"
-extern "C"
-{
-#else
-#define EXTERN extern
-#endif
-
-#undef EXTERN
-#ifdef __cplusplus
-}
-#endif
-
-#endif // __DRIVERS_POWER_ACTIVITY_GOVERNER_H
diff --git a/drivers/power/greedy_governor.c b/drivers/power/greedy_governor.c
index 1ba7000114..aa2225bf70 100644
--- a/drivers/power/greedy_governor.c
+++ b/drivers/power/greedy_governor.c
@@ -40,7 +40,6 @@
 
 #include <nuttx/irq.h>
 
-#include "greedy_governor.h"
 #include "pm.h"
 
 /****************************************************************************
diff --git a/drivers/power/greedy_governor.h b/drivers/power/greedy_governor.h
deleted file mode 100644
index 9694cc4b80..0000000000
--- a/drivers/power/greedy_governor.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
- * drivers/power/greedy_governor.h
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.  The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-#ifndef __DRIVERS_POWER_GREEDY_GOVERNER_H
-#define __DRIVERS_POWER_GREEDY_GOVERNER_H
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-#include <nuttx/input/ioctl.h>
-#include <nuttx/power/pm.h>
-
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
-#ifdef __cplusplus
-#define EXTERN extern "C"
-extern "C"
-{
-#else
-#define EXTERN extern
-#endif
-
-#undef EXTERN
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __DRIVERS_POWER_GREEDY_GOVERNER_H */