diff options
Diffstat (limited to 'firmware/drivers')
-rw-r--r-- | firmware/drivers/ata.c | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 4b365a50ab..355ff37900 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c | |||
@@ -79,74 +79,6 @@ | |||
79 | static unsigned int ata_thread_id = 0; | 79 | static unsigned int ata_thread_id = 0; |
80 | #endif | 80 | #endif |
81 | 81 | ||
82 | #if defined(MAX_PHYS_SECTOR_SIZE) && MEMORYSIZE == 64 | ||
83 | /* Hack - what's the deal with 5g? */ | ||
84 | struct ata_lock | ||
85 | { | ||
86 | struct thread_entry *thread; | ||
87 | int count; | ||
88 | volatile unsigned char locked; | ||
89 | IF_COP( struct corelock cl; ) | ||
90 | }; | ||
91 | |||
92 | static void ata_lock_init(struct ata_lock *l) | ||
93 | { | ||
94 | corelock_init(&l->cl); | ||
95 | l->locked = 0; | ||
96 | l->count = 0; | ||
97 | l->thread = NULL; | ||
98 | } | ||
99 | |||
100 | static void ata_lock_lock(struct ata_lock *l) | ||
101 | { | ||
102 | struct thread_entry * const current = thread_self_entry(); | ||
103 | |||
104 | if (current == l->thread) | ||
105 | { | ||
106 | l->count++; | ||
107 | return; | ||
108 | } | ||
109 | |||
110 | corelock_lock(&l->cl); | ||
111 | |||
112 | IF_PRIO( current->skip_count = -1; ) | ||
113 | |||
114 | while (l->locked != 0) | ||
115 | { | ||
116 | corelock_unlock(&l->cl); | ||
117 | switch_thread(); | ||
118 | corelock_lock(&l->cl); | ||
119 | } | ||
120 | |||
121 | l->locked = 1; | ||
122 | l->thread = current; | ||
123 | corelock_unlock(&l->cl); | ||
124 | } | ||
125 | |||
126 | static void ata_lock_unlock(struct ata_lock *l) | ||
127 | { | ||
128 | if (l->count > 0) | ||
129 | { | ||
130 | l->count--; | ||
131 | return; | ||
132 | } | ||
133 | |||
134 | corelock_lock(&l->cl); | ||
135 | |||
136 | IF_PRIO( l->thread->skip_count = 0; ) | ||
137 | |||
138 | l->thread = NULL; | ||
139 | l->locked = 0; | ||
140 | |||
141 | corelock_unlock(&l->cl); | ||
142 | } | ||
143 | |||
144 | #define mutex ata_lock | ||
145 | #define mutex_init ata_lock_init | ||
146 | #define mutex_lock ata_lock_lock | ||
147 | #define mutex_unlock ata_lock_unlock | ||
148 | #endif /* MAX_PHYS_SECTOR_SIZE */ | ||
149 | |||
150 | #if defined(HAVE_USBSTACK) && defined(USE_ROCKBOX_USB) | 82 | #if defined(HAVE_USBSTACK) && defined(USE_ROCKBOX_USB) |
151 | #define ALLOW_USB_SPINDOWN | 83 | #define ALLOW_USB_SPINDOWN |
152 | #endif | 84 | #endif |