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

Re: [Minios-devel] [UNIKRAFT/PTHREAD-EMBEDDED PATCH 1/1] Add != operator for pte_handle_t



Thanks, Vlad!

Reviewed-by: Costin Lupu <costin.lupu@xxxxxxxxx>

On 11/9/19 12:21 PM, Vlad-Andrei BĂDOIU (78692) wrote:
> Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
> ---
>  ...0010-Added-operator-for-pte_handle_t.patch | 49 +++++++++++++++++++
>  1 file changed, 49 insertions(+)
>  create mode 100644 patches/0010-Added-operator-for-pte_handle_t.patch
> 
> diff --git a/patches/0010-Added-operator-for-pte_handle_t.patch 
> b/patches/0010-Added-operator-for-pte_handle_t.patch
> new file mode 100644
> index 0000000..7272b74
> --- /dev/null
> +++ b/patches/0010-Added-operator-for-pte_handle_t.patch
> @@ -0,0 +1,49 @@
> +From 5b15a35b6bcc0cce17850a51ffad825a577bd219 Mon Sep 17 00:00:00 2001
> +From: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
> +Date: Sat, 9 Nov 2019 01:12:33 +0200
> +Subject: [PATCH 1/1] Added operator != for pte_handle_t
> +
> +Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
> +---
> + pthread.h | 12 ++++++++++++
> + 1 file changed, 12 insertions(+)
> +
> +diff --git a/pthread.h b/pthread.h
> +index 48625a4..da0c722 100644
> +--- a/pthread.h
> ++++ b/pthread.h
> +@@ -406,6 +406,7 @@ enum
> +         }
> +         inline struct pte_handle& operator=(unsigned int ptr_value);
> +         inline bool operator==(int ptr_value);
> ++     inline bool operator!=(int ptr_value);
> + #endif
> +       } pte_handle_t;
> + 
> +@@ -1010,12 +1011,23 @@ enum
> +         return ((size_t) l.p) == ((size_t) r.p);
> +     }
> + 
> ++    /* Operator to be compatible to libstd++ */
> ++    inline bool operator!=(pte_handle_t const& l, pte_handle_t const& r)
> ++    {
> ++        return ((size_t) l.p) != ((size_t) r.p);
> ++    }
> ++
> +     /* Operator to compare the thread pointer with a given value */
> +     bool pte_handle_t::operator==(int ptr_value)
> +     {
> +         return ((size_t) this->p) == ((size_t) (reinterpret_cast <void 
> *>(ptr_value)));
> +     }
> + 
> ++    bool pte_handle_t::operator!=(int ptr_value)
> ++    {
> ++        return ((size_t) this->p) != ((size_t) (reinterpret_cast <void 
> *>(ptr_value)));
> ++    }
> ++
> +     /* Operator to assign a given value to the thread pointer */
> +     pte_handle_t& pte_handle_t::operator=(unsigned int ptr_value)
> +     {
> +-- 
> +2.20.1
> +
> 

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

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