lx_emul: refine configurations & memory attributes

Ref genodelabs/genode#4651
This commit is contained in:
Stefan Kalkowski 2022-10-26 17:30:54 +02:00 committed by Christian Helmuth
parent 9482355c47
commit 018c562447
4 changed files with 22 additions and 0 deletions

View File

@ -34,6 +34,19 @@
#define virt_addr_valid(kaddr) (kaddr != NULL)
#define arch_phys_to_idmap_offset 0ULL
static inline unsigned long phys_to_idmap(phys_addr_t addr)
{
return addr;
}
static inline phys_addr_t idmap_to_phys(unsigned long idmap)
{
return (phys_addr_t)idmap;
}
#ifndef __virt_to_bus
#define __virt_to_bus __pa
#define __bus_to_virt __va

View File

@ -41,6 +41,10 @@ int pte_write(pte_t ptr);
#define __swp_entry(type, offset) ( lx_emul_trace_and_stop(__func__), (swp_entry_t) { 0 } )
#define __swp_entry_to_pte(swp) ((pte_t) { (swp).val })
#define pmd_page(pmd) NULL
#define PAGE_KERNEL 0UL
#endif /* !__ASSEMBLY__ */
#endif /* __ASM_PGTABLE_H */

View File

@ -24,6 +24,7 @@ int __srcu_read_lock(struct srcu_struct * ssp)
void __srcu_read_unlock(struct srcu_struct * ssp, int idx) { }
#ifndef CONFIG_DEBUG_LOCK_ALLOC
int init_srcu_struct(struct srcu_struct * ssp)
{
mutex_init(&ssp->srcu_cb_mutex);
@ -41,3 +42,4 @@ int init_srcu_struct(struct srcu_struct * ssp)
smp_store_release(&ssp->srcu_gp_seq_needed, 0); /* Init done. */
return ssp->sda ? 0 : -ENOMEM;
}
#endif

View File

@ -140,6 +140,8 @@ void * kmem_cache_alloc_node(struct kmem_cache * s, gfp_t gfpflags, int node)
#ifdef CONFIG_TRACING
#ifdef CONFIG_NUMA
void * kmem_cache_alloc_node_trace(struct kmem_cache * s,
gfp_t gfpflags,
int node,
@ -148,6 +150,7 @@ void * kmem_cache_alloc_node_trace(struct kmem_cache * s,
return kmem_cache_alloc(s, gfpflags);
}
#endif /* CONFIG_NUMA */
void * kmem_cache_alloc_trace(struct kmem_cache * s,
gfp_t gfpflags,