• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/arch/powerpc/platforms/pseries/

Lines Matching refs:dtl

51 struct dtl {
58 static DEFINE_PER_CPU(struct dtl, cpu_dtl);
75 static int dtl_enable(struct dtl *dtl)
81 if (dtl->buf)
85 dtl->buf_entries = dtl_buf_entries;
87 dtl->buf = kmalloc_node(dtl->buf_entries * sizeof(struct dtl_entry),
88 GFP_KERNEL, cpu_to_node(dtl->cpu));
89 if (!dtl->buf) {
91 __func__, dtl->cpu);
95 /* Register our dtl buffer with the hypervisor. The HV expects the
97 ((u32 *)dtl->buf)[1] = dtl->buf_entries * sizeof(struct dtl_entry);
99 hwcpu = get_hard_smp_processor_id(dtl->cpu);
100 addr = __pa(dtl->buf);
104 "failed with %d\n", __func__, dtl->cpu, hwcpu, ret);
105 kfree(dtl->buf);
110 dtl->last_idx = lppaca[dtl->cpu].dtl_idx = 0;
117 lppaca[dtl->cpu].dtl_enable_mask = dtl_event_mask;
122 static void dtl_disable(struct dtl *dtl)
124 int hwcpu = get_hard_smp_processor_id(dtl->cpu);
126 lppaca[dtl->cpu].dtl_enable_mask = 0x0;
128 unregister_dtl(hwcpu, __pa(dtl->buf));
130 kfree(dtl->buf);
131 dtl->buf = NULL;
132 dtl->buf_entries = 0;
139 struct dtl *dtl = inode->i_private;
142 rc = dtl_enable(dtl);
146 filp->private_data = dtl;
152 struct dtl *dtl = inode->i_private;
153 dtl_disable(dtl);
161 struct dtl *dtl;
166 dtl = filp->private_data;
174 cur_idx = lppaca[dtl->cpu].dtl_idx;
175 last_idx = dtl->last_idx;
177 if (cur_idx - last_idx > dtl->buf_entries) {
179 __func__, dtl->cpu);
182 cur_idx %= dtl->buf_entries;
183 last_idx %= dtl->buf_entries;
187 read_size = min(n_req, dtl->buf_entries - last_idx);
189 rc = copy_to_user(buf, &dtl->buf[last_idx],
202 rc = copy_to_user(buf, &dtl->buf[last_idx],
208 dtl->last_idx += n_read;
222 static int dtl_setup_file(struct dtl *dtl)
226 sprintf(name, "cpu-%d", dtl->cpu);
228 dtl->file = debugfs_create_file(name, 0400, dtl_dir, dtl, &dtl_fops);
229 if (!dtl->file)
246 dtl_dir = debugfs_create_dir("dtl", powerpc_debugfs_root);
248 printk(KERN_WARNING "%s: can't create dtl root dir\n",
259 printk(KERN_WARNING "%s: can't create dtl files\n", __func__);
265 struct dtl *dtl = &per_cpu(cpu_dtl, i);
266 dtl->cpu = i;
268 rc = dtl_setup_file(dtl);