Skip to content

Instantly share code, notes, and snippets.

@sergeykish
Last active December 22, 2015 13:39
Show Gist options
  • Save sergeykish/6480805 to your computer and use it in GitHub Desktop.
Save sergeykish/6480805 to your computer and use it in GitHub Desktop.
startx, emgd 1.16 on linux 3.10
Sep 08 02:18:19 myhost kernel: BUG: unable to handle kernel NULL pointer dereference at (null)
Sep 08 02:18:19 myhost kernel: IP: [<c030c9c0>] memset+0x10/0x18
Sep 08 02:18:19 myhost kernel: *pde = 00000000
Sep 08 02:18:19 myhost kernel: Oops: 0002 [#1] PREEMPT SMP
Sep 08 02:18:19 myhost kernel: Modules linked in: emgd(O) drm_kms_helper drm agpgart uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_core videode
Sep 08 02:18:19 myhost kernel: CPU: 1 PID: 502 Comm: X Tainted: G O 3.10.10-1-ARCH #1
Sep 08 02:18:19 myhost kernel: Hardware name: Acer AO751h /JV11-ML , BIOS V0.3210 09/22/2009
Sep 08 02:18:19 myhost kernel: task: f53a5d80 ti: f5cb6000 task.ti: f5cb6000
Sep 08 02:18:19 myhost kernel: EIP: 0060:[<c030c9c0>] EFLAGS: 00210246 CPU: 1
Sep 08 02:18:19 myhost kernel: EIP is at memset+0x10/0x18
Sep 08 02:18:19 myhost kernel: EAX: 00000000 EBX: 00000000 ECX: 00000044 EDX: 00000000
Sep 08 02:18:19 myhost kernel: ESI: f6785540 EDI: 00000000 EBP: f5cb7e3c ESP: f5cb7e34
Sep 08 02:18:19 myhost kernel: DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
Sep 08 02:18:19 myhost kernel: CR0: 80050033 CR2: 00000000 CR3: 35c93000 CR4: 000007d0
Sep 08 02:18:19 myhost kernel: DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
Sep 08 02:18:19 myhost kernel: DR6: ffff0ff0 DR7: 00000400
Sep 08 02:18:19 myhost kernel: Stack:
Sep 08 02:18:19 myhost kernel: f4502000 00000044 f5cb7f18 f9ac9c65 00000001 f9aea1ce f9ae06a0 f9aec0b8
Sep 08 02:18:19 myhost kernel: 000001f6 0000e200 00000001 00000000 f842d2e0 00000000 f9bd6070 bf9df21c
Sep 08 02:18:19 myhost kernel: 00000044 f9c384c0 f5cb7e88 00000000 00000070 00000001 00000004 00000001
Sep 08 02:18:19 myhost kernel: Call Trace:
Sep 08 02:18:19 myhost kernel: [<f9ac9c65>] drm_ioctl+0x485/0x540 [drm]
Sep 08 02:18:19 myhost kernel: [<f842d2e0>] ? ext4_file_write+0xd0/0x470 [ext4]
Sep 08 02:18:19 myhost kernel: [<f9bd6070>] ? emgd_set_real_dispatch+0x10/0x10 [emgd]
Sep 08 02:18:19 myhost kernel: [<c030cea5>] ? __copy_to_user_ll+0x55/0x60
Sep 08 02:18:19 myhost kernel: [<c02424a1>] ? do_sync_write+0x61/0x90
Sep 08 02:18:19 myhost kernel: [<f9ac97e0>] ? drm_copy_field+0x70/0x70 [drm]
Sep 08 02:18:19 myhost kernel: [<c0252306>] do_vfs_ioctl+0x2e6/0x4e0
Sep 08 02:18:19 myhost kernel: [<c02448b1>] ? __sb_end_write+0x31/0x70
Sep 08 02:18:19 myhost kernel: [<c0242cfd>] ? vfs_write+0x17d/0x1b0
Sep 08 02:18:19 myhost kernel: [<c025257f>] SyS_ioctl+0x7f/0x90
Sep 08 02:18:19 myhost kernel: [<c0446470>] ? netpoll_poll_dev+0x210/0x880
Sep 08 02:18:19 myhost kernel: [<c0446470>] ? netpoll_poll_dev+0x210/0x880
Sep 08 02:18:19 myhost kernel: [<c051134d>] sysenter_do_call+0x12/0x28
Sep 08 02:18:19 myhost kernel: [<c0446470>] ? netpoll_poll_dev+0x210/0x880
Sep 08 02:18:19 myhost kernel: [<c0446470>] ? netpoll_poll_dev+0x210/0x880
Sep 08 02:18:19 myhost kernel: Code: 8a 0e 88 0f 8d b4 26 00 00 00 00 8b 45 f0 83 c4 04 5b 5e 5f 5d c3 90 8d 74 26 00 55 89 e5 57 53 3e 8d 74 26 00 89 c3 89 c7 89 d0 <f3> aa 89 d8 5b 5f 5d c3 bb 00 e0 ff ff 21 e3 3b 4b 18 73 67 8d
Sep 08 02:18:19 myhost kernel: EIP: [<c030c9c0>] memset+0x10/0x18 SS:ESP 0068:f5cb7e34
Sep 08 02:18:19 myhost kernel: CR2: 0000000000000000
Sep 08 02:18:19 myhost kernel: ---[ end trace 221190141c82caf0 ]---
Sep 08 02:18:19 myhost kernel: [drm:drm_release] *ERROR* Device busy: 1
commit eb1ec5fe04999f8fdd6d797beb28d0099d63e715
Author: sergeykish <[email protected]>
Date: Sun Sep 8 04:44:22 2013 +0300
remove crap
diff --git a/pvr/services4/srvkm/env/linux/proc.c b/pvr/services4/srvkm/env/linux/proc.c
index 99ff422..503d8b7 100644
--- a/pvr/services4/srvkm/env/linux/proc.c
+++ b/pvr/services4/srvkm/env/linux/proc.c
@@ -52,40 +52,11 @@ static const IMG_CHAR PVRProcDirRoot[] = "pvr";
#define PVR_PROC_SEQ_START_TOKEN (void*)1
-static IMG_INT pvr_proc_open(struct inode *inode,struct file *file);
-static void *pvr_proc_seq_start (struct seq_file *m, loff_t *pos);
-static void pvr_proc_seq_stop (struct seq_file *m, void *v);
-static void *pvr_proc_seq_next (struct seq_file *m, void *v, loff_t *pos);
-static int pvr_proc_seq_show (struct seq_file *m, void *v);
-static ssize_t pvr_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos);
-
-static struct file_operations pvr_proc_operations =
-{
- .open = pvr_proc_open,
- .read = seq_read,
- .write = pvr_proc_write,
- .llseek = seq_lseek,
- .release = seq_release,
-};
-
-static struct seq_operations pvr_proc_seq_operations =
-{
- .start = pvr_proc_seq_start,
- .next = pvr_proc_seq_next,
- .stop = pvr_proc_seq_stop,
- .show = pvr_proc_seq_show,
-};
static struct proc_dir_entry* g_pProcQueue;
static struct proc_dir_entry* g_pProcVersion;
static struct proc_dir_entry* g_pProcSysNodes;
-
-#ifdef PVR_MANUAL_POWER_CONTROL
-static struct proc_dir_entry* g_pProcPowerLevel;
-#endif
-
-
static void ProcSeqShowVersion(struct seq_file *sfile,void* el);
static void ProcSeqShowSysNodes(struct seq_file *sfile,void* el);
static void* ProcSeqOff2ElementSysNodes(struct seq_file * sfile, loff_t off);
@@ -118,16 +89,6 @@ off_t printAppend(IMG_CHAR * buffer, size_t size, off_t off, const IMG_CHAR * fo
}
-
-void* ProcSeq1ElementOff2Element(struct seq_file *sfile, loff_t off)
-{
-
- if(!off)
- return (void*)2;
- return NULL;
-}
-
-
void* ProcSeq1ElementHeaderOff2Element(struct seq_file *sfile, loff_t off)
{
if(!off)
@@ -143,418 +104,6 @@ void* ProcSeq1ElementHeaderOff2Element(struct seq_file *sfile, loff_t off)
}
-static IMG_INT pvr_proc_open(struct inode *inode,struct file *file)
-{
- IMG_INT ret = seq_open(file, &pvr_proc_seq_operations);
-
- struct seq_file *seq = (struct seq_file*)file->private_data;
- struct proc_dir_entry* pvr_proc_entry = PDE(inode);
-
-
- seq->private = pvr_proc_entry->data;
- return ret;
-}
-
-static ssize_t pvr_proc_write(struct file *file, const char __user *buffer,
- size_t count, loff_t *ppos)
-{
- struct inode *inode = file->f_path.dentry->d_inode;
- struct proc_dir_entry * dp;
-
- dp = PDE(inode);
-
- if (!dp->write_proc)
- return -EIO;
-
- return dp->write_proc(file, buffer, count, dp->data);
-}
-
-
-static void *pvr_proc_seq_start (struct seq_file *proc_seq_file, loff_t *pos)
-{
- PVR_PROC_SEQ_HANDLERS *handlers = (PVR_PROC_SEQ_HANDLERS*)proc_seq_file->private;
- if(handlers->startstop != NULL)
- handlers->startstop(proc_seq_file, IMG_TRUE);
- return handlers->off2element(proc_seq_file, *pos);
-}
-
-static void pvr_proc_seq_stop (struct seq_file *proc_seq_file, void *v)
-{
- PVR_PROC_SEQ_HANDLERS *handlers = (PVR_PROC_SEQ_HANDLERS*)proc_seq_file->private;
- if(handlers->startstop != NULL)
- handlers->startstop(proc_seq_file, IMG_FALSE);
-}
-
-static void *pvr_proc_seq_next (struct seq_file *proc_seq_file, void *v, loff_t *pos)
-{
- PVR_PROC_SEQ_HANDLERS *handlers = (PVR_PROC_SEQ_HANDLERS*)proc_seq_file->private;
- (*pos)++;
- if( handlers->next != NULL)
- return handlers->next( proc_seq_file, v, *pos );
- return handlers->off2element(proc_seq_file, *pos);
-}
-
-static int pvr_proc_seq_show (struct seq_file *proc_seq_file, void *v)
-{
- PVR_PROC_SEQ_HANDLERS *handlers = (PVR_PROC_SEQ_HANDLERS*)proc_seq_file->private;
- handlers->show( proc_seq_file,v );
- return 0;
-}
-
-
-
-static struct proc_dir_entry* CreateProcEntryInDirSeq(
- struct proc_dir_entry *pdir,
- const IMG_CHAR * name,
- IMG_VOID* data,
- pvr_next_proc_seq_t next_handler,
- pvr_show_proc_seq_t show_handler,
- pvr_off2element_proc_seq_t off2element_handler,
- pvr_startstop_proc_seq_t startstop_handler,
- write_proc_t whandler
- )
-{
-
- struct proc_dir_entry * file;
- mode_t mode;
-
- if (!dir)
- {
- PVR_DPF((PVR_DBG_ERROR, "CreateProcEntryInDirSeq: cannot make proc entry /proc/%s/%s: no parent", PVRProcDirRoot, name));
- return NULL;
- }
-
- mode = S_IFREG;
-
- if (show_handler)
- {
- mode |= S_IRUGO;
- }
-
- if (whandler)
- {
- mode |= S_IWUSR;
- }
-
- file=create_proc_entry(name, mode, pdir);
-
- if (file)
- {
- PVR_PROC_SEQ_HANDLERS *seq_handlers;
-
- file->proc_fops = &pvr_proc_operations;
- file->write_proc = whandler;
-
-
- file->data = kmalloc(sizeof(PVR_PROC_SEQ_HANDLERS), GFP_KERNEL);
- if(file->data)
- {
- seq_handlers = (PVR_PROC_SEQ_HANDLERS*)file->data;
- seq_handlers->next = next_handler;
- seq_handlers->show = show_handler;
- seq_handlers->off2element = off2element_handler;
- seq_handlers->startstop = startstop_handler;
- seq_handlers->data = data;
-
- return file;
- }
- }
-
- PVR_DPF((PVR_DBG_ERROR, "CreateProcEntryInDirSeq: cannot make proc entry /proc/%s/%s: no memory", PVRProcDirRoot, name));
- return 0;
-}
-
-
-struct proc_dir_entry* CreateProcReadEntrySeq (
- const IMG_CHAR * name,
- IMG_VOID* data,
- pvr_next_proc_seq_t next_handler,
- pvr_show_proc_seq_t show_handler,
- pvr_off2element_proc_seq_t off2element_handler,
- pvr_startstop_proc_seq_t startstop_handler
- )
-{
- return CreateProcEntrySeq(name,
- data,
- next_handler,
- show_handler,
- off2element_handler,
- startstop_handler,
- NULL);
-}
-
-struct proc_dir_entry* CreateProcEntrySeq (
- const IMG_CHAR * name,
- IMG_VOID* data,
- pvr_next_proc_seq_t next_handler,
- pvr_show_proc_seq_t show_handler,
- pvr_off2element_proc_seq_t off2element_handler,
- pvr_startstop_proc_seq_t startstop_handler,
- write_proc_t whandler
- )
-{
- return CreateProcEntryInDirSeq(
- dir,
- name,
- data,
- next_handler,
- show_handler,
- off2element_handler,
- startstop_handler,
- NULL
- );
-}
-
-
-
-struct proc_dir_entry* CreatePerProcessProcEntrySeq (
- const IMG_CHAR * name,
- IMG_VOID* data,
- pvr_next_proc_seq_t next_handler,
- pvr_show_proc_seq_t show_handler,
- pvr_off2element_proc_seq_t off2element_handler,
- pvr_startstop_proc_seq_t startstop_handler,
- write_proc_t whandler
- )
-{
- PVRSRV_ENV_PER_PROCESS_DATA *psPerProc;
- IMG_UINT32 ui32PID;
-
- if (!dir)
- {
- PVR_DPF((PVR_DBG_ERROR, "CreatePerProcessProcEntrySeq: /proc/%s doesn't exist", PVRProcDirRoot));
- return NULL;
- }
-
- ui32PID = OSGetCurrentProcessIDKM();
-
- psPerProc = PVRSRVPerProcessPrivateData(ui32PID);
- if (!psPerProc)
- {
- PVR_DPF((PVR_DBG_ERROR, "CreatePerProcessProcEntrySeq: no per process data"));
-
- return NULL;
- }
-
- if (!psPerProc->psProcDir)
- {
- IMG_CHAR dirname[16];
- IMG_INT ret;
-
- ret = snprintf(dirname, sizeof(dirname), "%lu", ui32PID);
-
- if (ret <=0 || ret >= (IMG_INT)sizeof(dirname))
- {
- PVR_DPF((PVR_DBG_ERROR, "CreatePerProcessProcEntries: couldn't generate per process proc directory name \"%u\"", ui32PID));
- return NULL;
- }
- else
- {
- psPerProc->psProcDir = proc_mkdir(dirname, dir);
- if (!psPerProc->psProcDir)
- {
- PVR_DPF((PVR_DBG_ERROR, "CreatePerProcessProcEntries: couldn't create per process proc directory /proc/%s/%u",
- PVRProcDirRoot, ui32PID));
- return NULL;
- }
- }
- }
-
- return CreateProcEntryInDirSeq(psPerProc->psProcDir, name, data, next_handler,
- show_handler,off2element_handler,startstop_handler,whandler);
-}
-
-
-IMG_VOID RemoveProcEntrySeq( struct proc_dir_entry* proc_entry )
-{
- if (dir)
- {
- void* data = proc_entry->data ;
- PVR_DPF((PVR_DBG_MESSAGE, "Removing /proc/%s/%s", PVRProcDirRoot, proc_entry->name));
-
- remove_proc_entry(proc_entry->name, dir);
- if( data)
- kfree( data );
-
- }
-}
-
-IMG_VOID RemovePerProcessProcEntrySeq(struct proc_dir_entry* proc_entry)
-{
- PVRSRV_ENV_PER_PROCESS_DATA *psPerProc;
-
- psPerProc = LinuxTerminatingProcessPrivateData();
- if (!psPerProc)
- {
- psPerProc = PVRSRVFindPerProcessPrivateData();
- if (!psPerProc)
- {
- PVR_DPF((PVR_DBG_ERROR, "CreatePerProcessProcEntries: can't "
- "remove %s, no per process data", proc_entry->name));
- return;
- }
- }
-
- if (psPerProc->psProcDir)
- {
- void* data = proc_entry->data ;
- PVR_DPF((PVR_DBG_MESSAGE, "Removing proc entry %s from %s", proc_entry->name, psPerProc->psProcDir->name));
-
- remove_proc_entry(proc_entry->name, psPerProc->psProcDir);
- if(data)
- kfree( data );
- }
-}
-
-
-static IMG_INT pvr_read_proc(IMG_CHAR *page, IMG_CHAR **start, off_t off,
- IMG_INT count, IMG_INT *eof, IMG_VOID *data)
-{
- pvr_read_proc_t *pprn = (pvr_read_proc_t *)data;
-
- off_t len = pprn (page, (size_t)count, off);
-
- if (len == END_OF_FILE)
- {
- len = 0;
- *eof = 1;
- }
- else if (!len)
- {
- *start = (IMG_CHAR *) 0;
- }
- else
- {
- *start = (IMG_CHAR *) 1;
- }
-
- return len;
-}
-
-
-static IMG_INT CreateProcEntryInDir(struct proc_dir_entry *pdir, const IMG_CHAR * name, read_proc_t rhandler, write_proc_t whandler, IMG_VOID *data)
-{
- struct proc_dir_entry * file;
- mode_t mode;
-
- if (!pdir)
- {
- PVR_DPF((PVR_DBG_ERROR, "CreateProcEntryInDir: parent directory doesn't exist"));
-
- return -ENOMEM;
- }
-
- mode = S_IFREG;
-
- if (rhandler)
- {
- mode |= S_IRUGO;
- }
-
- if (whandler)
- {
- mode |= S_IWUSR;
- }
-
- file = create_proc_entry(name, mode, pdir);
-
- if (file)
- {
- file->read_proc = rhandler;
- file->write_proc = whandler;
- file->data = data;
-
- PVR_DPF((PVR_DBG_MESSAGE, "Created proc entry %s in %s", name, pdir->name));
-
- return 0;
- }
-
- PVR_DPF((PVR_DBG_ERROR, "CreateProcEntry: cannot create proc entry %s in %s", name, pdir->name));
-
- return -ENOMEM;
-}
-
-
-IMG_INT CreateProcEntry(const IMG_CHAR * name, read_proc_t rhandler, write_proc_t whandler, IMG_VOID *data)
-{
- return CreateProcEntryInDir(dir, name, rhandler, whandler, data);
-}
-
-
-IMG_INT CreatePerProcessProcEntry(const IMG_CHAR * name, read_proc_t rhandler, write_proc_t whandler, IMG_VOID *data)
-{
- PVRSRV_ENV_PER_PROCESS_DATA *psPerProc;
- IMG_UINT32 ui32PID;
-
- if (!dir)
- {
- PVR_DPF((PVR_DBG_ERROR, "CreatePerProcessProcEntries: /proc/%s doesn't exist", PVRProcDirRoot));
-
- return -ENOMEM;
- }
-
- ui32PID = OSGetCurrentProcessIDKM();
-
- psPerProc = PVRSRVPerProcessPrivateData(ui32PID);
- if (!psPerProc)
- {
- PVR_DPF((PVR_DBG_ERROR, "CreatePerProcessProcEntries: no per process data"));
-
- return -ENOMEM;
- }
-
- if (!psPerProc->psProcDir)
- {
- IMG_CHAR dirname[16];
- IMG_INT ret;
-
- ret = snprintf(dirname, sizeof(dirname), "%lu", ui32PID);
-
- if (ret <=0 || ret >= (IMG_INT)sizeof(dirname))
- {
- PVR_DPF((PVR_DBG_ERROR, "CreatePerProcessProcEntries: couldn't generate per process proc directory name \"%u\"", ui32PID));
-
- return -ENOMEM;
- }
- else
- {
- psPerProc->psProcDir = proc_mkdir(dirname, dir);
- if (!psPerProc->psProcDir)
- {
- PVR_DPF((PVR_DBG_ERROR, "CreatePerProcessProcEntries: couldn't create per process proc directory /proc/%s/%u", PVRProcDirRoot, ui32PID));
-
- return -ENOMEM;
- }
- }
- }
-
- return CreateProcEntryInDir(psPerProc->psProcDir, name, rhandler, whandler, data);
-}
-
-
-IMG_INT CreateProcReadEntry(const IMG_CHAR * name, pvr_read_proc_t handler)
-{
- struct proc_dir_entry * file;
-
- if (!dir)
- {
- PVR_DPF((PVR_DBG_ERROR, "CreateProcReadEntry: cannot make proc entry /proc/%s/%s: no parent", PVRProcDirRoot, name));
-
- return -ENOMEM;
- }
-
- file = create_proc_read_entry (name, S_IFREG | S_IRUGO, dir, pvr_read_proc, (IMG_VOID *)handler);
-
- if (file)
- {
- return 0;
- }
-
- PVR_DPF((PVR_DBG_ERROR, "CreateProcReadEntry: cannot make proc entry /proc/%s/%s: no memory", PVRProcDirRoot, name));
-
- return -ENOMEM;
-}
-
static void *queue_seq_start (struct seq_file *proc_seq_file, loff_t *pos)
{
return ProcSeqOff2ElementQueue(proc_seq_file, *pos);
@@ -701,75 +250,16 @@ IMG_INT CreateProcEntries(IMG_VOID)
return -ENOMEM;
}
-
-
return 0;
}
-IMG_VOID RemoveProcEntry(const IMG_CHAR * name)
-{
- if (dir)
- {
- remove_proc_entry(name, dir);
- PVR_DPF((PVR_DBG_MESSAGE, "Removing /proc/%s/%s", PVRProcDirRoot, name));
- }
-}
-
-
-IMG_VOID RemovePerProcessProcEntry(const IMG_CHAR *name)
-{
- PVRSRV_ENV_PER_PROCESS_DATA *psPerProc;
-
- psPerProc = LinuxTerminatingProcessPrivateData();
- if (!psPerProc)
- {
- psPerProc = PVRSRVFindPerProcessPrivateData();
- if (!psPerProc)
- {
- PVR_DPF((PVR_DBG_ERROR, "CreatePerProcessProcEntries: can't "
- "remove %s, no per process data", name));
- return;
- }
- }
-
- if (psPerProc->psProcDir)
- {
- remove_proc_entry(name, psPerProc->psProcDir);
-
- PVR_DPF((PVR_DBG_MESSAGE, "Removing proc entry %s from %s", name, psPerProc->psProcDir->name));
- }
-}
-
-
IMG_VOID RemovePerProcessProcDir(PVRSRV_ENV_PER_PROCESS_DATA *psPerProc)
{
- if (psPerProc->psProcDir)
- {
- while (psPerProc->psProcDir->subdir)
- {
- PVR_DPF((PVR_DBG_WARNING, "Belatedly removing /proc/%s/%s/%s", PVRProcDirRoot, psPerProc->psProcDir->name, psPerProc->psProcDir->subdir->name));
-
- RemoveProcEntry(psPerProc->psProcDir->subdir->name);
- }
- RemoveProcEntry(psPerProc->psProcDir->name);
- }
}
IMG_VOID RemoveProcEntries(IMG_VOID)
{
- proc_remove(g_pProcQueue);
- proc_remove(g_pProcVersion);
- proc_remove(g_pProcSysNodes);
-
- while (dir->subdir)
- {
- PVR_DPF((PVR_DBG_WARNING, "Belatedly removing /proc/%s/%s", PVRProcDirRoot, dir->subdir->name));
-
- RemoveProcEntry(dir->subdir->name);
- }
-
- proc_remove(dir);
}
diff --git a/pvr/services4/srvkm/env/linux/proc.h b/pvr/services4/srvkm/env/linux/proc.h
index dc0ffe6..5348099 100644
--- a/pvr/services4/srvkm/env/linux/proc.h
+++ b/pvr/services4/srvkm/env/linux/proc.h
@@ -66,50 +66,6 @@ off_t printAppend(IMG_CHAR * buffer, size_t size, off_t off, const IMG_CHAR * fo
IMG_INT CreateProcEntries(IMG_VOID);
-IMG_INT CreateProcReadEntry (const IMG_CHAR * name, pvr_read_proc_t handler);
-
-IMG_INT CreateProcEntry(const IMG_CHAR * name, read_proc_t rhandler, write_proc_t whandler, IMG_VOID *data);
-
-IMG_INT CreatePerProcessProcEntry(const IMG_CHAR * name, read_proc_t rhandler, write_proc_t whandler, IMG_VOID *data);
-
-IMG_VOID RemoveProcEntry(const IMG_CHAR * name);
-
-IMG_VOID RemovePerProcessProcEntry(const IMG_CHAR * name);
-
IMG_VOID RemoveProcEntries(IMG_VOID);
-struct proc_dir_entry* CreateProcReadEntrySeq (
- const IMG_CHAR* name,
- IMG_VOID* data,
- pvr_next_proc_seq_t next_handler,
- pvr_show_proc_seq_t show_handler,
- pvr_off2element_proc_seq_t off2element_handler,
- pvr_startstop_proc_seq_t startstop_handler
- );
-
-struct proc_dir_entry* CreateProcEntrySeq (
- const IMG_CHAR* name,
- IMG_VOID* data,
- pvr_next_proc_seq_t next_handler,
- pvr_show_proc_seq_t show_handler,
- pvr_off2element_proc_seq_t off2element_handler,
- pvr_startstop_proc_seq_t startstop_handler,
- write_proc_t whandler
- );
-
-struct proc_dir_entry* CreatePerProcessProcEntrySeq (
- const IMG_CHAR* name,
- IMG_VOID* data,
- pvr_next_proc_seq_t next_handler,
- pvr_show_proc_seq_t show_handler,
- pvr_off2element_proc_seq_t off2element_handler,
- pvr_startstop_proc_seq_t startstop_handler,
- write_proc_t whandler
- );
-
-
-IMG_VOID RemoveProcEntrySeq(struct proc_dir_entry* proc_entry);
-IMG_VOID RemovePerProcessProcEntrySeq(struct proc_dir_entry* proc_entry);
-
-
#endif
commit 810ecf384d10ff6e5fe48852506617283a1b2945
Author: sergeykish <[email protected]>
Date: Sun Sep 8 03:28:09 2013 +0300
hardcode seq_operations
diff --git a/pvr/services4/srvkm/env/linux/proc.c b/pvr/services4/srvkm/env/linux/proc.c
index a14ecd9..99ff422 100644
--- a/pvr/services4/srvkm/env/linux/proc.c
+++ b/pvr/services4/srvkm/env/linux/proc.c
@@ -87,7 +87,6 @@ static struct proc_dir_entry* g_pProcPowerLevel;
static void ProcSeqShowVersion(struct seq_file *sfile,void* el);
-
static void ProcSeqShowSysNodes(struct seq_file *sfile,void* el);
static void* ProcSeqOff2ElementSysNodes(struct seq_file * sfile, loff_t off);
@@ -556,6 +555,129 @@ IMG_INT CreateProcReadEntry(const IMG_CHAR * name, pvr_read_proc_t handler)
return -ENOMEM;
}
+static void *queue_seq_start (struct seq_file *proc_seq_file, loff_t *pos)
+{
+ return ProcSeqOff2ElementQueue(proc_seq_file, *pos);
+}
+
+static void queue_seq_stop (struct seq_file *proc_seq_file, void *v)
+{
+}
+
+static void *queue_seq_next (struct seq_file *proc_seq_file, void *v, loff_t *pos)
+{
+ (*pos)++;
+ return ProcSeqOff2ElementQueue(proc_seq_file, *pos);
+}
+
+static int queue_seq_show (struct seq_file *proc_seq_file, void *v)
+{
+ ProcSeqShowQueue( proc_seq_file,v );
+ return 0;
+}
+
+static const struct seq_operations queue_seq_ops = {
+ .start = queue_seq_start,
+ .next = queue_seq_next,
+ .stop = queue_seq_stop,
+ .show = queue_seq_show
+};
+
+static int queue_open(struct inode *inode, struct file *file)
+{
+ return seq_open(file, &queue_seq_ops);
+}
+
+static struct file_operations queue_file_ops =
+{
+ .open = queue_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release
+};
+
+static void *version_seq_start (struct seq_file *proc_seq_file, loff_t *pos)
+{
+ return ProcSeq1ElementHeaderOff2Element(proc_seq_file, *pos);
+}
+
+static void version_seq_stop (struct seq_file *proc_seq_file, void *v)
+{
+}
+
+static void *version_seq_next (struct seq_file *proc_seq_file, void *v, loff_t *pos)
+{
+ (*pos)++;
+ return ProcSeq1ElementHeaderOff2Element(proc_seq_file, *pos);
+}
+
+static int version_seq_show (struct seq_file *proc_seq_file, void *v)
+{
+ ProcSeqShowVersion( proc_seq_file,v );
+ return 0;
+}
+
+static const struct seq_operations version_seq_ops = {
+ .start = version_seq_start,
+ .next = version_seq_next,
+ .stop = version_seq_stop,
+ .show = version_seq_show
+};
+
+static int version_open(struct inode *inode, struct file *file)
+{
+ return seq_open(file, &version_seq_ops);
+}
+
+static struct file_operations version_file_ops =
+{
+ .open = version_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release
+};
+
+static void *nodes_seq_start (struct seq_file *proc_seq_file, loff_t *pos)
+{
+ return ProcSeqOff2ElementSysNodes(proc_seq_file, *pos);
+}
+
+static void nodes_seq_stop (struct seq_file *proc_seq_file, void *v)
+{
+}
+
+static void *nodes_seq_next (struct seq_file *proc_seq_file, void *v, loff_t *pos)
+{
+ (*pos)++;
+ return ProcSeqOff2ElementSysNodes(proc_seq_file, *pos);
+}
+
+static int nodes_seq_show (struct seq_file *proc_seq_file, void *v)
+{
+ ProcSeqShowSysNodes( proc_seq_file,v );
+ return 0;
+}
+
+static const struct seq_operations nodes_seq_ops = {
+ .start = nodes_seq_start,
+ .next = nodes_seq_next,
+ .stop = nodes_seq_stop,
+ .show = nodes_seq_show
+};
+
+static int nodes_open(struct inode *inode, struct file *file)
+{
+ return seq_open(file, &nodes_seq_ops);
+}
+
+static struct file_operations nodes_file_ops =
+{
+ .open = nodes_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release
+};
+
IMG_INT CreateProcEntries(IMG_VOID)
{
@@ -568,9 +690,9 @@ IMG_INT CreateProcEntries(IMG_VOID)
return -ENOMEM;
}
- g_pProcQueue = CreateProcReadEntrySeq("queue", NULL, NULL, ProcSeqShowQueue, ProcSeqOff2ElementQueue, NULL);
- g_pProcVersion = CreateProcReadEntrySeq("version", NULL, NULL, ProcSeqShowVersion, ProcSeq1ElementHeaderOff2Element, NULL);
- g_pProcSysNodes = CreateProcReadEntrySeq("nodes", NULL, NULL, ProcSeqShowSysNodes, ProcSeqOff2ElementSysNodes, NULL);
+ g_pProcQueue = proc_create("queue", S_IFREG | S_IRUGO, dir, &queue_file_ops);
+ g_pProcVersion = proc_create("version", S_IFREG | S_IRUGO, dir, &version_file_ops);
+ g_pProcSysNodes = proc_create("nodes", S_IFREG | S_IRUGO, dir, &nodes_file_ops);
if(!g_pProcQueue || !g_pProcVersion || !g_pProcSysNodes)
{
@@ -636,10 +758,9 @@ IMG_VOID RemovePerProcessProcDir(PVRSRV_ENV_PER_PROCESS_DATA *psPerProc)
IMG_VOID RemoveProcEntries(IMG_VOID)
{
-
- RemoveProcEntrySeq(g_pProcQueue);
- RemoveProcEntrySeq(g_pProcVersion);
- RemoveProcEntrySeq(g_pProcSysNodes);
+ proc_remove(g_pProcQueue);
+ proc_remove(g_pProcVersion);
+ proc_remove(g_pProcSysNodes);
while (dir->subdir)
{
@@ -648,7 +769,7 @@ IMG_VOID RemoveProcEntries(IMG_VOID)
RemoveProcEntry(dir->subdir->name);
}
- remove_proc_entry(PVRProcDirRoot, NULL);
+ proc_remove(dir);
}
commit c8dbd73f5e4390af51bd5619fec3077ae0337e30
Author: sergeykish <[email protected]>
Date: Fri Sep 6 14:54:57 2013 +0300
cppp -DPVR_PROC_USE_SEQ_FILE
diff --git a/pvr/services4/srvkm/env/linux/proc.c b/pvr/services4/srvkm/env/linux/proc.c
index a0004cc..a14ecd9 100644
--- a/pvr/services4/srvkm/env/linux/proc.c
+++ b/pvr/services4/srvkm/env/linux/proc.c
@@ -45,16 +45,11 @@ DECLARE_LIST_ANY_VA(PVRSRV_DEVICE_NODE);
static struct proc_dir_entry * dir;
-#ifndef PVR_PROC_USE_SEQ_FILE
-static off_t procDumpSysNodes(IMG_CHAR *buf, size_t size, off_t off);
-static off_t procDumpVersion(IMG_CHAR *buf, size_t size, off_t off);
-#endif
static const IMG_CHAR PVRProcDirRoot[] = "pvr";
-#ifdef PVR_PROC_USE_SEQ_FILE
#define PVR_PROC_SEQ_START_TOKEN (void*)1
static IMG_INT pvr_proc_open(struct inode *inode,struct file *file);
@@ -96,7 +91,6 @@ static void ProcSeqShowVersion(struct seq_file *sfile,void* el);
static void ProcSeqShowSysNodes(struct seq_file *sfile,void* el);
static void* ProcSeqOff2ElementSysNodes(struct seq_file * sfile, loff_t off);
-#endif
off_t printAppend(IMG_CHAR * buffer, size_t size, off_t off, const IMG_CHAR * format, ...)
{
@@ -125,7 +119,6 @@ off_t printAppend(IMG_CHAR * buffer, size_t size, off_t off, const IMG_CHAR * fo
}
-#ifdef PVR_PROC_USE_SEQ_FILE
void* ProcSeq1ElementOff2Element(struct seq_file *sfile, loff_t off)
{
@@ -414,7 +407,6 @@ IMG_VOID RemovePerProcessProcEntrySeq(struct proc_dir_entry* proc_entry)
}
}
-#endif
static IMG_INT pvr_read_proc(IMG_CHAR *page, IMG_CHAR **start, off_t off,
IMG_INT count, IMG_INT *eof, IMG_VOID *data)
@@ -576,17 +568,11 @@ IMG_INT CreateProcEntries(IMG_VOID)
return -ENOMEM;
}
-#ifdef PVR_PROC_USE_SEQ_FILE
g_pProcQueue = CreateProcReadEntrySeq("queue", NULL, NULL, ProcSeqShowQueue, ProcSeqOff2ElementQueue, NULL);
g_pProcVersion = CreateProcReadEntrySeq("version", NULL, NULL, ProcSeqShowVersion, ProcSeq1ElementHeaderOff2Element, NULL);
g_pProcSysNodes = CreateProcReadEntrySeq("nodes", NULL, NULL, ProcSeqShowSysNodes, ProcSeqOff2ElementSysNodes, NULL);
if(!g_pProcQueue || !g_pProcVersion || !g_pProcSysNodes)
-#else
- if (CreateProcReadEntry("queue", QueuePrintQueues) ||
- CreateProcReadEntry("version", procDumpVersion) ||
- CreateProcReadEntry("nodes", procDumpSysNodes))
-#endif
{
PVR_DPF((PVR_DBG_ERROR, "CreateProcEntries: couldn't make /proc/%s files", PVRProcDirRoot));
@@ -651,15 +637,9 @@ IMG_VOID RemovePerProcessProcDir(PVRSRV_ENV_PER_PROCESS_DATA *psPerProc)
IMG_VOID RemoveProcEntries(IMG_VOID)
{
-#ifdef PVR_PROC_USE_SEQ_FILE
RemoveProcEntrySeq(g_pProcQueue);
RemoveProcEntrySeq(g_pProcVersion);
RemoveProcEntrySeq(g_pProcSysNodes);
-#else
- RemoveProcEntry("queue");
- RemoveProcEntry("version");
- RemoveProcEntry("nodes");
-#endif
while (dir->subdir)
{
@@ -672,7 +652,6 @@ IMG_VOID RemoveProcEntries(IMG_VOID)
}
-#ifdef PVR_PROC_USE_SEQ_FILE
static void ProcSeqShowVersion(struct seq_file *sfile,void* el)
{
@@ -698,46 +677,6 @@ static void ProcSeqShowVersion(struct seq_file *sfile,void* el)
seq_printf( sfile, "System Version String: %s\n", pszSystemVersionString);
}
-#else
-
-static off_t procDumpVersion(IMG_CHAR *buf, size_t size, off_t off)
-{
- SYS_DATA *psSysData;
-
- if (off == 0)
- {
- return printAppend(buf, size, 0,
- "Version %s (%s) %s\n",
- PVRVERSION_STRING,
- PVR_BUILD_TYPE, PVR_BUILD_DIR);
- }
-
- SysAcquireData(&psSysData)
-
- if (off == 1)
- {
- IMG_CHAR *pszSystemVersionString = "None";
-
- if(psSysData->pszVersionString)
- {
- pszSystemVersionString = psSysData->pszVersionString;
- }
-
- if(strlen(pszSystemVersionString)
- + strlen("System Version String: \n")
- + 1 > size)
- {
- return 0;
- }
- return printAppend(buf, size, 0,
- "System Version String: %s\n",
- pszSystemVersionString);
- }
-
- return END_OF_FILE;
-}
-
-#endif
static const IMG_CHAR *deviceTypeToString(PVRSRV_DEVICE_TYPE deviceType)
@@ -795,7 +734,6 @@ IMG_VOID* DecOffPsDev_AnyVaCb(PVRSRV_DEVICE_NODE *psNode, va_list va)
}
}
-#ifdef PVR_PROC_USE_SEQ_FILE
static void ProcSeqShowSysNodes(struct seq_file *sfile,void* el)
{
@@ -846,53 +784,4 @@ static void* ProcSeqOff2ElementSysNodes(struct seq_file * sfile, loff_t off)
return (void*)psDevNode;
}
-#else
-
-static
-off_t procDumpSysNodes(IMG_CHAR *buf, size_t size, off_t off)
-{
- SYS_DATA *psSysData;
- PVRSRV_DEVICE_NODE *psDevNode;
- off_t len;
-
-
- if (size < 80)
- {
- return 0;
- }
-
- if (off == 0)
- {
- return printAppend(buf, size, 0,
- "Registered nodes\n"
- "Addr Type Class Index Ref pvDev Size Res\n");
- }
-
- SysAcquireData(&psSysData);
-
-
- psDevNode = (PVRSRV_DEVICE_NODE*)
- List_PVRSRV_DEVICE_NODE_Any_va(psSysData->psDeviceNodeList,
- DecOffPsDev_AnyVaCb,
- &off);
-
- if (!psDevNode)
- {
- return END_OF_FILE;
- }
-
- len = printAppend(buf, size, 0,
- "%p %-8s %-8s %4d %2lu %p %3lu %p\n",
- psDevNode,
- deviceTypeToString(psDevNode->sDevId.eDeviceType),
- deviceClassToString(psDevNode->sDevId.eDeviceClass),
- psDevNode->sDevId.eDeviceClass,
- psDevNode->ui32RefCount,
- psDevNode->pvDevice,
- psDevNode->ui32pvDeviceSize,
- psDevNode->hResManContext);
- return (len);
-}
-
-#endif
diff --git a/pvr/services4/srvkm/env/linux/proc.h b/pvr/services4/srvkm/env/linux/proc.h
index 37849c2..dc0ffe6 100644
--- a/pvr/services4/srvkm/env/linux/proc.h
+++ b/pvr/services4/srvkm/env/linux/proc.h
@@ -40,7 +40,6 @@
typedef off_t (pvr_read_proc_t)(IMG_CHAR *, size_t, off_t);
-#ifdef PVR_PROC_USE_SEQ_FILE
#define PVR_PROC_SEQ_START_TOKEN (void*)1
typedef void* (pvr_next_proc_seq_t)(struct seq_file *,void*,loff_t);
typedef void* (pvr_off2element_proc_seq_t)(struct seq_file *, loff_t);
@@ -61,7 +60,6 @@ void* ProcSeq1ElementOff2Element(struct seq_file *sfile, loff_t off);
void* ProcSeq1ElementHeaderOff2Element(struct seq_file *sfile, loff_t off);
-#endif
off_t printAppend(IMG_CHAR * buffer, size_t size, off_t off, const IMG_CHAR * format, ...)
__attribute__((format(printf, 4, 5)));
@@ -80,7 +78,6 @@ IMG_VOID RemovePerProcessProcEntry(const IMG_CHAR * name);
IMG_VOID RemoveProcEntries(IMG_VOID);
-#ifdef PVR_PROC_USE_SEQ_FILE
struct proc_dir_entry* CreateProcReadEntrySeq (
const IMG_CHAR* name,
IMG_VOID* data,
@@ -114,6 +111,5 @@ struct proc_dir_entry* CreatePerProcessProcEntrySeq (
IMG_VOID RemoveProcEntrySeq(struct proc_dir_entry* proc_entry);
IMG_VOID RemovePerProcessProcEntrySeq(struct proc_dir_entry* proc_entry);
-#endif
#endif
commit 3bc63246b9d89b207338af3ac717c77a0869f8c5
Author: sergeykish <[email protected]>
Date: Fri Sep 6 14:53:32 2013 +0300
cppp -UDEBUG
diff --git a/pvr/services4/srvkm/common/ra.c b/pvr/services4/srvkm/common/ra.c
index c2f7fb5..18cb29c 100644
--- a/pvr/services4/srvkm/common/ra.c
+++ b/pvr/services4/srvkm/common/ra.c
@@ -137,63 +137,16 @@ struct _RA_ARENA_
RA_STATISTICS sStatistics;
#endif
-#if defined(CONFIG_PROC_FS) && defined(DEBUG)
-#define PROC_NAME_SIZE 32
-
-#ifdef PVR_PROC_USE_SEQ_FILE
- struct proc_dir_entry* pProcInfo;
- struct proc_dir_entry* pProcSegs;
-#else
- IMG_CHAR szProcInfoName[PROC_NAME_SIZE];
- IMG_CHAR szProcSegsName[PROC_NAME_SIZE];
-#endif
-
- IMG_BOOL bInitProcEntry;
-#endif
};
#if defined(ENABLE_RA_DUMP)
IMG_VOID RA_Dump (RA_ARENA *pArena);
#endif
-#if defined(CONFIG_PROC_FS) && defined(DEBUG)
-
-#ifdef PVR_PROC_USE_SEQ_FILE
-
-static void RA_ProcSeqShowInfo(struct seq_file *sfile, void* el);
-static void* RA_ProcSeqOff2ElementInfo(struct seq_file * sfile, loff_t off);
-
-static void RA_ProcSeqShowRegs(struct seq_file *sfile, void* el);
-static void* RA_ProcSeqOff2ElementRegs(struct seq_file * sfile, loff_t off);
-
-#else
-static IMG_INT
-RA_DumpSegs(IMG_CHAR *page, IMG_CHAR **start, off_t off, IMG_INT count, IMG_INT *eof, IMG_VOID *data);
-static IMG_INT
-RA_DumpInfo(IMG_CHAR *page, IMG_CHAR **start, off_t off, IMG_INT count, IMG_INT *eof, IMG_VOID *data);
-#endif
-
-#endif
#ifdef USE_BM_FREESPACE_CHECK
IMG_VOID CheckBMFreespace(IMG_VOID);
#endif
-#if defined(CONFIG_PROC_FS) && defined(DEBUG)
-static IMG_CHAR *ReplaceSpaces(IMG_CHAR * const pS)
-{
- IMG_CHAR *pT;
-
- for(pT = pS; *pT != 0; pT++)
- {
- if (*pT == ' ' || *pT == '\t')
- {
- *pT = '_';
- }
- }
-
- return pS;
-}
-#endif
static IMG_BOOL
_RequestAllocFail (IMG_VOID *_h,
@@ -903,86 +856,6 @@ RA_Create (IMG_CHAR *name,
pArena->sStatistics.uExportCount = 0;
#endif
-#if defined(CONFIG_PROC_FS) && defined(DEBUG)
- if(strcmp(pArena->name,"") != 0)
- {
-
-#ifndef PVR_PROC_USE_SEQ_FILE
- IMG_INT ret;
- IMG_INT (*pfnCreateProcEntry)(const IMG_CHAR *, read_proc_t, write_proc_t, IMG_VOID *);
-
- pArena->bInitProcEntry = !PVRSRVGetInitServerState(PVRSRV_INIT_SERVER_SUCCESSFUL);
-
-
- pfnCreateProcEntry = pArena->bInitProcEntry ? CreateProcEntry : CreatePerProcessProcEntry;
-
- ret = snprintf(pArena->szProcInfoName, sizeof(pArena->szProcInfoName), "ra_info_%s", pArena->name);
- if (ret > 0 && ret < sizeof(pArena->szProcInfoName))
- {
- (IMG_VOID) pfnCreateProcEntry(ReplaceSpaces(pArena->szProcInfoName), RA_DumpInfo, 0, pArena);
- }
- else
- {
- pArena->szProcInfoName[0] = 0;
- PVR_DPF((PVR_DBG_ERROR, "RA_Create: couldn't create ra_info proc entry for arena %s", pArena->name));
- }
-
- ret = snprintf(pArena->szProcSegsName, sizeof(pArena->szProcSegsName), "ra_segs_%s", pArena->name);
- if (ret > 0 && ret < sizeof(pArena->szProcSegsName))
- {
- (IMG_VOID) pfnCreateProcEntry(ReplaceSpaces(pArena->szProcSegsName), RA_DumpSegs, 0, pArena);
- }
- else
- {
- pArena->szProcSegsName[0] = 0;
- PVR_DPF((PVR_DBG_ERROR, "RA_Create: couldn't create ra_segs proc entry for arena %s", pArena->name));
- }
-#else
-
- IMG_INT ret;
- IMG_CHAR szProcInfoName[PROC_NAME_SIZE];
- IMG_CHAR szProcSegsName[PROC_NAME_SIZE];
- struct proc_dir_entry* (*pfnCreateProcEntrySeq)(const IMG_CHAR *,
- IMG_VOID*,
- pvr_next_proc_seq_t,
- pvr_show_proc_seq_t,
- pvr_off2element_proc_seq_t,
- pvr_startstop_proc_seq_t,
- write_proc_t);
-
- pArena->bInitProcEntry = !PVRSRVGetInitServerState(PVRSRV_INIT_SERVER_SUCCESSFUL);
-
-
- pfnCreateProcEntrySeq = pArena->bInitProcEntry ? CreateProcEntrySeq : CreatePerProcessProcEntrySeq;
-
- ret = snprintf(szProcInfoName, sizeof(szProcInfoName), "ra_info_%s", pArena->name);
- if (ret > 0 && ret < sizeof(szProcInfoName))
- {
- pArena->pProcInfo = pfnCreateProcEntrySeq(ReplaceSpaces(szProcInfoName), pArena, NULL,
- RA_ProcSeqShowInfo, RA_ProcSeqOff2ElementInfo, NULL, NULL);
- }
- else
- {
- pArena->pProcInfo = 0;
- PVR_DPF((PVR_DBG_ERROR, "RA_Create: couldn't create ra_info proc entry for arena %s", pArena->name));
- }
-
- ret = snprintf(szProcSegsName, sizeof(szProcSegsName), "ra_segs_%s", pArena->name);
- if (ret > 0 && ret < sizeof(szProcInfoName))
- {
- pArena->pProcSegs = pfnCreateProcEntrySeq(ReplaceSpaces(szProcSegsName), pArena, NULL,
- RA_ProcSeqShowRegs, RA_ProcSeqOff2ElementRegs, NULL, NULL);
- }
- else
- {
- pArena->pProcSegs = 0;
- PVR_DPF((PVR_DBG_ERROR, "RA_Create: couldn't create ra_segs proc entry for arena %s", pArena->name));
- }
-
-#endif
-
- }
-#endif
pArena->pSegmentHash = HASH_Create (MINIMUM_HASH_SIZE);
if (pArena->pSegmentHash==IMG_NULL)
@@ -1048,42 +921,6 @@ RA_Delete (RA_ARENA *pArena)
pArena->sStatistics.uSpanCount--;
#endif
}
-#if defined(CONFIG_PROC_FS) && defined(DEBUG)
- {
-
-#ifdef PVR_PROC_USE_SEQ_FILE
- IMG_VOID (*pfnRemoveProcEntrySeq)(struct proc_dir_entry*);
-
- pfnRemoveProcEntrySeq = pArena->bInitProcEntry ? RemoveProcEntrySeq : RemovePerProcessProcEntrySeq;
-
- if (pArena->pProcInfo != 0)
- {
- pfnRemoveProcEntrySeq( pArena->pProcInfo );
- }
-
- if (pArena->pProcSegs != 0)
- {
- pfnRemoveProcEntrySeq( pArena->pProcSegs );
- }
-
-#else
- IMG_VOID (*pfnRemoveProcEntry)(const IMG_CHAR *);
-
- pfnRemoveProcEntry = pArena->bInitProcEntry ? RemoveProcEntry : RemovePerProcessProcEntry;
-
- if (pArena->szProcInfoName[0] != 0)
- {
- pfnRemoveProcEntry(pArena->szProcInfoName);
- }
-
- if (pArena->szProcSegsName[0] != 0)
- {
- pfnRemoveProcEntry(pArena->szProcSegsName);
- }
-
-#endif
- }
-#endif
HASH_Delete (pArena->pSegmentHash);
OSFreeMem(PVRSRV_OS_PAGEABLE_HEAP, sizeof(RA_ARENA), pArena, IMG_NULL);
@@ -1533,7 +1370,7 @@ IMG_VOID CheckBMFreespace(IMG_VOID)
#endif
-#if (defined(CONFIG_PROC_FS) && defined(DEBUG)) || defined (RA_STATS)
+#if defined (RA_STATS)
static IMG_CHAR *
_BTType (IMG_INT eType)
{
@@ -1579,195 +1416,6 @@ RA_Dump (RA_ARENA *pArena)
#endif
-#if defined(CONFIG_PROC_FS) && defined(DEBUG)
-
-
-#ifdef PVR_PROC_USE_SEQ_FILE
-
-static void RA_ProcSeqShowInfo(struct seq_file *sfile, void* el)
-{
- PVR_PROC_SEQ_HANDLERS *handlers = (PVR_PROC_SEQ_HANDLERS*)sfile->private;
- RA_ARENA *pArena = (RA_ARENA *)handlers->data;
- IMG_INT off = (IMG_INT)el;
-
- switch (off)
- {
- case 1:
- seq_printf(sfile, "quantum\t\t\t%lu\n", pArena->uQuantum);
- break;
- case 2:
- seq_printf(sfile, "import_handle\t\t%08X\n", (IMG_UINT)pArena->pImportHandle);
- break;
-#ifdef RA_STATS
- case 3:
- seq_printf(sfile,"span count\t\t%lu\n", pArena->sStatistics.uSpanCount);
- break;
- case 4:
- seq_printf(sfile, "live segment count\t%lu\n", pArena->sStatistics.uLiveSegmentCount);
- break;
- case 5:
- seq_printf(sfile, "free segment count\t%lu\n", pArena->sStatistics.uFreeSegmentCount);
- break;
- case 6:
- seq_printf(sfile, "free resource count\t%lu (0x%x)\n",
- pArena->sStatistics.uFreeResourceCount,
- (IMG_UINT)pArena->sStatistics.uFreeResourceCount);
- break;
- case 7:
- seq_printf(sfile, "total allocs\t\t%lu\n", pArena->sStatistics.uCumulativeAllocs);
- break;
- case 8:
- seq_printf(sfile, "total frees\t\t%lu\n", pArena->sStatistics.uCumulativeFrees);
- break;
- case 9:
- seq_printf(sfile, "import count\t\t%lu\n", pArena->sStatistics.uImportCount);
- break;
- case 10:
- seq_printf(sfile, "export count\t\t%lu\n", pArena->sStatistics.uExportCount);
- break;
-#endif
- }
-
-}
-
-static void* RA_ProcSeqOff2ElementInfo(struct seq_file * sfile, loff_t off)
-{
-#ifdef RA_STATS
- if(off <= 9)
-#else
- if(off <= 1)
-#endif
- return (void*)(IMG_INT)(off+1);
- return 0;
-}
-
-static void RA_ProcSeqShowRegs(struct seq_file *sfile, void* el)
-{
- PVR_PROC_SEQ_HANDLERS *handlers = (PVR_PROC_SEQ_HANDLERS*)sfile->private;
- RA_ARENA *pArena = (RA_ARENA *)handlers->data;
- BT *pBT = (BT*)el;
-
- if (el == PVR_PROC_SEQ_START_TOKEN)
- {
- seq_printf(sfile, "Arena \"%s\"\nBase Size Type Ref\n", pArena->name);
- return;
- }
-
- if (pBT)
- {
- seq_printf(sfile, "%08x %8x %4s %08x\n",
- (IMG_UINT)pBT->base, (IMG_UINT)pBT->uSize, _BTType (pBT->type),
- (IMG_UINT)pBT->psMapping);
- }
-}
-
-static void* RA_ProcSeqOff2ElementRegs(struct seq_file * sfile, loff_t off)
-{
- PVR_PROC_SEQ_HANDLERS *handlers = (PVR_PROC_SEQ_HANDLERS*)sfile->private;
- RA_ARENA *pArena = (RA_ARENA *)handlers->data;
- BT *pBT = 0;
-
- if(off == 0)
- return PVR_PROC_SEQ_START_TOKEN;
-
- for (pBT=pArena->pHeadSegment; --off && pBT; pBT=pBT->pNextSegment);
-
- return (void*)pBT;
-}
-
-
-
-#else
-static IMG_INT
-RA_DumpSegs(IMG_CHAR *page, IMG_CHAR **start, off_t off, IMG_INT count, IMG_INT *eof, IMG_VOID *data)
-{
- BT *pBT = 0;
- IMG_INT len = 0;
- RA_ARENA *pArena = (RA_ARENA *)data;
-
- if (count < 80)
- {
- *start = (IMG_CHAR *)0;
- return (0);
- }
- *eof = 0;
- *start = (IMG_CHAR *)1;
- if (off == 0)
- {
- return printAppend(page, count, 0, "Arena \"%s\"\nBase Size Type Ref\n", pArena->name);
- }
- for (pBT=pArena->pHeadSegment; --off && pBT; pBT=pBT->pNextSegment)
- ;
- if (pBT)
- {
- len = printAppend(page, count, 0, "%08x %8x %4s %08x\n",
- (IMG_UINT)pBT->base, (IMG_UINT)pBT->uSize, _BTType (pBT->type),
- (IMG_UINT)pBT->psMapping);
- }
- else
- {
- *eof = 1;
- }
- return (len);
-}
-
-static IMG_INT
-RA_DumpInfo(IMG_CHAR *page, IMG_CHAR **start, off_t off, IMG_INT count, IMG_INT *eof, IMG_VOID *data)
-{
- IMG_INT len = 0;
- RA_ARENA *pArena = (RA_ARENA *)data;
-
- if (count < 80)
- {
- *start = (IMG_CHAR *)0;
- return (0);
- }
- *eof = 0;
- switch (off)
- {
- case 0:
- len = printAppend(page, count, 0, "quantum\t\t\t%lu\n", pArena->uQuantum);
- break;
- case 1:
- len = printAppend(page, count, 0, "import_handle\t\t%08X\n", (IMG_UINT)pArena->pImportHandle);
- break;
-#ifdef RA_STATS
- case 2:
- len = printAppend(page, count, 0, "span count\t\t%lu\n", pArena->sStatistics.uSpanCount);
- break;
- case 3:
- len = printAppend(page, count, 0, "live segment count\t%lu\n", pArena->sStatistics.uLiveSegmentCount);
- break;
- case 4:
- len = printAppend(page, count, 0, "free segment count\t%lu\n", pArena->sStatistics.uFreeSegmentCount);
- break;
- case 5:
- len = printAppend(page, count, 0, "free resource count\t%lu (0x%x)\n",
- pArena->sStatistics.uFreeResourceCount,
- (IMG_UINT)pArena->sStatistics.uFreeResourceCount);
- break;
- case 6:
- len = printAppend(page, count, 0, "total allocs\t\t%lu\n", pArena->sStatistics.uCumulativeAllocs);
- break;
- case 7:
- len = printAppend(page, count, 0, "total frees\t\t%lu\n", pArena->sStatistics.uCumulativeFrees);
- break;
- case 8:
- len = printAppend(page, count, 0, "import count\t\t%lu\n", pArena->sStatistics.uImportCount);
- break;
- case 9:
- len = printAppend(page, count, 0, "export count\t\t%lu\n", pArena->sStatistics.uExportCount);
- break;
-#endif
-
- default:
- *eof = 1;
- }
- *start = (IMG_CHAR *)1;
- return (len);
-}
-#endif
-#endif
#ifdef RA_STATS
diff --git a/pvr/services4/srvkm/env/linux/proc.c b/pvr/services4/srvkm/env/linux/proc.c
index e671359..a0004cc 100644
--- a/pvr/services4/srvkm/env/linux/proc.c
+++ b/pvr/services4/srvkm/env/linux/proc.c
@@ -85,9 +85,6 @@ static struct proc_dir_entry* g_pProcQueue;
static struct proc_dir_entry* g_pProcVersion;
static struct proc_dir_entry* g_pProcSysNodes;
-#ifdef DEBUG
-static struct proc_dir_entry* g_pProcDebugLevel;
-#endif
#ifdef PVR_MANUAL_POWER_CONTROL
static struct proc_dir_entry* g_pProcPowerLevel;
@@ -597,40 +594,6 @@ IMG_INT CreateProcEntries(IMG_VOID)
}
-#ifdef DEBUG
-
-#ifdef PVR_PROC_USE_SEQ_FILE
- g_pProcDebugLevel = CreateProcEntrySeq("debug_level", NULL, NULL,
- ProcSeqShowDebugLevel,
- ProcSeq1ElementOff2Element, NULL,
- PVRDebugProcSetLevel);
- if(!g_pProcDebugLevel)
-#else
- if (CreateProcEntry ("debug_level", PVRDebugProcGetLevel, PVRDebugProcSetLevel, 0))
-#endif
- {
- PVR_DPF((PVR_DBG_ERROR, "CreateProcEntries: couldn't make /proc/%s/debug_level", PVRProcDirRoot));
-
- return -ENOMEM;
- }
-
-#ifdef PVR_MANUAL_POWER_CONTROL
-#ifdef PVR_PROC_USE_SEQ_FILE
- g_pProcPowerLevel = CreateProcEntrySeq("power_control", NULL, NULL,
- ProcSeqShowPowerLevel,
- ProcSeq1ElementOff2Element, NULL,
- PVRProcSetPowerLevel);
- if(!g_pProcPowerLevel)
-#else
- if (CreateProcEntry("power_control", PVRProcGetPowerLevel, PVRProcSetPowerLevel, 0))
-#endif
- {
- PVR_DPF((PVR_DBG_ERROR, "CreateProcEntries: couldn't make /proc/%s/power_control", PVRProcDirRoot));
-
- return -ENOMEM;
- }
-#endif
-#endif
return 0;
}
@@ -687,23 +650,6 @@ IMG_VOID RemovePerProcessProcDir(PVRSRV_ENV_PER_PROCESS_DATA *psPerProc)
IMG_VOID RemoveProcEntries(IMG_VOID)
{
-#ifdef DEBUG
-
-#ifdef PVR_PROC_USE_SEQ_FILE
- RemoveProcEntrySeq( g_pProcDebugLevel );
-#else
- RemoveProcEntry("debug_level");
-#endif
-
-#ifdef PVR_MANUAL_POWER_CONTROL
-#ifdef PVR_PROC_USE_SEQ_FILE
- RemoveProcEntrySeq( g_pProcPowerLevel );
-#else
- RemoveProcEntry("power_control");
-#endif
-#endif
-
-#endif
#ifdef PVR_PROC_USE_SEQ_FILE
RemoveProcEntrySeq(g_pProcQueue);
commit 7f63fd57ba04cd1f2a41b788794a1135c813f8f4
Author: sergeykish <[email protected]>
Date: Fri Sep 6 14:51:59 2013 +0300
kernel > 2.6.30
diff --git a/pvr/services4/srvkm/env/linux/proc.c b/pvr/services4/srvkm/env/linux/proc.c
index 50245a1..e671359 100644
--- a/pvr/services4/srvkm/env/linux/proc.c
+++ b/pvr/services4/srvkm/env/linux/proc.c
@@ -253,10 +253,6 @@ static struct proc_dir_entry* CreateProcEntryInDirSeq(
{
PVR_PROC_SEQ_HANDLERS *seq_handlers;
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30))
- file->owner = THIS_MODULE;
-#endif
-
file->proc_fops = &pvr_proc_operations;
file->write_proc = whandler;
@@ -476,9 +472,6 @@ static IMG_INT CreateProcEntryInDir(struct proc_dir_entry *pdir, const IMG_CHAR
if (file)
{
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30))
- file->owner = THIS_MODULE;
-#endif
file->read_proc = rhandler;
file->write_proc = whandler;
file->data = data;
@@ -566,9 +559,6 @@ IMG_INT CreateProcReadEntry(const IMG_CHAR * name, pvr_read_proc_t handler)
if (file)
{
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30))
- file->owner = THIS_MODULE;
-#endif
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment