From c0d9fe2094d59e2cd31a495d914c996b83c5249e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vlad-Andrei=20B=C4=82DOIU=20=2878692=29?= Date: Sat, 9 Nov 2019 10:21:29 +0000 Subject: [PATCH] Add != operator for pte_handle_t Signed-off-by: Vlad-Andrei Badoiu Reviewed-by: Costin Lupu --- ...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 +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 +--- + 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 (ptr_value))); + } + ++ bool pte_handle_t::operator!=(int ptr_value) ++ { ++ return ((size_t) this->p) != ((size_t) (reinterpret_cast (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 + -- 2.39.5