userspace: restrict k_object_access_all_grant()

This is too powerful for user mode, the other access APIs
require explicit permissions on the threads that are being
granted access.

The API is no longer exposed as a system call and hence will
only be usable by supervisor threads.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
diff --git a/include/kernel.h b/include/kernel.h
index 0e4b7b5..7bc2397 100644
--- a/include/kernel.h
+++ b/include/kernel.h
@@ -212,7 +212,7 @@
 	ARG_UNUSED(thread);
 }
 
-static inline void _impl_k_object_access_all_grant(void *object)
+static inline void k_object_access_all_grant(void *object)
 {
 	ARG_UNUSED(object);
 }
@@ -259,7 +259,7 @@
  *
  * @param object Address of kernel object
  */
-__syscall void k_object_access_all_grant(void *object);
+void k_object_access_all_grant(void *object);
 
 /* timeouts */
 
diff --git a/kernel/userspace.c b/kernel/userspace.c
index 68c0eaa..324d257 100644
--- a/kernel/userspace.c
+++ b/kernel/userspace.c
@@ -211,7 +211,7 @@
 	}
 }
 
-void _impl_k_object_access_all_grant(void *object)
+void k_object_access_all_grant(void *object)
 {
 	struct _k_object *ko = _k_object_find(object);
 
diff --git a/kernel/userspace_handler.c b/kernel/userspace_handler.c
index 77a4751..8840e8b 100644
--- a/kernel/userspace_handler.c
+++ b/kernel/userspace_handler.c
@@ -58,14 +58,3 @@
 
 	return 0;
 }
-
-_SYSCALL_HANDLER(k_object_access_all_grant, object)
-{
-	struct _k_object *ko;
-
-	ko = validate_any_object((void *)object);
-	_SYSCALL_VERIFY_MSG(ko, "object %p access denied", (void *)object);
-	ko->flags |= K_OBJ_FLAG_PUBLIC;
-
-	return 0;
-}