Subversion Repositories Kolibri OS

Rev

Rev 1630 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1408 serge 1
/**************************************************************************
2
 *
3
 * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA
4
 * All Rights Reserved.
5
 *
6
 * Permission is hereby granted, free of charge, to any person obtaining a
7
 * copy of this software and associated documentation files (the
8
 * "Software"), to deal in the Software without restriction, including
9
 * without limitation the rights to use, copy, modify, merge, publish,
10
 * distribute, sub license, and/or sell copies of the Software, and to
11
 * permit persons to whom the Software is furnished to do so, subject to
12
 * the following conditions:
13
 *
14
 * The above copyright notice and this permission notice (including the
15
 * next paragraph) shall be included in all copies or substantial portions
16
 * of the Software.
17
 *
18
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
21
 * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
22
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23
 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
24
 * USE OR OTHER DEALINGS IN THE SOFTWARE.
25
 *
26
 **************************************************************************/
27
/*
28
 * Authors: Thomas Hellstrom 
29
 */
30
 
31
#ifndef _TTM_BO_API_H_
32
#define _TTM_BO_API_H_
33
 
34
#include "drm_hashtab.h"
35
#include 
36
#include 
37
 
38
#include 
39
 
40
//#include 
41
//#include 
42
//#include 
43
//#include 
44
#include 
45
 
46
struct ttm_bo_device;
47
 
48
struct drm_mm_node;
49
 
50
 
51
/**
52
 * struct ttm_placement
53
 *
54
 * @fpfn:		first valid page frame number to put the object
55
 * @lpfn:		last valid page frame number to put the object
56
 * @num_placement:	number of prefered placements
57
 * @placement:		prefered placements
58
 * @num_busy_placement:	number of prefered placements when need to evict buffer
59
 * @busy_placement:	prefered placements when need to evict buffer
60
 *
61
 * Structure indicating the placement you request for an object.
62
 */
63
struct ttm_placement {
64
	unsigned	fpfn;
65
	unsigned	lpfn;
66
	unsigned	num_placement;
67
	const uint32_t	*placement;
68
	unsigned	num_busy_placement;
69
	const uint32_t	*busy_placement;
70
};
71
 
72
 
73
/**
74
 * struct ttm_mem_reg
75
 *
76
 * @mm_node: Memory manager node.
77
 * @size: Requested size of memory region.
78
 * @num_pages: Actual size of memory region in pages.
79
 * @page_alignment: Page alignment.
80
 * @placement: Placement flags.
81
 *
82
 * Structure indicating the placement and space resources used by a
83
 * buffer object.
84
 */
85
 
86
struct ttm_mem_reg {
87
	struct drm_mm_node *mm_node;
88
	unsigned long size;
89
	unsigned long num_pages;
90
	uint32_t page_alignment;
91
	uint32_t mem_type;
92
	uint32_t placement;
93
};
94
 
95
/**
96
 * enum ttm_bo_type
97
 *
98
 * @ttm_bo_type_device:	These are 'normal' buffers that can
99
 * be mmapped by user space. Each of these bos occupy a slot in the
100
 * device address space, that can be used for normal vm operations.
101
 *
102
 * @ttm_bo_type_user: These are user-space memory areas that are made
103
 * available to the GPU by mapping the buffer pages into the GPU aperture
104
 * space. These buffers cannot be mmaped from the device address space.
105
 *
106
 * @ttm_bo_type_kernel: These buffers are like ttm_bo_type_device buffers,
107
 * but they cannot be accessed from user-space. For kernel-only use.
108
 */
109
 
110
enum ttm_bo_type {
111
	ttm_bo_type_device,
112
	ttm_bo_type_user,
113
	ttm_bo_type_kernel
114
};
115
 
116
struct ttm_tt;
117
 
118
/**
119
 * struct ttm_buffer_object
120
 *
121
 * @bdev: Pointer to the buffer object device structure.
122
 * @buffer_start: The virtual user-space start address of ttm_bo_type_user
123
 * buffers.
124
 * @type: The bo type.
125
 * @destroy: Destruction function. If NULL, kfree is used.
126
 * @num_pages: Actual number of pages.
127
 * @addr_space_offset: Address space offset.
128
 * @acc_size: Accounted size for this object.
129
 * @kref: Reference count of this buffer object. When this refcount reaches
130
 * zero, the object is put on the delayed delete list.
131
 * @list_kref: List reference count of this buffer object. This member is
132
 * used to avoid destruction while the buffer object is still on a list.
133
 * Lru lists may keep one refcount, the delayed delete list, and kref != 0
134
 * keeps one refcount. When this refcount reaches zero,
135
 * the object is destroyed.
136
 * @event_queue: Queue for processes waiting on buffer object status change.
137
 * @lock: spinlock protecting mostly synchronization members.
138
 * @mem: structure describing current placement.
139
 * @persistant_swap_storage: Usually the swap storage is deleted for buffers
140
 * pinned in physical memory. If this behaviour is not desired, this member
141
 * holds a pointer to a persistant shmem object.
142
 * @ttm: TTM structure holding system pages.
143
 * @evicted: Whether the object was evicted without user-space knowing.
144
 * @cpu_writes: For synchronization. Number of cpu writers.
145
 * @lru: List head for the lru list.
146
 * @ddestroy: List head for the delayed destroy list.
147
 * @swap: List head for swap LRU list.
148
 * @val_seq: Sequence of the validation holding the @reserved lock.
149
 * Used to avoid starvation when many processes compete to validate the
150
 * buffer. This member is protected by the bo_device::lru_lock.
151
 * @seq_valid: The value of @val_seq is valid. This value is protected by
152
 * the bo_device::lru_lock.
153
 * @reserved: Deadlock-free lock used for synchronization state transitions.
154
 * @sync_obj_arg: Opaque argument to synchronization object function.
155
 * @sync_obj: Pointer to a synchronization object.
156
 * @priv_flags: Flags describing buffer object internal state.
157
 * @vm_rb: Rb node for the vm rb tree.
158
 * @vm_node: Address space manager node.
159
 * @offset: The current GPU offset, which can have different meanings
160
 * depending on the memory type. For SYSTEM type memory, it should be 0.
161
 * @cur_placement: Hint of current placement.
162
 *
163
 * Base class for TTM buffer object, that deals with data placement and CPU
164
 * mappings. GPU mappings are really up to the driver, but for simpler GPUs
165
 * the driver can usually use the placement offset @offset directly as the
166
 * GPU virtual address. For drivers implementing multiple
167
 * GPU memory manager contexts, the driver should manage the address space
168
 * in these contexts separately and use these objects to get the correct
169
 * placement and caching for these GPU maps. This makes it possible to use
170
 * these objects for even quite elaborate memory management schemes.
171
 * The destroy member, the API visibility of this object makes it possible
172
 * to derive driver specific types.
173
 */
174
 
175
struct ttm_buffer_object {
176
	/**
177
	 * Members constant at init.
178
	 */
179
 
180
	struct ttm_bo_global *glob;
181
	struct ttm_bo_device *bdev;
182
	unsigned long buffer_start;
183
	enum ttm_bo_type type;
184
	void (*destroy) (struct ttm_buffer_object *);
185
	unsigned long num_pages;
186
	uint64_t addr_space_offset;
187
	size_t acc_size;
188
 
189
	/**
190
	* Members not needing protection.
191
	*/
192
 
193
   struct kref kref;
194
   struct kref list_kref;
195
//   wait_queue_head_t event_queue;
196
   spinlock_t lock;
197
 
198
	/**
199
	 * Members protected by the bo::reserved lock.
200
	 */
201
 
202
	struct ttm_mem_reg mem;
203
//   struct file *persistant_swap_storage;
204
	struct ttm_tt *ttm;
205
	bool evicted;
206
 
207
	/**
208
	 * Members protected by the bo::reserved lock only when written to.
209
	 */
210
 
211
   atomic_t cpu_writers;
212
 
213
	/**
214
	 * Members protected by the bdev::lru_lock.
215
	 */
216
 
217
	struct list_head lru;
218
	struct list_head ddestroy;
219
	struct list_head swap;
220
	uint32_t val_seq;
221
	bool seq_valid;
222
 
223
	/**
224
	 * Members protected by the bdev::lru_lock
225
	 * only when written to.
226
	 */
227
 
228
   atomic_t reserved;
229
 
230
 
231
	/**
232
	 * Members protected by the bo::lock
233
	 */
234
 
235
	void *sync_obj_arg;
236
	void *sync_obj;
237
	unsigned long priv_flags;
238
 
239
	/**
240
	 * Members protected by the bdev::vm_lock
241
	 */
242
 
243
//   struct rb_node vm_rb;
244
	struct drm_mm_node *vm_node;
245
 
246
 
247
	/**
248
	 * Special members that are protected by the reserve lock
249
	 * and the bo::lock when written to. Can be read with
250
	 * either of these locks held.
251
	 */
252
 
253
	unsigned long offset;
254
	uint32_t cur_placement;
255
};
256
 
