Author: arty
Date: Tue Jun 27 12:01:08 2006
New Revision: 22656
URL:
http://svn.reactos.org/svn/reactos?rev=22656&view=rev
Log:
Regularize with generated interfaces.
Modified:
branches/powerpc/reactos/Makefile
branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c
branches/powerpc/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild
branches/powerpc/reactos/boot/freeldr/freeldr/include/of.h
branches/powerpc/reactos/tools/ofw_interface/calls.ofw
branches/powerpc/reactos/tools/ofw_interface/ofw_interface.mak
Modified: branches/powerpc/reactos/Makefile
URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/Makefile?rev=22…
==============================================================================
--- branches/powerpc/reactos/Makefile (original)
+++ branches/powerpc/reactos/Makefile Tue Jun 27 12:01:08 2006
@@ -372,9 +372,7 @@
$(ERRCODES_RC) \
$(NCI_SERVICE_FILES) \
$(GENDIB_DIB_FILES) \
- $(OFW_INTERFACE_OUTPUT) \
- $(OFW_INTERFACE_SOURCE) \
- $(OFW_INTERFACE_HEADER)
+ $(OFW_INTERFACE_SERVICE_FILES)
$(ROS_AUTOMAKE): $(RBUILD_TARGET) $(PREAUTO) $(XMLBUILDFILES)
$(ECHO_RBUILD)
Modified: branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c
URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/boot/freeldr/fr…
==============================================================================
--- branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c (original)
+++ branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c Tue Jun 27 12:01:08
2006
@@ -29,9 +29,9 @@
char BootPath[0x100] = { 0 }, BootPart[0x100] = { 0 }, CmdLine[0x100] = { 0 };
jmp_buf jmp;
-void le_swap( const void *start_addr_v,
- const void *end_addr_v,
- const void *target_addr_v ) {
+void le_swap( void *start_addr_v,
+ void *end_addr_v,
+ void *target_addr_v ) {
long *start_addr = (long *)ROUND_DOWN((long)start_addr_v,8),
*end_addr = (long *)ROUND_UP((long)end_addr_v,8),
*target_addr = (long *)ROUND_DOWN((long)target_addr_v,8);
@@ -43,90 +43,6 @@
start_addr += 2;
target_addr += 2;
}
-}
-
-int ofw_finddevice( const char *name ) {
- int ret, len;
-
- len = strlen(name);
- le_swap( name, name + len, name );
- ret = ofproxy( 0, (char *)name, NULL, NULL, NULL );
- le_swap( name, name + len, name );
- return ret;
-}
-
-int ofw_getprop( int package, const char *name, void *buffer, int buflen ) {
- int ret, len = strlen(name);
- le_swap( name, name + len, name );
- le_swap( buffer, (char *)buffer + buflen, buffer );
- ret = ofproxy
- ( 4, (void *)package, (char *)name, buffer, (void *)buflen );
- le_swap( buffer, (char *)buffer + buflen, buffer );
- le_swap( name, name + len, name );
- return ret;
-}
-
-/* Since this is from external storage, it doesn't need swapping */
-int ofw_write( int handle, const char *data, int len ) {
- int ret;
- le_swap( data, data + len, data );
- ret = ofproxy
- ( 8, (void *)handle, (char *)data, (void *)len, NULL );
- le_swap( data, data + len, data );
- return ret;
-}
-
-/* Since this is from external storage, it doesn't need swapping */
-int ofw_read( int handle, const char *data, int len ) {
- int ret;
-
- le_swap( data, data + len, data );
- ret = ofproxy
- ( 12, (void *)handle, (char *)data, (void *)len, NULL );
- le_swap( data, data + len, data );
-
- return ret;
-}
-
-void ofw_exit() {
- ofproxy( 16, NULL, NULL, NULL, NULL );
-}
-
-void ofw_dumpregs() {
- ofproxy( 20, NULL, NULL, NULL, NULL );
-}
-
-void ofw_print_string( const char *str ) {
- int len = strlen(str);
- le_swap( (char *)str, str + len, (char *)str );
- ofproxy( 24, (void *)str, NULL, NULL, NULL );
- le_swap( (char *)str, str + len, (char *)str );
-}
-
-void ofw_print_number( int num ) {
- ofproxy( 28, (void *)num, NULL, NULL, NULL );
-}
-
-int ofw_open( const char *name ) {
- int ret, len;
-
- len = strlen(name);
- le_swap( name, name + len, name );
- ret = ofproxy( 32, (char *)name, NULL, NULL, NULL );
- le_swap( name, name + len, name );
- return ret;
-}
-
-int ofw_child( int package ) {
- return ofproxy( 36, (void *)package, NULL, NULL, NULL );
-}
-
-int ofw_peer( int package ) {
- return ofproxy( 40, (void *)package, NULL, NULL, NULL );
-}
-
-int ofw_seek( int handle, long long location ) {
- return ofproxy( 44, (void *)handle, (void *)(int)(location >> 32), (void
*)(int)location, NULL );
}
void PpcPutChar( int ch ) {
Modified: branches/powerpc/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/boot/freeldr/fr…
==============================================================================
--- branches/powerpc/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild (original)
+++ branches/powerpc/reactos/boot/freeldr/freeldr/freeldr_arch.rbuild Tue Jun 27 12:01:08
2006
@@ -62,6 +62,7 @@
<compilerflag>-fno-zero-initialized-in-bss</compilerflag>
<compilerflag>-Os</compilerflag>
<file>boot.s</file>
+ <file>ofw.c</file>
<file>mach.c</file>
<file>mboot.c</file>
</module>
Modified: branches/powerpc/reactos/boot/freeldr/freeldr/include/of.h
URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/boot/freeldr/fr…
==============================================================================
--- branches/powerpc/reactos/boot/freeldr/freeldr/include/of.h (original)
+++ branches/powerpc/reactos/boot/freeldr/freeldr/include/of.h Tue Jun 27 12:01:08 2006
@@ -6,20 +6,14 @@
#define REV(x)
(((x)>>24)&0xff)|(((x)>>8)&0xff00)|(((x)<<24)&0xff000000)|(((x)<<8)&0xff0000)
+#include "of_call.h"
+#include <string.h>
+
typedef int (*of_proxy)
( int table_off, void *arg1, void *arg2, void *arg3, void *arg4 );
typedef long jmp_buf[100];
-
extern of_proxy ofproxy;
-
-int ofw_finddevice( const char *name );
-int ofw_getprop( int package, const char *name, void *buffer, int size );
-int ofw_open( const char *name );
-int ofw_write( int handle, const char *buffer, int size );
-int ofw_read( int handle, const char *buffer, int size );
-void ofw_print_string(const char *);
-void ofw_print_number(int);
-void ofw_exit();
+extern void le_swap( void *begin, void *end, void *dest );
int setjmp( jmp_buf buf );
int longjmp( jmp_buf buf, int retval );
Modified: branches/powerpc/reactos/tools/ofw_interface/calls.ofw
URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/tools/ofw_inter…
==============================================================================
--- branches/powerpc/reactos/tools/ofw_interface/calls.ofw (original)
+++ branches/powerpc/reactos/tools/ofw_interface/calls.ofw Tue Jun 27 12:01:08 2006
@@ -2,7 +2,7 @@
# Real OFW functions to proxy
finddevice 1 1 char* int
open 1 1 int int
-getprop 4 1 int char* int*:arg3 int int
+getprop 4 1 int char* char*:arg3 int int
write 3 1 int char*:arg2 int int
read 3 1 int char*:arg2 int int
exit 0 0
Modified: branches/powerpc/reactos/tools/ofw_interface/ofw_interface.mak
URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/tools/ofw_inter…
==============================================================================
--- branches/powerpc/reactos/tools/ofw_interface/ofw_interface.mak (original)
+++ branches/powerpc/reactos/tools/ofw_interface/ofw_interface.mak Tue Jun 27 12:01:08
2006
@@ -46,7 +46,7 @@
$(ECHO_CC)
${host_gpp} $(OFW_INTERFACE_HOST_CFLAGS) -c $< -o $@
-$(OFW_SERVICE_FILES): $(OFW_INTERFACE_TARGET) $(OFW_INTERFACE_INPUT)
+$(OFW_INTERFACE_SERVICE_FILES): $(OFW_INTERFACE_TARGET) $(OFW_INTERFACE_INPUT)
$(ECHO_OFW)
$(Q)$(OFW_INTERFACE_TARGET) \
$(OFW_INTERFACE_INPUT) \