Commit 2f5ea458 authored by Charles Jacobsen's avatar Charles Jacobsen Committed by Vikram Narayanan

pmfs: mount: Fix current_task initialization and access.

I forgot I was memset'ing it to 0 in slab.c (and it wasn't necessary).
parent a92a7f0c
......@@ -17,6 +17,7 @@
*/
struct cred fake_cred;
struct task_struct fake_task = {
.pid = 12345678,
.cred = &fake_cred,
};
struct task_struct *current_task = &fake_task;
......@@ -163,3 +164,54 @@ void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key)
{
return;
}
/* IOREMAPs -------------------------------------------------- */
void *ioremap_cache(resource_size_t phys_addr, unsigned long size)
{
return lcd_ioremap_cache(phys_addr, size);
}
void *ioremap_cache_ro(resource_size_t phys_addr, unsigned long size)
{
return lcd_ioremap_cache(phys_addr, size);
}
void *ioremap_hpage_cache(resource_size_t phys_addr, unsigned long size)
{
return lcd_ioremap_cache(phys_addr, size);
}
void *ioremap_hpage_cache_ro(resource_size_t phys_addr, unsigned long size)
{
return lcd_ioremap_cache(phys_addr, size);
}
void iounmap(volatile void __iomem *addr)
{
lcd_iounmap((void *)addr);
}
void __release_region(struct resource *parent, resource_size_t start,
resource_size_t n)
{
return;
}
struct resource iomem_resource;
struct resource fake_resource;
struct resource * __request_region(struct resource *parent,
resource_size_t start, resource_size_t n,
const char *name, int flags)
{
return &fake_resource;
}
/* RCU ------------------------------------------------------------ */
void call_rcu_sched(struct rcu_head *head,
void (*func)(struct rcu_head *rcu))
{
/* Just call it */
func(head);
}
......@@ -319,6 +319,31 @@ fail1:
return ret;
}
static int task_struct_tests(void)
{
if (!get_current()) {
LIBLCD_ERR("get_current returned null");
return -1;
}
if (!current) {
LIBLCD_ERR("current is null");
return -1;
}
if (current->pid != 12345678) {
LIBLCD_ERR("current pid is %d", current->pid);
return -1;
}
if (!current_cred()) {
LIBLCD_ERR("current_cred returned null");
return -1;
}
return 0;
}
static int __noreturn liblcd_test_lcd_init(void)
{
int ret = 0;
......@@ -372,6 +397,13 @@ static int __noreturn liblcd_test_lcd_init(void)
goto out;
}
LIBLCD_MSG("ram map test passed!");
ret = task_struct_tests();
if (ret) {
LIBLCD_ERR("task struct tests failed!");
goto out;
}
LIBLCD_MSG("task struct tests passed!");
LIBLCD_MSG("ALL LIBLCD TESTS PASSED!");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment