@@ -622,19 +622,22 @@ setup_pixel_info(struct screen_info *si, u32 pixels_per_scan_line,
622
622
}
623
623
624
624
static efi_status_t
625
- __gop_query32 (struct efi_graphics_output_protocol_32 * gop32 ,
625
+ __gop_query32 (efi_system_table_t * sys_table_arg ,
626
+ struct efi_graphics_output_protocol_32 * gop32 ,
626
627
struct efi_graphics_output_mode_info * * info ,
627
628
unsigned long * size , u64 * fb_base )
628
629
{
629
630
struct efi_graphics_output_protocol_mode_32 * mode ;
631
+ efi_graphics_output_protocol_query_mode query_mode ;
630
632
efi_status_t status ;
631
633
unsigned long m ;
632
634
633
635
m = gop32 -> mode ;
634
636
mode = (struct efi_graphics_output_protocol_mode_32 * )m ;
637
+ query_mode = (void * )(unsigned long )gop32 -> query_mode ;
635
638
636
- status = efi_early -> call ( gop32 -> query_mode , gop32 ,
637
- mode -> mode , size , info );
639
+ status = __efi_call_early ( query_mode , ( void * ) gop32 , mode -> mode , size ,
640
+ info );
638
641
if (status != EFI_SUCCESS )
639
642
return status ;
640
643
@@ -643,8 +646,8 @@ __gop_query32(struct efi_graphics_output_protocol_32 *gop32,
643
646
}
644
647
645
648
static efi_status_t
646
- setup_gop32 (struct screen_info * si , efi_guid_t * proto ,
647
- unsigned long size , void * * gop_handle )
649
+ setup_gop32 (efi_system_table_t * sys_table_arg , struct screen_info * si ,
650
+ efi_guid_t * proto , unsigned long size , void * * gop_handle )
648
651
{
649
652
struct efi_graphics_output_protocol_32 * gop32 , * first_gop ;
650
653
unsigned long nr_gops ;
@@ -654,7 +657,7 @@ setup_gop32(struct screen_info *si, efi_guid_t *proto,
654
657
u64 fb_base ;
655
658
struct efi_pixel_bitmask pixel_info ;
656
659
int pixel_format ;
657
- efi_status_t status ;
660
+ efi_status_t status = EFI_NOT_FOUND ;
658
661
u32 * handles = (u32 * )(unsigned long )gop_handle ;
659
662
int i ;
660
663
@@ -667,7 +670,7 @@ setup_gop32(struct screen_info *si, efi_guid_t *proto,
667
670
efi_guid_t conout_proto = EFI_CONSOLE_OUT_DEVICE_GUID ;
668
671
bool conout_found = false;
669
672
void * dummy = NULL ;
670
- u32 h = handles [i ];
673
+ efi_handle_t h = ( efi_handle_t )( unsigned long ) handles [i ];
671
674
u64 current_fb_base ;
672
675
673
676
status = efi_call_early (handle_protocol , h ,
@@ -680,7 +683,8 @@ setup_gop32(struct screen_info *si, efi_guid_t *proto,
680
683
if (status == EFI_SUCCESS )
681
684
conout_found = true;
682
685
683
- status = __gop_query32 (gop32 , & info , & size , & current_fb_base );
686
+ status = __gop_query32 (sys_table_arg , gop32 , & info , & size ,
687
+ & current_fb_base );
684
688
if (status == EFI_SUCCESS && (!first_gop || conout_found )) {
685
689
/*
686
690
* Systems that use the UEFI Console Splitter may
@@ -735,19 +739,22 @@ setup_gop32(struct screen_info *si, efi_guid_t *proto,
735
739
}
736
740
737
741
static efi_status_t
738
- __gop_query64 (struct efi_graphics_output_protocol_64 * gop64 ,
742
+ __gop_query64 (efi_system_table_t * sys_table_arg ,
743
+ struct efi_graphics_output_protocol_64 * gop64 ,
739
744
struct efi_graphics_output_mode_info * * info ,
740
745
unsigned long * size , u64 * fb_base )
741
746
{
742
747
struct efi_graphics_output_protocol_mode_64 * mode ;
748
+ efi_graphics_output_protocol_query_mode query_mode ;
743
749
efi_status_t status ;
744
750
unsigned long m ;
745
751
746
752
m = gop64 -> mode ;
747
753
mode = (struct efi_graphics_output_protocol_mode_64 * )m ;
754
+ query_mode = (void * )(unsigned long )gop64 -> query_mode ;
748
755
749
- status = efi_early -> call ( gop64 -> query_mode , gop64 ,
750
- mode -> mode , size , info );
756
+ status = __efi_call_early ( query_mode , ( void * ) gop64 , mode -> mode , size ,
757
+ info );
751
758
if (status != EFI_SUCCESS )
752
759
return status ;
753
760
@@ -756,8 +763,8 @@ __gop_query64(struct efi_graphics_output_protocol_64 *gop64,
756
763
}
757
764
758
765
static efi_status_t
759
- setup_gop64 (struct screen_info * si , efi_guid_t * proto ,
760
- unsigned long size , void * * gop_handle )
766
+ setup_gop64 (efi_system_table_t * sys_table_arg , struct screen_info * si ,
767
+ efi_guid_t * proto , unsigned long size , void * * gop_handle )
761
768
{
762
769
struct efi_graphics_output_protocol_64 * gop64 , * first_gop ;
763
770
unsigned long nr_gops ;
@@ -767,7 +774,7 @@ setup_gop64(struct screen_info *si, efi_guid_t *proto,
767
774
u64 fb_base ;
768
775
struct efi_pixel_bitmask pixel_info ;
769
776
int pixel_format ;
770
- efi_status_t status ;
777
+ efi_status_t status = EFI_NOT_FOUND ;
771
778
u64 * handles = (u64 * )(unsigned long )gop_handle ;
772
779
int i ;
773
780
@@ -780,7 +787,7 @@ setup_gop64(struct screen_info *si, efi_guid_t *proto,
780
787
efi_guid_t conout_proto = EFI_CONSOLE_OUT_DEVICE_GUID ;
781
788
bool conout_found = false;
782
789
void * dummy = NULL ;
783
- u64 h = handles [i ];
790
+ efi_handle_t h = ( efi_handle_t )( unsigned long ) handles [i ];
784
791
u64 current_fb_base ;
785
792
786
793
status = efi_call_early (handle_protocol , h ,
@@ -793,7 +800,8 @@ setup_gop64(struct screen_info *si, efi_guid_t *proto,
793
800
if (status == EFI_SUCCESS )
794
801
conout_found = true;
795
802
796
- status = __gop_query64 (gop64 , & info , & size , & current_fb_base );
803
+ status = __gop_query64 (sys_table_arg , gop64 , & info , & size ,
804
+ & current_fb_base );
797
805
if (status == EFI_SUCCESS && (!first_gop || conout_found )) {
798
806
/*
799
807
* Systems that use the UEFI Console Splitter may
@@ -850,8 +858,9 @@ setup_gop64(struct screen_info *si, efi_guid_t *proto,
850
858
/*
851
859
* See if we have Graphics Output Protocol
852
860
*/
853
- static efi_status_t setup_gop (struct screen_info * si , efi_guid_t * proto ,
854
- unsigned long size )
861
+ efi_status_t efi_setup_gop (efi_system_table_t * sys_table_arg ,
862
+ struct screen_info * si , efi_guid_t * proto ,
863
+ unsigned long size )
855
864
{
856
865
efi_status_t status ;
857
866
void * * gop_handle = NULL ;
@@ -867,10 +876,13 @@ static efi_status_t setup_gop(struct screen_info *si, efi_guid_t *proto,
867
876
if (status != EFI_SUCCESS )
868
877
goto free_handle ;
869
878
870
- if (efi_early -> is64 )
871
- status = setup_gop64 (si , proto , size , gop_handle );
872
- else
873
- status = setup_gop32 (si , proto , size , gop_handle );
879
+ if (efi_is_64bit ()) {
880
+ status = setup_gop64 (sys_table_arg , si , proto , size ,
881
+ gop_handle );
882
+ } else {
883
+ status = setup_gop32 (sys_table_arg , si , proto , size ,
884
+ gop_handle );
885
+ }
874
886
875
887
free_handle :
876
888
efi_call_early (free_pool , gop_handle );
@@ -1038,7 +1050,7 @@ void setup_graphics(struct boot_params *boot_params)
1038
1050
EFI_LOCATE_BY_PROTOCOL ,
1039
1051
& graphics_proto , NULL , & size , gop_handle );
1040
1052
if (status == EFI_BUFFER_TOO_SMALL )
1041
- status = setup_gop ( si , & graphics_proto , size );
1053
+ status = efi_setup_gop ( NULL , si , & graphics_proto , size );
1042
1054
1043
1055
if (status != EFI_SUCCESS ) {
1044
1056
size = 0 ;
0 commit comments