Subversion Repositories Kolibri OS

Rev

Rev 1408 | Rev 3763 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1408 Rev 3262
Line 28... Line 28...
28
#ifndef TTM_MEMORY_H
28
#ifndef TTM_MEMORY_H
29
#define TTM_MEMORY_H
29
#define TTM_MEMORY_H
Line 30... Line 30...
30
 
30
 
31
//#include 
31
//#include 
-
 
32
#include 
32
#include 
33
#include 
33
//#include 
34
#include 
34
#include 
35
#include 
35
//#include 
36
//#include 
Line 36... Line 37...
36
//#include 
37
#include 
37
 
38
 
38
/**
39
/**
39
 * struct ttm_mem_shrink - callback to shrink TTM memory usage.
40
 * struct ttm_mem_shrink - callback to shrink TTM memory usage.
40
 *
41
 *
41
 * @do_shrink: The callback function.
42
 * @do_shrink: The callback function.
42
 *
43
 *
43
 * Arguments to the do_shrink functions are intended to be passed using
44
 * Arguments to the do_shrink functions are intended to be passed using
44
 * inheritance. That is, the argument class derives from struct ttm_mem_srink,
45
 * inheritance. That is, the argument class derives from struct ttm_mem_shrink,
Line 45... Line 46...
45
 * and can be accessed using container_of().
46
 * and can be accessed using container_of().
46
 */
47
 */
Line 57... Line 58...
57
 * @swap_queue: A workqueue to handle shrinking in low memory situations. We
58
 * @swap_queue: A workqueue to handle shrinking in low memory situations. We
58
 * need a separate workqueue since it will spend a lot of time waiting
59
 * need a separate workqueue since it will spend a lot of time waiting
59
 * for the GPU, and this will otherwise block other workqueue tasks(?)
60
 * for the GPU, and this will otherwise block other workqueue tasks(?)
60
 * At this point we use only a single-threaded workqueue.
61
 * At this point we use only a single-threaded workqueue.
61
 * @work: The workqueue callback for the shrink queue.
62
 * @work: The workqueue callback for the shrink queue.
62
 * @queue: Wait queue for processes suspended waiting for memory.
-
 
63
 * @lock: Lock to protect the @shrink - and the memory accounting members,
63
 * @lock: Lock to protect the @shrink - and the memory accounting members,
64
 * that is, essentially the whole structure with some exceptions.
64
 * that is, essentially the whole structure with some exceptions.
65
 * @zones: Array of pointers to accounting zones.
65
 * @zones: Array of pointers to accounting zones.
66
 * @num_zones: Number of populated entries in the @zones array.
66
 * @num_zones: Number of populated entries in the @zones array.
67
 * @zone_kernel: Pointer to the kernel zone.
67
 * @zone_kernel: Pointer to the kernel zone.
Line 75... Line 75...
75
#define TTM_MEM_MAX_ZONES 2
75
#define TTM_MEM_MAX_ZONES 2
76
struct ttm_mem_zone;
76
struct ttm_mem_zone;
77
struct ttm_mem_global {
77
struct ttm_mem_global {
78
//   struct kobject kobj;
78
//   struct kobject kobj;
79
	struct ttm_mem_shrink *shrink;
79
	struct ttm_mem_shrink *shrink;
80
//   struct workqueue_struct *swap_queue;
80
	struct workqueue_struct *swap_queue;
81
//   struct work_struct work;
81
	struct work_struct work;
82
//   wait_queue_head_t queue;
-
 
83
    spinlock_t lock;
82
	spinlock_t lock;
84
	struct ttm_mem_zone *zones[TTM_MEM_MAX_ZONES];
83
	struct ttm_mem_zone *zones[TTM_MEM_MAX_ZONES];
85
	unsigned int num_zones;
84
	unsigned int num_zones;
86
	struct ttm_mem_zone *zone_kernel;
85
	struct ttm_mem_zone *zone_kernel;
87
#ifdef CONFIG_HIGHMEM
86
#ifdef CONFIG_HIGHMEM