257
/**
258
 * struct ttm_bo_kmap_obj
259
 *
260
 * @virtual: The current kernel virtual address.
261
 * @page: The page when kmap'ing a single page.
262
 * @bo_kmap_type: Type of bo_kmap.
263
 *
264
 * Object describing a kernel mapping. Since a TTM bo may be located
265
 * in various memory types with various caching policies, the
266
 * mapping can either be an ioremap, a vmap, a kmap or part of a
267
 * premapped region.
268
 */
269
 
270
#define TTM_BO_MAP_IOMEM_MASK 0x80
271
struct ttm_bo_kmap_obj {
272
	void *virtual;
273
	struct page *page;
274
	enum {
275
		ttm_bo_map_iomap        = 1 | TTM_BO_MAP_IOMEM_MASK,
276
		ttm_bo_map_vmap         = 2,
277
		ttm_bo_map_kmap         = 3,
278
		ttm_bo_map_premapped    = 4 | TTM_BO_MAP_IOMEM_MASK,
279
	} bo_kmap_type;
280
};
281
 
282
/**
283
 * ttm_bo_reference - reference a struct ttm_buffer_object
284
 *
285
 * @bo: The buffer object.
286
 *
287
 * Returns a refcounted pointer to a buffer object.
288
 */
289
 
290
static inline struct ttm_buffer_object *
291
ttm_bo_reference(struct ttm_buffer_object *bo)
292
{
293
	kref_get(&bo->kref);
294
	return bo;
295
}
296
 
297
/**
298
 * ttm_bo_wait - wait for buffer idle.
299
 *
300
 * @bo:  The buffer object.
301
 * @interruptible:  Use interruptible wait.
302
 * @no_wait:  Return immediately if buffer is busy.
303
 *
304
 * This function must be called with the bo::mutex held, and makes
305
 * sure any previous rendering to the buffer is completed.
306
 * Note: It might be necessary to block validations before the
307
 * wait by reserving the buffer.
308
 * Returns -EBUSY if no_wait is true and the buffer is busy.
309
 * Returns -ERESTARTSYS if interrupted by a signal.
310
 */
311
extern int ttm_bo_wait(struct ttm_buffer_object *bo, bool lazy,
312
		       bool interruptible, bool no_wait);
313
/**
314
 * ttm_bo_validate
315
 *
316
 * @bo: The buffer object.
317
 * @placement: Proposed placement for the buffer object.
318
 * @interruptible: Sleep interruptible if sleeping.
319
 * @no_wait: Return immediately if the buffer is busy.
320
 *
321
 * Changes placement and caching policy of the buffer object
322
 * according proposed placement.
323
 * Returns
324
 * -EINVAL on invalid proposed placement.
325
 * -ENOMEM on out-of-memory condition.
326
 * -EBUSY if no_wait is true and buffer busy.
327
 * -ERESTARTSYS if interrupted by a signal.
328
 */
329
extern int ttm_bo_validate(struct ttm_buffer_object *bo,
330
				struct ttm_placement *placement,
331
				bool interruptible, bool no_wait);
332
 
333
/**
334
 * ttm_bo_unref
335
 *
336
 * @bo: The buffer object.
337
 *
338
 * Unreference and clear a pointer to a buffer object.
339
 */
340
extern void ttm_bo_unref(struct ttm_buffer_object **bo);
341
 
342
/**
343
 * ttm_bo_synccpu_write_grab
344
 *
345
 * @bo: The buffer object:
346
 * @no_wait: Return immediately if buffer is busy.
347
 *
348
 * Synchronizes a buffer object for CPU RW access. This means
349
 * blocking command submission that affects the buffer and
350
 * waiting for buffer idle. This lock is recursive.
351
 * Returns
352
 * -EBUSY if the buffer is busy and no_wait is true.
353
 * -ERESTARTSYS if interrupted by a signal.
354
 */
355
 
356
extern int
357
ttm_bo_synccpu_write_grab(struct ttm_buffer_object *bo, bool no_wait);
358
/**
359
 * ttm_bo_synccpu_write_release:
360
 *
361
 * @bo : The buffer object.
362
 *
363
 * Releases a synccpu lock.
364
 */
365
extern void ttm_bo_synccpu_write_release(struct ttm_buffer_object *bo);
366
 
367
/**
368
 * ttm_bo_init
369
 *
370
 * @bdev: Pointer to a ttm_bo_device struct.
371
 * @bo: Pointer to a ttm_buffer_object to be initialized.
372
 * @size: Requested size of buffer object.
373
 * @type: Requested type of buffer object.
374
 * @flags: Initial placement flags.
375
 * @page_alignment: Data alignment in pages.
376
 * @buffer_start: Virtual address of user space data backing a
377
 * user buffer object.
378
 * @interruptible: If needing to sleep to wait for GPU resources,
379
 * sleep interruptible.
380
 * @persistant_swap_storage: Usually the swap storage is deleted for buffers
381
 * pinned in physical memory. If this behaviour is not desired, this member
382
 * holds a pointer to a persistant shmem object. Typically, this would
383
 * point to the shmem object backing a GEM object if TTM is used to back a
384
 * GEM user interface.
385
 * @acc_size: Accounted size for this object.
386
 * @destroy: Destroy function. Use NULL for kfree().
387
 *
388
 * This function initializes a pre-allocated struct ttm_buffer_object.
389
 * As this object may be part of a larger structure, this function,
390
 * together with the @destroy function,
391
 * enables driver-specific objects derived from a ttm_buffer_object.
392
 * On successful return, the object kref and list_kref are set to 1.
393
 * Returns
394
 * -ENOMEM: Out of memory.
395
 * -EINVAL: Invalid placement flags.
396
 * -ERESTARTSYS: Interrupted by signal while sleeping waiting for resources.
397
 */
398
 
399
extern int ttm_bo_init(struct ttm_bo_device *bdev,
400
			struct ttm_buffer_object *bo,
401
			unsigned long size,
402
			enum ttm_bo_type type,
403
			struct ttm_placement *placement,
404
			uint32_t page_alignment,
405
			unsigned long buffer_start,
406
			bool interrubtible,
407
			struct file *persistant_swap_storage,
408
			size_t acc_size,
409
			void (*destroy) (struct ttm_buffer_object *));
410
/**
411
 * ttm_bo_synccpu_object_init
412
 *
413
 * @bdev: Pointer to a ttm_bo_device struct.
414
 * @bo: Pointer to a ttm_buffer_object to be initialized.
415
 * @size: Requested size of buffer object.
416
 * @type: Requested type of buffer object.
417
 * @flags: Initial placement flags.
418
 * @page_alignment: Data alignment in pages.
419
 * @buffer_start: Virtual address of user space data backing a
420
 * user buffer object.
421
 * @interruptible: If needing to sleep while waiting for GPU resources,
422
 * sleep interruptible.
423
 * @persistant_swap_storage: Usually the swap storage is deleted for buffers
424
 * pinned in physical memory. If this behaviour is not desired, this member
425
 * holds a pointer to a persistant shmem object. Typically, this would
426
 * point to the shmem object backing a GEM object if TTM is used to back a
427
 * GEM user interface.
428
 * @p_bo: On successful completion *p_bo points to the created object.
429
 *
430
 * This function allocates a ttm_buffer_object, and then calls ttm_bo_init
431
 * on that object. The destroy function is set to kfree().
432
 * Returns
433
 * -ENOMEM: Out of memory.
434
 * -EINVAL: Invalid placement flags.
435
 * -ERESTARTSYS: Interrupted by signal while waiting for resources.
436
 */
