mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 18:22:45 +00:00 
			
		
		
		
	Kernel: Remove unused syscall sys$minherit()
This is no longer used. We can bring it back the day we need it.
This commit is contained in:
		
							parent
							
								
									de31e82f97
								
							
						
					
					
						commit
						43109f9614
					
				
					 8 changed files with 0 additions and 60 deletions
				
			
		|  | @ -186,7 +186,6 @@ namespace Kernel { | ||||||
|     S(shutdown)               \ |     S(shutdown)               \ | ||||||
|     S(get_stack_bounds)       \ |     S(get_stack_bounds)       \ | ||||||
|     S(ptrace)                 \ |     S(ptrace)                 \ | ||||||
|     S(minherit)               \ |  | ||||||
|     S(sendfd)                 \ |     S(sendfd)                 \ | ||||||
|     S(recvfd)                 \ |     S(recvfd)                 \ | ||||||
|     S(sysconf)                \ |     S(sysconf)                \ | ||||||
|  |  | ||||||
|  | @ -259,7 +259,6 @@ public: | ||||||
|     int sys$set_mmap_name(Userspace<const Syscall::SC_set_mmap_name_params*>); |     int sys$set_mmap_name(Userspace<const Syscall::SC_set_mmap_name_params*>); | ||||||
|     int sys$mprotect(void*, size_t, int prot); |     int sys$mprotect(void*, size_t, int prot); | ||||||
|     int sys$madvise(void*, size_t, int advice); |     int sys$madvise(void*, size_t, int advice); | ||||||
|     int sys$minherit(void*, size_t, int inherit); |  | ||||||
|     int sys$purge(int mode); |     int sys$purge(int mode); | ||||||
|     int sys$select(const Syscall::SC_select_params*); |     int sys$select(const Syscall::SC_select_params*); | ||||||
|     int sys$poll(Userspace<const Syscall::SC_poll_params*>); |     int sys$poll(Userspace<const Syscall::SC_poll_params*>); | ||||||
|  |  | ||||||
|  | @ -306,32 +306,6 @@ int Process::sys$madvise(void* address, size_t size, int advice) | ||||||
|     return -EINVAL; |     return -EINVAL; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int Process::sys$minherit(void* address, size_t size, int inherit) |  | ||||||
| { |  | ||||||
|     REQUIRE_PROMISE(stdio); |  | ||||||
| 
 |  | ||||||
|     auto* region = find_region_from_range({ VirtualAddress(address), size }); |  | ||||||
|     if (!region) |  | ||||||
|         return -EINVAL; |  | ||||||
| 
 |  | ||||||
|     if (!region->is_mmap()) |  | ||||||
|         return -EINVAL; |  | ||||||
| 
 |  | ||||||
|     if (region->is_shared()) |  | ||||||
|         return -EINVAL; |  | ||||||
| 
 |  | ||||||
|     if (!region->vmobject().is_anonymous()) |  | ||||||
|         return -EINVAL; |  | ||||||
| 
 |  | ||||||
|     switch (inherit) { |  | ||||||
|     case MAP_INHERIT_ZERO: |  | ||||||
|         region->set_inherit_mode(Region::InheritMode::ZeroedOnFork); |  | ||||||
|         return 0; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     return -EINVAL; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| int Process::sys$set_mmap_name(Userspace<const Syscall::SC_set_mmap_name_params*> user_params) | int Process::sys$set_mmap_name(Userspace<const Syscall::SC_set_mmap_name_params*> user_params) | ||||||
| { | { | ||||||
|     REQUIRE_PROMISE(stdio); |     REQUIRE_PROMISE(stdio); | ||||||
|  |  | ||||||
|  | @ -104,8 +104,6 @@ enum { | ||||||
| #define MADV_SET_NONVOLATILE 0x200 | #define MADV_SET_NONVOLATILE 0x200 | ||||||
| #define MADV_GET_VOLATILE 0x400 | #define MADV_GET_VOLATILE 0x400 | ||||||
| 
 | 
 | ||||||
| #define MAP_INHERIT_ZERO 1 |  | ||||||
| 
 |  | ||||||
| #define F_DUPFD 0 | #define F_DUPFD 0 | ||||||
| #define F_GETFD 1 | #define F_GETFD 1 | ||||||
| #define F_SETFD 2 | #define F_SETFD 2 | ||||||
|  |  | ||||||
|  | @ -93,19 +93,6 @@ OwnPtr<Region> Region::clone(Process& new_owner) | ||||||
|     ASSERT(Process::current()); |     ASSERT(Process::current()); | ||||||
| 
 | 
 | ||||||
|     ScopedSpinLock lock(s_mm_lock); |     ScopedSpinLock lock(s_mm_lock); | ||||||
|     if (m_inherit_mode == InheritMode::ZeroedOnFork) { |  | ||||||
|         ASSERT(m_mmap); |  | ||||||
|         ASSERT(!m_shared); |  | ||||||
|         ASSERT(vmobject().is_anonymous()); |  | ||||||
|         auto new_vmobject = AnonymousVMObject::create_with_size(size(), AllocationStrategy::Reserve); // TODO: inherit committed non-volatile areas?
 |  | ||||||
|         if (!new_vmobject) |  | ||||||
|             return {}; |  | ||||||
|         auto zeroed_region = Region::create_user_accessible(&new_owner, m_range, new_vmobject.release_nonnull(), 0, m_name, m_access); |  | ||||||
|         zeroed_region->copy_purgeable_page_ranges(*this); |  | ||||||
|         zeroed_region->set_mmap(m_mmap); |  | ||||||
|         zeroed_region->set_inherit_mode(m_inherit_mode); |  | ||||||
|         return zeroed_region; |  | ||||||
|     } |  | ||||||
| 
 | 
 | ||||||
|     if (m_shared) { |     if (m_shared) { | ||||||
|         ASSERT(!m_stack); |         ASSERT(!m_stack); | ||||||
|  |  | ||||||
|  | @ -56,11 +56,6 @@ public: | ||||||
|         Execute = 4, |         Execute = 4, | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     enum class InheritMode { |  | ||||||
|         Default, |  | ||||||
|         ZeroedOnFork, |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     static NonnullOwnPtr<Region> create_user_accessible(Process*, const Range&, NonnullRefPtr<VMObject>, size_t offset_in_vmobject, const StringView& name, u8 access, bool cacheable = true, bool shared = false); |     static NonnullOwnPtr<Region> create_user_accessible(Process*, const Range&, NonnullRefPtr<VMObject>, size_t offset_in_vmobject, const StringView& name, u8 access, bool cacheable = true, bool shared = false); | ||||||
|     static NonnullOwnPtr<Region> create_kernel_only(const Range&, NonnullRefPtr<VMObject>, size_t offset_in_vmobject, const StringView& name, u8 access, bool cacheable = true); |     static NonnullOwnPtr<Region> create_kernel_only(const Range&, NonnullRefPtr<VMObject>, size_t offset_in_vmobject, const StringView& name, u8 access, bool cacheable = true); | ||||||
| 
 | 
 | ||||||
|  | @ -227,8 +222,6 @@ public: | ||||||
|     // NOTE: These are public so we can make<> them.
 |     // NOTE: These are public so we can make<> them.
 | ||||||
|     Region(const Range&, NonnullRefPtr<VMObject>, size_t offset_in_vmobject, const String&, u8 access, bool cacheable, bool kernel, bool shared); |     Region(const Range&, NonnullRefPtr<VMObject>, size_t offset_in_vmobject, const String&, u8 access, bool cacheable, bool kernel, bool shared); | ||||||
| 
 | 
 | ||||||
|     void set_inherit_mode(InheritMode inherit_mode) { m_inherit_mode = inherit_mode; } |  | ||||||
| 
 |  | ||||||
|     bool remap_vmobject_page_range(size_t page_index, size_t page_count); |     bool remap_vmobject_page_range(size_t page_index, size_t page_count); | ||||||
| 
 | 
 | ||||||
|     bool is_volatile(VirtualAddress vaddr, size_t size) const; |     bool is_volatile(VirtualAddress vaddr, size_t size) const; | ||||||
|  | @ -270,7 +263,6 @@ private: | ||||||
|     NonnullRefPtr<VMObject> m_vmobject; |     NonnullRefPtr<VMObject> m_vmobject; | ||||||
|     String m_name; |     String m_name; | ||||||
|     u8 m_access { 0 }; |     u8 m_access { 0 }; | ||||||
|     InheritMode m_inherit_mode : 3 { InheritMode::Default }; |  | ||||||
|     bool m_shared : 1 { false }; |     bool m_shared : 1 { false }; | ||||||
|     bool m_user_accessible : 1 { false }; |     bool m_user_accessible : 1 { false }; | ||||||
|     bool m_cacheable : 1 { false }; |     bool m_cacheable : 1 { false }; | ||||||
|  |  | ||||||
|  | @ -93,12 +93,6 @@ int madvise(void* address, size_t size, int advice) | ||||||
|     __RETURN_WITH_ERRNO(rc, rc, -1); |     __RETURN_WITH_ERRNO(rc, rc, -1); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int minherit(void* address, size_t size, int inherit) |  | ||||||
| { |  | ||||||
|     int rc = syscall(SC_minherit, address, size, inherit); |  | ||||||
|     __RETURN_WITH_ERRNO(rc, rc, -1); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| void* allocate_tls(size_t size) | void* allocate_tls(size_t size) | ||||||
| { | { | ||||||
|     int rc = syscall(SC_allocate_tls, size); |     int rc = syscall(SC_allocate_tls, size); | ||||||
|  |  | ||||||
|  | @ -49,8 +49,6 @@ | ||||||
| #define MADV_SET_NONVOLATILE 0x200 | #define MADV_SET_NONVOLATILE 0x200 | ||||||
| #define MADV_GET_VOLATILE 0x400 | #define MADV_GET_VOLATILE 0x400 | ||||||
| 
 | 
 | ||||||
| #define MAP_INHERIT_ZERO 1 |  | ||||||
| 
 |  | ||||||
| __BEGIN_DECLS | __BEGIN_DECLS | ||||||
| 
 | 
 | ||||||
| void* mmap(void* addr, size_t, int prot, int flags, int fd, off_t); | void* mmap(void* addr, size_t, int prot, int flags, int fd, off_t); | ||||||
|  | @ -61,7 +59,6 @@ int munmap(void*, size_t); | ||||||
| int mprotect(void*, size_t, int prot); | int mprotect(void*, size_t, int prot); | ||||||
| int set_mmap_name(void*, size_t, const char*); | int set_mmap_name(void*, size_t, const char*); | ||||||
| int madvise(void*, size_t, int advice); | int madvise(void*, size_t, int advice); | ||||||
| int minherit(void*, size_t, int inherit); |  | ||||||
| void* allocate_tls(size_t); | void* allocate_tls(size_t); | ||||||
| 
 | 
 | ||||||
| __END_DECLS | __END_DECLS | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling