aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jbd/commit.c
diff options
context:
space:
mode:
authorJoakim Tjernlund <joakim.tjernlund@transmode.se>2009-11-19 19:21:03 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-12-09 01:10:36 -0500
commitfe11dc3f9628e5393e932567b7e29d35cbbad136 (patch)
tree32b2513f5799946d42a7b4c912c0fa094763810f /fs/jbd/commit.c
parent5efab4a02c89c252fb4cce097aafde5f8208dbfe (diff)
powerpc/8xx: Update TLB asm so it behaves as linux mm expects.
Update the TLB asm to make proper use of _PAGE_DIRY and _PAGE_ACCESSED. Get rid of _PAGE_HWWRITE too. Pros: - I/D TLB Miss never needs to write to the linux pte. - _PAGE_ACCESSED is only set on TLB Error fixing accounting - _PAGE_DIRTY is mapped to 0x100, the changed bit, and is set directly when a page has been made dirty. - Proper RO/RW mapping of user space. - Free up 2 SW TLB bits in the linux pte(add back _PAGE_WRITETHRU ?) - kernel RO/user NA support. Cons: - A few more instructions in the TLB Miss routines. Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'fs/jbd/commit.c')
0 files changed, 0 insertions, 0 deletions
ycap: add first level indentation to easycap_testcard.c' href='/cgit/cgit.cgi/litmus-rt-pandaboard.git/commit/drivers/staging/easycap/easycap_testcard.c?id=abb46c8cc0826ab67cea69949e3f7757fc92783a'>abb46c8cc08
702422bd2d3
abb46c8cc08



702422bd2d3
abb46c8cc08





702422bd2d3
abb46c8cc08






702422bd2d3


abb46c8cc08
702422bd2d3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155



























                                                                               

                                                                               
                                       
    
                                                     
 





                                                                 
 
                        
















































                                                      
 




                                                          
 




                                                                   
 



                                             
 






                                                       

                         

                                        
 








                                                                         
 



                                                                        
 





                                                                              
 






                                                     


                         
               
 
/******************************************************************************
*                                                                             *
*  easycap_testcard.c                                                         *
*                                                                             *
******************************************************************************/
/*
 *
 *  Copyright (C) 2010 R.M. Thomas  <rmthomas@sciolus.org>
 *
 *
 *  This is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  The software is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this software; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
*/
/*****************************************************************************/

#include "easycap.h"

/*****************************************************************************/
#define TESTCARD_BYTESPERLINE (2 * 720)
void
easycap_testcard(struct easycap *peasycap, int field)
{
	int total;
	int y, u, v, r, g, b;
	unsigned char uyvy[4];
	int i1, line, k, m, n, more, much, barwidth, barheight;
	unsigned char bfbar[TESTCARD_BYTESPERLINE / 8], *p1, *p2;
	struct data_buffer *pfield_buffer;

	if (!peasycap) {
		SAY("ERROR: peasycap is NULL\n");
		return;
	}
	JOM(8, "%i=field\n", field);
	switch (peasycap->width) {
	case 720:
	case 360: {
		barwidth = (2 * 720) / 8;
		break;
	}
	case 704:
	case 352: {
		barwidth = (2 * 704) / 8;
		break;
	}
	case 640:
	case 320: {
		barwidth = (2 * 640) / 8;
		break;
	}
	default: {
		SAM("ERROR:  cannot set barwidth\n");
		return;
	}
	}
	if (TESTCARD_BYTESPERLINE < barwidth) {
		SAM("ERROR: barwidth is too large\n");
		return;
	}
	switch (peasycap->height) {
	case 576:
	case 288: {
		barheight = 576;
		break;
	}
	case 480:
	case 240: {
		barheight = 480;
		break;
	}
	default: {
		SAM("ERROR: cannot set barheight\n");
		return;
	}
	}
	total = 0;
	k = field;
	m = 0;
	n = 0;

	for (line = 0;  line < (barheight / 2);  line++) {
		for (i1 = 0;  i1 < 8;  i1++) {
			r = (i1 * 256)/8;
			g = (i1 * 256)/8;
			b = (i1 * 256)/8;

			y =  299*r/1000 + 587*g/1000 + 114*b/1000 ;
			u = -147*r/1000 - 289*g/1000 + 436*b/1000 ;
			u = u + 128;
			v =  615*r/1000 - 515*g/1000 - 100*b/1000 ;
			v = v + 128;

			uyvy[0] =  0xFF & u ;
			uyvy[1] =  0xFF & y ;
			uyvy[2] =  0xFF & v ;
			uyvy[3] =  0xFF & y ;

			p1 = &bfbar[0];
			while (p1 < &bfbar[barwidth]) {
				*p1++ = uyvy[0] ;
				*p1++ = uyvy[1] ;
				*p1++ = uyvy[2] ;
				*p1++ = uyvy[3] ;
				total += 4;
			}

			p1 = &bfbar[0];
			more = barwidth;

			while (more) {
				if ((FIELD_BUFFER_SIZE/PAGE_SIZE) <= m) {
					SAM("ERROR:  bad m reached\n");
					return;
				}
				if (PAGE_SIZE < n) {
					SAM("ERROR:  bad n reached\n");
					return;
				}

				if (0 > more) {
					SAM("ERROR:  internal fault\n");
					return;
				}

				much = PAGE_SIZE - n;
				if (much > more)
					much = more;
				pfield_buffer = &peasycap->field_buffer[k][m];
				p2 = pfield_buffer->pgo + n;
				memcpy(p2, p1, much);

				p1 += much;
				n += much;
				more -= much;
				if (PAGE_SIZE == n) {
					m++;
					n = 0;
				}
			}
		}
	}
	return;
}