437
 
438
extern int ttm_bo_create(struct ttm_bo_device *bdev,
439
				unsigned long size,
440
				enum ttm_bo_type type,
441
				struct ttm_placement *placement,
442
				uint32_t page_alignment,
443
				unsigned long buffer_start,
444
				bool interruptible,
445
				struct file *persistant_swap_storage,
446
				struct ttm_buffer_object **p_bo);
447
 
448
/**
449
 * ttm_bo_check_placement
450
 *
451
 * @bo:		the buffer object.
452
 * @placement:	placements
453
 *
454
 * Performs minimal validity checking on an intended change of
455
 * placement flags.
456
 * Returns
457
 * -EINVAL: Intended change is invalid or not allowed.
458
 */
459
extern int ttm_bo_check_placement(struct ttm_buffer_object *bo,
460
					struct ttm_placement *placement);
461
 
462
/**
463
 * ttm_bo_init_mm
464
 *
465
 * @bdev: Pointer to a ttm_bo_device struct.
466
 * @mem_type: The memory type.
467
 * @p_size: size managed area in pages.
468
 *
469
 * Initialize a manager for a given memory type.
470
 * Note: if part of driver firstopen, it must be protected from a
471
 * potentially racing lastclose.
472
 * Returns:
473
 * -EINVAL: invalid size or memory type.
474
 * -ENOMEM: Not enough memory.
475
 * May also return driver-specified errors.
476
 */
477
 
478
extern int ttm_bo_init_mm(struct ttm_bo_device *bdev, unsigned type,
479
				unsigned long p_size);
480
/**
481
 * ttm_bo_clean_mm
482
 *
483
 * @bdev: Pointer to a ttm_bo_device struct.
484
 * @mem_type: The memory type.
485
 *
486
 * Take down a manager for a given memory type after first walking
487
 * the LRU list to evict any buffers left alive.
488
 *
489
 * Normally, this function is part of lastclose() or unload(), and at that
490
 * point there shouldn't be any buffers left created by user-space, since
491
 * there should've been removed by the file descriptor release() method.
492
 * However, before this function is run, make sure to signal all sync objects,
493
 * and verify that the delayed delete queue is empty. The driver must also
494
 * make sure that there are no NO_EVICT buffers present in this memory type
495
 * when the call is made.
496
 *
497
 * If this function is part of a VT switch, the caller must make sure that
498
 * there are no appications currently validating buffers before this
499
 * function is called. The caller can do that by first taking the
500
 * struct ttm_bo_device::ttm_lock in write mode.
501
 *
502
 * Returns:
503
 * -EINVAL: invalid or uninitialized memory type.
504
 * -EBUSY: There are still buffers left in this memory type.
505
 */
506
 
507
extern int ttm_bo_clean_mm(struct ttm_bo_device *bdev, unsigned mem_type);
508
 
509
/**
510
 * ttm_bo_evict_mm
511
 *
512
 * @bdev: Pointer to a ttm_bo_device struct.
513
 * @mem_type: The memory type.
514
 *
515
 * Evicts all buffers on the lru list of the memory type.
516
 * This is normally part of a VT switch or an
517
 * out-of-memory-space-due-to-fragmentation handler.
518
 * The caller must make sure that there are no other processes
519
 * currently validating buffers, and can do that by taking the
520
 * struct ttm_bo_device::ttm_lock in write mode.
521
 *
522
 * Returns:
523
 * -EINVAL: Invalid or uninitialized memory type.
524
 * -ERESTARTSYS: The call was interrupted by a signal while waiting to
525
 * evict a buffer.
526
 */
527
 
528
extern int ttm_bo_evict_mm(struct ttm_bo_device *bdev, unsigned mem_type);
529
 
530
/**
531
 * ttm_kmap_obj_virtual
532
 *
533
 * @map: A struct ttm_bo_kmap_obj returned from ttm_bo_kmap.
534
 * @is_iomem: Pointer to an integer that on return indicates 1 if the
535
 * virtual map is io memory, 0 if normal memory.
536
 *
537
 * Returns the virtual address of a buffer object area mapped by ttm_bo_kmap.
538
 * If *is_iomem is 1 on return, the virtual address points to an io memory area,
539
 * that should strictly be accessed by the iowriteXX() and similar functions.
540
 */
