[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] mini-os: Use a single start_info_ptr variable



Costin Lupu, le mar. 18 août 2020 16:42:22 +0300, a ecrit:
>  arch/x86/setup.c | 2 +-
>  shutdown.c       | 4 ++--

This would break the arm build, which does not have the start_info_ptr
variable. That being said, shutdown.c doesn't seem like buildable on
arm. I'd say not try to touch this code, and wait for ARM porters to fix
the start_info question, and then we can see how to factorize the
variables.

>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/x86/setup.c b/arch/x86/setup.c
> index 4fd8e39..2ba74fb 100644
> --- a/arch/x86/setup.c
> +++ b/arch/x86/setup.c
> @@ -45,7 +45,7 @@ union start_info_union start_info_union;
>  /*
>   * This pointer holds a reference to the copy of the start_info struct.
>   */
> -static start_info_t *start_info_ptr;
> +start_info_t *start_info_ptr;
>  
>  /*
>   * Shared page for communicating with the hypervisor.
> diff --git a/shutdown.c b/shutdown.c
> index 4c0b13c..4d0617f 100644
> --- a/shutdown.c
> +++ b/shutdown.c
> @@ -46,7 +46,7 @@
>  #include <mini-os/xmalloc.h>
>  
>  
> -static start_info_t *start_info_ptr;
> +extern start_info_t *start_info_ptr;
>  
>  #ifdef CONFIG_XENBUS
>  static const char *path = "control/shutdown";
> @@ -113,7 +113,7 @@ static void shutdown_thread(void *p)
>  
>  void init_shutdown(start_info_t *si)
>  {
> -    start_info_ptr = si;
> +    ASSERT(start_info_ptr == si);
>  
>      end_shutdown_thread = 0;
>      create_thread("shutdown", shutdown_thread, NULL);
> -- 
> 2.20.1
> 

-- 
Samuel
#include <culture.h>



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.