541
 
542
static inline void *ttm_kmap_obj_virtual(struct ttm_bo_kmap_obj *map,
543
					 bool *is_iomem)
544
{
545
	*is_iomem = !!(map->bo_kmap_type & TTM_BO_MAP_IOMEM_MASK);
546
	return map->virtual;
547
}
548
 
549
/**
550
 * ttm_bo_kmap
551
 *
552
 * @bo: The buffer object.
553
 * @start_page: The first page to map.
554
 * @num_pages: Number of pages to map.
555
 * @map: pointer to a struct ttm_bo_kmap_obj representing the map.
556
 *
557
 * Sets up a kernel virtual mapping, using ioremap, vmap or kmap to the
558
 * data in the buffer object. The ttm_kmap_obj_virtual function can then be
559
 * used to obtain a virtual address to the data.
560
 *
561
 * Returns
562
 * -ENOMEM: Out of memory.
563
 * -EINVAL: Invalid range.
564
 */
565
 
566
extern int ttm_bo_kmap(struct ttm_buffer_object *bo, unsigned long start_page,
567
		       unsigned long num_pages, struct ttm_bo_kmap_obj *map);
568
 
569
/**
570
 * ttm_bo_kunmap
571
 *
572
 * @map: Object describing the map to unmap.
573
 *
574
 * Unmaps a kernel map set up by ttm_bo_kmap.
575
 */
576
 
577
extern void ttm_bo_kunmap(struct ttm_bo_kmap_obj *map);
578
 
579
#if 0
580
#endif
581
 
582
/**
583
 * ttm_fbdev_mmap - mmap fbdev memory backed by a ttm buffer object.
584
 *
585
 * @vma:       vma as input from the fbdev mmap method.
586
 * @bo:        The bo backing the address space. The address space will
587
 * have the same size as the bo, and start at offset 0.
588
 *
589
 * This function is intended to be called by the fbdev mmap method
590
 * if the fbdev address space is to be backed by a bo.
591
 */
592
 
593
extern int ttm_fbdev_mmap(struct vm_area_struct *vma,
594
			  struct ttm_buffer_object *bo);
595
 
596
/**
597
 * ttm_bo_mmap - mmap out of the ttm device address space.
598
 *
599
 * @filp:      filp as input from the mmap method.
600
 * @vma:       vma as input from the mmap method.
601
 * @bdev:      Pointer to the ttm_bo_device with the address space manager.
602
 *
603
 * This function is intended to be called by the device mmap method.
604
 * if the device address space is to be backed by the bo manager.
605
 */
606
 
607
extern int ttm_bo_mmap(struct file *filp, struct vm_area_struct *vma,
608
		       struct ttm_bo_device *bdev);
609
 
610
/**
611
 * ttm_bo_io
612
 *
613
 * @bdev:      Pointer to the struct ttm_bo_device.
614
 * @filp:      Pointer to the struct file attempting to read / write.
615
 * @wbuf:      User-space pointer to address of buffer to write. NULL on read.
616
 * @rbuf:      User-space pointer to address of buffer to read into.
617
 * Null on write.
618
 * @count:     Number of bytes to read / write.
619
 * @f_pos:     Pointer to current file position.
620
 * @write:     1 for read, 0 for write.
621
 *
622
 * This function implements read / write into ttm buffer objects, and is
623
 * intended to
624
 * be called from the fops::read and fops::write method.
625
 * Returns:
626
 * See man (2) write, man(2) read. In particular,
627
 * the function may return -ERESTARTSYS if
628
 * interrupted by a signal.
629
 */
630
 
631
extern ssize_t ttm_bo_io(struct ttm_bo_device *bdev, struct file *filp,
632
			 const char __user *wbuf, char __user *rbuf,
633
			 size_t count, loff_t *f_pos, bool write);
634
 
635
extern void ttm_bo_swapout_all(struct ttm_bo_device *bdev);
636
 
637
#endif